# developer Communications, Media, Energy and Utilities APIs (Managed Package) (industries) - Full Documentation # Access Custom Fields Using Cart Document You can access custom fields defined on the Order or OrderItem objects by mapping them to keys in the cart document. These keys represent the internal identifiers for the custom fields and should exclude any namespace prefixes or \_\_c suffixes. Once mapped, the custom field values can be retrieved or updated through the cart document wrapper during order or quote processing. ## Use Field Mappers to Add Custom Fields in the Cart Document Add custom fields to the cart document using field mapping. After you create the custom field for Order or OrderItem sObjects, you can map them to a key in cart document. Since the key is the internal representation of the custom field in the cart document, it should not have a namespace or "\_\_c". When value for a custom field will be updated using cart document wrapper, this mapping will be used to get the key in cart document and the corresponding node will be updated with the value. Similarly, this mapping will be used to create response (external representation, containing namespace prefix and "\_\_c") from the internal cart document. Example sample mapping record: ![Sample Mapping Record](https://developer.salesforce.com/docs/media/custom-field-map.png "Sample Mapping Record") If a new custom field is created on OrderItem then a mapping record for the field should also be created. To create a new mapping. 1. From Setup, in the Quick Find box, enter Custom Settings, and then select **Custom Settings**. 2. Next to Custom Field Maps, click **Manage**. 3. Click **New** and enter the details for your mapping record. **note:** For new line items, if a custom field's value isn't set by a custom implementation, its default value is applied at the end of the postCartItems process, after validation and pricing. ## Use StandardAPIFields to Add Custom Fields to Cart Document When using [Cart Document APIs](https://developer.salesforce.com/docs/industries/cme/guide/use-cart-document-cpq.html) in custom implementations such as pre-hooks and post-hooks or custom pricing steps, customers can access fields on both line items and the header object. By default, only a predefined set of fields is loaded, and only those field values can be retrieved. To fetch or set a custom field added by the customer on line items using Cart Document APIs, the admin must create a field set on the corresponding object and include the custom field in that field set. For example, if a custom field `CartType__c` is added to a header object like Order, and there is a requirement to read its value during cart operations in a custom implementation using Cart Document APIs, the customer must perform these steps. 1. Create a field set: Create a new field set named `StandardAPIFields` on the Order object. ![Field Set](https://developer.salesforce.com/docs/media/field_set.png "Field Set") 2. Add the custom field: Add the `CartType__c` field to the `StandardAPIFields` field set. 3. Clear cache and regenerate data: Clear the managed platform cache, then run the `Generate EPC Compile Data` job from the **Vlocity CMT Administration** page. 4. Once the setup is complete, the field value can be accessed in custom implementations as shown below. ``` Map args = new Map{'field' => 'CartType__c'}; Map output = cartDocument.call('getCartField', args); String cartType = (String) output.get('result'); ``` Similarly, if a custom field `LineItemType__c` is added to the OrderItem object, the customer must perform these steps. 1. Create a field set: Create a new field set named `StandardAPIFields` on the Order Product object. 2. Add the custom field: Add the `LineItemType__c` field to the `StandardAPIFields` field set. 3. Clear cache and regenerate data: Clear the managed platform cache, then run the `Generate EPC Compile Data` job from the **Vlocity CMT Administration** page. 4. Once the setup is complete, the field value can be accessed in custom implementations as shown below. ``` Map args = new Map{'field' => 'LineItemType__c'}; Map output = cartDocumentItem.call('getItemField', args); String cartType = (String) output.get('result'); ``` **note:** - Custom fields are not populated on the CpqCartDocumentItem during the postCartsItems (AddToCart) scenario. - Custom fields are not populated by default. However, if custom logic is implemented to set their values, the fields will be populated and accessible like in other APIs. # AccountFlattenedHierarchy Represents a flattened, denormalized view of an account's ancestor chain — up to 15 levels of parent accounts — so queries and reports can filter or group by any level of the hierarchy without recursively walking Account.ParentId. This object is available in API version 68.0 and later. ## Supported Calls `create()`, `delete()`, `describeLayout()`, `describeSObjects()`, `getDeleted()`, `getUpdated()`, `query()`, `retrieve()`, `search()`, `undelete()`, `update()`, `upsert()` ## Special Access Rules Available only in orgs with Manufacturing Cloud, Automotive Cloud, or Consumer Goods Cloud enabled, or with the relevant Account Hierarchy / B2B relationship features licensed. ## Fields ### AccountId **Type:** reference **Properties:** Create, Filter, Group, Sort, Update **Description:** The account whose hierarchy is being flattened. **Relationship Name:** Account **Refers To:** Account ### AccountLevel01Id – AccountLevel15Id **Type:** reference **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** Fifteen parallel fields, one per hierarchy level, each holding the account ID of AccountId's ancestor at that level (Level01 = immediate parent, up to Level15). **Relationship Name:** AccountLevel01 … AccountLevel15 (one per field) **Refers To:** Account ### CurrencyIsoCode **Type:** picklist **Properties:** Create, Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** ISO code for the currency of this record. Possible values are: AED (UAE Dirham), USD (U.S. Dollar), and every other active currency ISO code configured for the org. The default value is USD. ### ExecutionRefIdentifier **Type:** string **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** Identifier for the batch/job execution that generated or last refreshed this flattened-hierarchy record. ### InternalOrganizationUnitId **Type:** reference **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The internal organization unit this flattened hierarchy record applies to. **Relationship Name:** InternalOrganizationUnit **Refers To:** InternalOrganizationUnit ### IsPromotionRole **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether AccountId holds a promotion-related role in this hierarchy. The default value is false. ### IsStoreRole **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether AccountId holds a store role in this hierarchy. The default value is false. ### LastReferencedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** Date on which a user last viewed a record related to this flattened-hierarchy record. ### LastViewedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** Date on which a user last viewed this record. ### Name **Type:** string **Properties:** Autonumber, Defaulted on create, Filter, idLookup, Sort **Description:** Auto-generated name for the flattened-hierarchy record. ### NodeLevel **Type:** int **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The depth of AccountId within its hierarchy (number of ancestor levels populated). ### OwnerId **Type:** reference **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** The user or queue that owns this record. **Relationship Name:** Owner **Refers To:** Group, User ### Source **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The source object this flattened hierarchy was generated from. Possible values are Account and AccountAccountRelation. ### UsageType **Type:** picklist **Properties:** Create, Filter, Group, Restricted picklist, Sort, Update **Description:** The usage context for this flattened hierarchy, for example, Retail. ## Associated Objects This object has the following associated objects. If the API version isn't specified, they're available in the same API versions as this object. Otherwise, they're available in the specified API version and later. - [AccountFlattenedHierarchyChangeEvent](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/change-event.md): Change events are available for the object. - [AccountFlattenedHierarchyFeed](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/feed.md): Feed tracking is available for the object. - [AccountFlattenedHierarchyHistory](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/history.md): History is available for tracked fields of the object. - [AccountFlattenedHierarchyOwnerSharingRule](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/owner-sharing-rule.md): Sharing rules are available for the object. - [AccountFlattenedHierarchyShare](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/share.md): Sharing is available for the object. # AccountFlattenedHierarchy Represents a flattened, denormalized view of an account's ancestor chain (up to 15 levels of parent accounts) so queries and reports can filter or group by any level of the hierarchy without recursively walking Account.ParentId. This object is available in API version 68.0 and later. ## Supported Calls `create()`, `delete()`, `describeLayout()`, `describeSObjects()`, `getDeleted()`, `getUpdated()`, `query()`, `retrieve()`, `search()`, `undelete()`, `update()`, `upsert()` ## Special Access Rules Available only in orgs with Manufacturing Cloud, Automotive Cloud, or Consumer Goods Cloud enabled, or with the relevant Account Hierarchy / B2B relationship features licensed. ## Fields ### AccountId **Type:** reference **Properties:** Create, Filter, Group, Sort, Update **Description:** The account whose hierarchy is being flattened. **Relationship Name:** Account **Refers To:** Account ### AccountLevel01Id – AccountLevel15Id **Type:** reference **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** Fifteen parallel fields, one per hierarchy level, each holding the account ID of AccountId's ancestor at that level (Level01 = immediate parent, up to Level15). **Relationship Name:** AccountLevel01 … AccountLevel15 (one per field) **Refers To:** Account ### CurrencyIsoCode **Type:** picklist **Properties:** Create, Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** ISO code for the currency of this record. Possible values are: AED (UAE Dirham), USD (U.S. Dollar), and every other active currency ISO code configured for the org. The default value is USD. ### ExecutionRefIdentifier **Type:** string **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** Identifier for the batch/job execution that generated or last refreshed this flattened-hierarchy record. ### InternalOrganizationUnitId **Type:** reference **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The internal organization unit this flattened hierarchy record applies to. **Relationship Name:** InternalOrganizationUnit **Refers To:** InternalOrganizationUnit ### IsPromotionRole **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether AccountId holds a promotion-related role in this hierarchy. The default value is false. ### IsStoreRole **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether AccountId holds a store role in this hierarchy. The default value is false. ### LastReferencedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** Date on which a user last viewed a record related to this flattened-hierarchy record. ### LastViewedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** Date on which a user last viewed this record. ### Name **Type:** string **Properties:** Autonumber, Defaulted on create, Filter, idLookup, Sort **Description:** Auto-generated name for the flattened-hierarchy record. ### NodeLevel **Type:** int **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The depth of AccountId within its hierarchy (number of ancestor levels populated). ### OwnerId **Type:** reference **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** The user or queue that owns this record. **Relationship Name:** Owner **Refers To:** Group, User ### Source **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The source object this flattened hierarchy was generated from. Possible values are Account and AccountAccountRelation. ### UsageType **Type:** picklist **Properties:** Create, Filter, Group, Restricted picklist, Sort, Update **Description:** The usage context for this flattened hierarchy, for example, Retail. ## Associated Objects This object has the following associated objects. If the API version isn't specified, they're available in the same API versions as this object. Otherwise, they're available in the specified API version and later. - [AccountFlattenedHierarchyChangeEvent](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/associated-objects/change-event.md): Change events are available for the object. - [AccountFlattenedHierarchyFeed](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/associated-objects/feed.md): Feed tracking is available for the object. - [AccountFlattenedHierarchyHistory](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/associated-objects/history.md): History is available for tracked fields of the object. - [AccountFlattenedHierarchyOwnerSharingRule](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/associated-objects/owner-sharing-rule.md): Sharing rules are available for the object. - [AccountFlattenedHierarchyShare](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/associated-objects/share.md): Sharing is available for the object. # AccountInternalOrgUnit Junction object that associates an Account with an InternalOrganizationUnit (business unit/branch), carrying business-unit-specific account settings such as pricing type, tax jurisdiction, and out-of-stock/availability flags. This object is available in API version 68.0 and later. ## Supported Calls `create()`, `delete()`, `describeLayout()`, `describeSObjects()`, `getDeleted()`, `getUpdated()`, `query()`, `retrieve()`, `search()`, `undelete()`, `update()`, `upsert()` ## Special Access Rules Available only in orgs with Manufacturing Cloud, Automotive Cloud, or Consumer Goods Cloud enabled, or with the relevant Account Hierarchy / B2B relationship features licensed. ## Fields ### AccountId **Type:** reference **Properties:** Create, Filter, Group, Sort, Update **Description:** The account associated with the internal organization unit. **Relationship Name:** Account **Refers To:** Account ### BusinessPartnerMatchCode **Type:** textarea **Properties:** Create, Filter, Nillable, Sort, Update **Description:** A match code used to reconcile this account against an external business-partner record for this internal organization unit. ### CurrencyIsoCode **Type:** picklist **Properties:** Create, Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** ISO code for the currency of this record. Possible values are: AED (UAE Dirham), USD (U.S. Dollar), and every other active currency ISO code configured for the org. The default value is USD. ### InternalOrganizationUnitId **Type:** reference **Properties:** Create, Filter, Group, Sort, Update **Description:** The internal organization unit (business unit) associated with the account. **Relationship Name:** InternalOrganizationUnit **Refers To:** InternalOrganizationUnit ### IsOutofStockDetected **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether an out-of-stock condition was detected for this account/org-unit combination. The default value is false. ### IsProdtAvlCondDetected **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether a product-availability condition was detected for this account/org-unit combination. The default value is false. ### IsSalesRelevant **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether this account is relevant for sales activity within this internal organization unit. The default value is false. ### LastReferencedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** Date on which a user last viewed a record related to this record. ### LastViewedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** Date on which a user last viewed this record. ### Name **Type:** string **Properties:** Autonumber, Defaulted on create, Filter, idLookup, Sort **Description:** Auto-generated name for the record. ### OwnerId **Type:** reference **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** The user or queue that owns this record. **Relationship Name:** Owner **Refers To:** Group, User ### PricingType **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** Pricing type assigned to the account for the selected internal organization unit. Possible values are Standard, StandardIncludingSalesTax, and SampleOrDonation. ### PrimaryContactId **Type:** reference **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The primary contact for the account within this internal organization unit. **Relationship Name:** PrimaryContact **Refers To:** Contact ### Priority **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The priority assigned to this account within the internal organization unit, for example for order fulfillment sequencing. ### TaxJurisdictionCode **Type:** string **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** Code identifying the tax jurisdiction that applies to this account within the internal organization unit. ### TradeClass **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The trade class assigned to the account within the internal organization unit, used for pricing/segmentation purposes. ## Associated Objects This object has the following associated objects. If the API version isn't specified, they're available in the same API versions as this object. Otherwise, they're available in the specified API version and later. - [AccountInternalOrgUnitChangeEvent](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/change-event.md): Change events are available for the object. - [AccountInternalOrgUnitFeed](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/feed.md): Feed tracking is available for the object. - [AccountInternalOrgUnitHistory](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/history.md): History is available for tracked fields of the object. - [AccountInternalOrgUnitOwnerSharingRule](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/owner-sharing-rule.md): Sharing rules are available for the object. - [AccountInternalOrgUnitShare](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/share.md): Sharing is available for the object. # AccountInternalOrgUnit Junction object that associates an Account with an InternalOrganizationUnit (business unit/branch), carrying business-unit-specific account settings such as pricing type, tax jurisdiction, and out-of-stock/availability flags. This object is available in API version 68.0 and later. ## Supported Calls `create()`, `delete()`, `describeLayout()`, `describeSObjects()`, `getDeleted()`, `getUpdated()`, `query()`, `retrieve()`, `search()`, `undelete()`, `update()`, `upsert()` ## Special Access Rules Available only in orgs with Manufacturing Cloud, Automotive Cloud, or Consumer Goods Cloud enabled, or with the relevant Account Hierarchy / B2B relationship features licensed. ## Fields ### AccountId **Type:** reference **Properties:** Create, Filter, Group, Sort, Update **Description:** The account associated with the internal organization unit. **Relationship Name:** Account **Refers To:** Account ### BusinessPartnerMatchCode **Type:** textarea **Properties:** Create, Filter, Nillable, Sort, Update **Description:** A match code used to reconcile this account against an external business-partner record for this internal organization unit. ### CurrencyIsoCode **Type:** picklist **Properties:** Create, Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** ISO code for the currency of this record. Possible values are: AED (UAE Dirham), USD (U.S. Dollar), and every other active currency ISO code configured for the org. The default value is USD. ### InternalOrganizationUnitId **Type:** reference **Properties:** Create, Filter, Group, Sort, Update **Description:** The internal organization unit (business unit) associated with the account. **Relationship Name:** InternalOrganizationUnit **Refers To:** InternalOrganizationUnit ### IsOutofStockDetected **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether an out-of-stock condition was detected for this account/org-unit combination. The default value is false. ### IsProdtAvlCondDetected **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether a product-availability condition was detected for this account/org-unit combination. The default value is false. ### IsSalesRelevant **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether this account is relevant for sales activity within this internal organization unit. The default value is false. ### LastReferencedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** Date on which a user last viewed a record related to this record. ### LastViewedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** Date on which a user last viewed this record. ### Name **Type:** string **Properties:** Autonumber, Defaulted on create, Filter, idLookup, Sort **Description:** Auto-generated name for the record. ### OwnerId **Type:** reference **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** The user or queue that owns this record. **Relationship Name:** Owner **Refers To:** Group, User ### PricingType **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** Pricing type assigned to the account for the selected internal organization unit. Possible values are Standard, StandardIncludingSalesTax, and SampleOrDonation. ### PrimaryContactId **Type:** reference **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The primary contact for the account within this internal organization unit. **Relationship Name:** PrimaryContact **Refers To:** Contact ### Priority **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The priority assigned to this account within the internal organization unit, for example for order fulfillment sequencing. ### TaxJurisdictionCode **Type:** string **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** Code identifying the tax jurisdiction that applies to this account within the internal organization unit. ### TradeClass **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The trade class assigned to the account within the internal organization unit, used for pricing/segmentation purposes. ## Associated Objects This object has the following associated objects. If the API version isn't specified, they're available in the same API versions as this object. Otherwise, they're available in the specified API version and later. - [AccountInternalOrgUnitChangeEvent](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/associated-objects/change-event.md): Change events are available for the object. - [AccountInternalOrgUnitFeed](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/associated-objects/feed.md): Feed tracking is available for the object. - [AccountInternalOrgUnitHistory](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/associated-objects/history.md): History is available for tracked fields of the object. - [AccountInternalOrgUnitOwnerSharingRule](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/associated-objects/owner-sharing-rule.md): Sharing rules are available for the object. - [AccountInternalOrgUnitShare](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/associated-objects/share.md): Sharing is available for the object. # AccountRole Defines a functional role (such as Billing Account, Delivery Recipient, Payer, or Retail Store) that an account plays within a given internal organization unit, along with role-specific order/invoice/delivery document-type defaults. This object is available in API version 68.0 and later. ## Supported Calls `create()`, `delete()`, `describeLayout()`, `describeSObjects()`, `getDeleted()`, `getUpdated()`, `query()`, `retrieve()`, `undelete()`, `update()`, `upsert()` ## Special Access Rules Available only in orgs with Manufacturing Cloud, Automotive Cloud, or Consumer Goods Cloud enabled, or with the relevant Account Hierarchy / B2B relationship features licensed. ## Fields ### AccountId **Type:** reference **Properties:** Create, Filter, Group, Sort, Update **Description:** The account that holds this role. **Relationship Name:** Account **Refers To:** Account ### AllowedOrdererType **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The type of orderer allowed for this role. Possible values are Direct, Indirect, and Replenishment. ### CurrencyIsoCode **Type:** picklist **Properties:** Create, Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** ISO code for the currency of this record. Possible values are: AED (UAE Dirham), USD (U.S. Dollar), and every other active currency ISO code configured for the org. The default value is USD. ### DeliveryDocumentTrxnType **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** Default delivery-document transaction type used for this role, for example ValuatedDeliveryNote. ### EndDate **Type:** date **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** Date on which this role assignment ends. ### InternalOrganizationUnitId **Type:** reference **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The internal organization unit this role applies to. **Relationship Name:** InternalOrganizationUnit **Refers To:** InternalOrganizationUnit ### InvoiceDocumentTrxnType **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** Default invoice-document transaction type used for this role, for example CreditMemo. ### LastReferencedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** Date on which a user last viewed a record related to this role. ### LastViewedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** Date on which a user last viewed this role record. ### Name **Type:** string **Properties:** Autonumber, Defaulted on create, Filter, idLookup, Sort **Description:** Auto-generated name for the role record. ### OrderDocumentTrxnType **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** Default order-document transaction type used for this role, for example CashOrder. ### OwnerId **Type:** reference **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** The user or queue that owns this role record. **Relationship Name:** Owner **Refers To:** Group, User ### PresetQtyModificationType **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** Indicates whether preset order quantities can be increased, decreased, both, or neither for this role. ### Role **Type:** picklist **Properties:** Create, Filter, Group, Restricted picklist, Sort **Description:** The functional role the account plays, for example BillingAccount, Payer, RetailStore, or DeliveryRecipient. ### StartDate **Type:** date **Properties:** Create, Filter, Group, Sort, Update **Description:** Date on which this role assignment starts. ### UsageType **Type:** picklist **Properties:** Create, Filter, Group, Restricted picklist, Sort **Description:** The usage context for this role, for example, Retail. ## Associated Objects This object has the following associated objects. If the API version isn't specified, they're available in the same API versions as this object. Otherwise, they're available in the specified API version and later. - [AccountRoleChangeEvent](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/change-event.md): Change events are available for the object. - [AccountRoleFeed](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/feed.md): Feed tracking is available for the object. - [AccountRoleHistory](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/history.md): History is available for tracked fields of the object. - [AccountRoleOwnerSharingRule](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/owner-sharing-rule.md): Sharing rules are available for the object. - [AccountRoleShare](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/share.md): Sharing is available for the object. # AccountRole Defines a functional role (such as Billing Account, Delivery Recipient, Payer, or Retail Store) that an account plays within a given internal organization unit, along with role-specific order/invoice/delivery document-type defaults. This object is available in API version 68.0 and later. ## Supported Calls `create()`, `delete()`, `describeLayout()`, `describeSObjects()`, `getDeleted()`, `getUpdated()`, `query()`, `retrieve()`, `undelete()`, `update()`, `upsert()` ## Special Access Rules Available only in orgs with Manufacturing Cloud, Automotive Cloud, or Consumer Goods Cloud enabled, or with the relevant Account Hierarchy / B2B relationship features licensed. ## Fields ### AccountId **Type:** reference **Properties:** Create, Filter, Group, Sort, Update **Description:** The account that holds this role. **Relationship Name:** Account **Refers To:** Account ### AllowedOrdererType **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The type of orderer allowed for this role. Possible values are Direct, Indirect, and Replenishment. ### CurrencyIsoCode **Type:** picklist **Properties:** Create, Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** ISO code for the currency of this record. Possible values are: AED (UAE Dirham), USD (U.S. Dollar), and every other active currency ISO code configured for the org. The default value is USD. ### DeliveryDocumentTrxnType **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** Default delivery-document transaction type used for this role, for example ValuatedDeliveryNote. ### EndDate **Type:** date **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** Date on which this role assignment ends. ### InternalOrganizationUnitId **Type:** reference **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The internal organization unit this role applies to. **Relationship Name:** InternalOrganizationUnit **Refers To:** InternalOrganizationUnit ### InvoiceDocumentTrxnType **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** Default invoice-document transaction type used for this role, for example CreditMemo. ### LastReferencedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** Date on which a user last viewed a record related to this role. ### LastViewedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** Date on which a user last viewed this role record. ### Name **Type:** string **Properties:** Autonumber, Defaulted on create, Filter, idLookup, Sort **Description:** Auto-generated name for the role record. ### OrderDocumentTrxnType **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** Default order-document transaction type used for this role, for example CashOrder. ### OwnerId **Type:** reference **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** The user or queue that owns this role record. **Relationship Name:** Owner **Refers To:** Group, User ### PresetQtyModificationType **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** Indicates whether preset order quantities can be increased, decreased, both, or neither for this role. ### Role **Type:** picklist **Properties:** Create, Filter, Group, Restricted picklist, Sort **Description:** The functional role the account plays, for example BillingAccount, Payer, RetailStore, or DeliveryRecipient. ### StartDate **Type:** date **Properties:** Create, Filter, Group, Sort, Update **Description:** Date on which this role assignment starts. ### UsageType **Type:** picklist **Properties:** Create, Filter, Group, Restricted picklist, Sort **Description:** The usage context for this role, for example, Retail. ## Associated Objects This object has the following associated objects. If the API version isn't specified, they're available in the same API versions as this object. Otherwise, they're available in the specified API version and later. - [AccountRoleChangeEvent](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/associated-objects/change-event.md): Change events are available for the object. - [AccountRoleFeed](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/associated-objects/feed.md): Feed tracking is available for the object. - [AccountRoleHistory](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/associated-objects/history.md): History is available for tracked fields of the object. - [AccountRoleOwnerSharingRule](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/associated-objects/owner-sharing-rule.md): Sharing rules are available for the object. - [AccountRoleShare](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/associated-objects/share.md): Sharing is available for the object. # Add a New Column to Industries CPQ Cart In this task, Felix needs to modify the default CPQ product cart so that the new field – Billing Zip Code – displays as a column in Industries CPQ Cart. 1. Using the **Lightning App Launcher** in the upper left, click the **Vlocity Cards** app. 2. In the **Find in page** field, enter `cpq-product`. 3. Expand **cpq-product-cart** and select **Version 3**. ![](https://developer.salesforce.com/docs/media/image93.png) 4. In the **LAYOUT** pane, scroll down to the **DATA SOURCE** section. Notice the selection is **Dual**. This means that the API query will be performed using Apex when running on a desktop, while a REST call will be performed while running on a mobile. 5. Notice the **Remote Class**, **Remote Method** and **fields** under the Desktop ApexRemote Config section. The CPQ API CpqAppHandler.getCartItems returns all products currently in the Cart. The fields parameter controls which fields are returned in the API for each product. 6. Scroll back to the top of the **LAYOUT** pane and click **Clone**. ![](https://developer.salesforce.com/docs/media/image94.png) 7. In the **Clone Layout** window, change the **Layout Author** to your name. Do NOT change the Layout Name or Layout Type. 8. Click **Clone**. 9. After cloning the card layout, it should contain an active card called **cpq-product-cart-item**. 10. Open the active **cpq-product-cart-item** card. You can ignore any inactive versions of this card that may also display. 11. Click the **Activate** button to deactivate it. 12. Click the **Clone Card** icon. ![](https://developer.salesforce.com/docs/media/image95.png) 13. In the **Clone Card** window, type `cpq-product-cart-item` as the **Card Name**. 14. **Type** your name for the Card Author. 15. Click **Clone**. ![](https://developer.salesforce.com/docs/media/image96.png) 16. On the **LAYOUT** pane, navigate to the **fields** parameter from the Input Map. This is a comma-separated list of product fields that will be queried as part of the API call to getCartItems(). We need to append this list of fields to include the Billing Zip Code custom field. 17. In the box next to **fields**, scroll to the end of the list to enter the following:,Billing_Zip_Code\_\_c. You must precede the custom field name with a comma. ![](https://developer.salesforce.com/docs/media/image97.png) 18. On the **LAYOUT** pane, navigate to the **Mobile Hybrid ApexRest Config Endpoint** field, expand the field, and type the following:,Billing_Zip_Code\_\_c. Remember, you must precede the custom field name with a comma. ![](https://developer.salesforce.com/docs/media/image98.png) 19. Remember, the **DATA SOURCE** field is **Dual**. If you want the new column to be added to mobile versions of the CPQ cart you need to add the field to the Endpoint under Mobile Hybrid ApexRest Config. 20. Make sure you have the correct **cpq-product-cart-item** card selected. It will be the one with your name as the Author. 21. If you have enabled Loyalty Pricing, select **CustomView_CPQAdvancedPricingLoyalty** in the **STATES** pane. Otherwise, select CustomView_CPQAdvancedPricing. 22. In the blank **Fields** box, select **\<\>** and click **Add**. 23. Delete \<\> and replace it with the following: | Name | Label | | ---------------------------------- | ---------------------------------- | | `['Billing_Zip_Code__c']['value']` | `['Billing_Zip_Code__c']['label']` | **important:** The Name and Label field input must be entered exactly as displayed using straight quotes and no space between brackets. 24. Click the **Activate** button on the **CARDS** and **LAYOUT** pane. ![](https://developer.salesforce.com/docs/media/image100.png) See [Add the Billing Zip Code as a Custom Field in Industries CPQ Cart](https://developer.salesforce.com/docs/industries/cme/guide/comms-add-the-billing-zip-code-as-a-custom-field-in-industries-cpq-cart.md). # Add a Promotion to a Basket There are two ways in your order capture journey that you can apply/add a promotion when you create or update your cart: - Choose a promotion using [getOffers](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-get-offers-by-catalog-api.md) and add it to the basket. The product to which the promotion applies is added to the basket by default. The promotion is applied to the product. - Add a product and then [apply a promotion to it](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-update-basket-contents-api.md). - For a promotion with these configurations, promotion applies to all products in the bundle, not just the root product. - PromotionItem: RootProduct - Scope: Update Item Only Adding a promotion to a basket is a two-step process if [Multi Transaction Service](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-multi-transaction-service.md) (MTS). To enable MTS, see [CPQ Configuration Settings Reference](https://help.salesforce.com/s/articleView?id=ind.comms_t_cpq_configuration_settings_reference_148927.htm&type=5). For example: Step 1: Create the order Item and apply the promotion: ```nolang POST /services/apexrest/vlocity_cmt/v3/catalogs/{catalog_code}/basket Request body: {"basketAction":"AddWithNoConfig","offer":"iPhone8Offer"} ``` Step 2: In the response of Step1, under the `validateAndPriceAction` node in the JSON response, a REST parameter named `transactionKey` is present. Add that transaction key in the request body to make the request for Step 2. Create the order Item and apply a promotion: ```nolang POST /services/apexrest/vlocity_cmt/v3/catalogs/{catalog_code}/basket Request body:{"basketAction":"AddWithNoConfig","offer":"iPhone8Offer", "transactionKey":"111123mx12223232000"} ``` **note:** During the second step, the engine applies validation and pricing to the basket and returns an updated cartContextKey. # Add After Configuration You can configure offers and add those configurations to the basket. The configurations are checked for cardinality violations. With versioning enabled, there can be different versions with varying attributes, so the validation service checks the version validity of the passed input configuration. ## Add to Empty Basket You can add and configure a product, promotion, or simple promotion. - Product: The bundle shapes are calculated with the product configuration(s) passed in the input. The cart context key is generated from the bundle shapes and context of the user and is checked to see if it is present in the cache and is valid in the current time frame. If it is present and valid, it becomes a cache hit scenario, and validation of offer and price is performed. If the configuration is valid, the offer and price are returned. For a cache miss scenario where the cart context key is not found while adding a configuration to the empty basket, the system checks for the cardinality validation of the passed input configuration. With versioning enabled, the validation service also checks for the version of the configuration passed in the input. If validation is successful, then order line items are created, validation and pricing rules are run, and the basket is cached and returned. The cache effectivity of the basket is the subset of the effectivity of the added individual offer time slices. Along with the basket information, information about the date-time when the root products are added is also cached. - Promotion: Configuring a promotion means configuring the promotional products’ quantity, attributes, child products, etc., and then adding that promotion to the basket. This internally creates the order line items from the promotional product and then applies the promotion to that basket. With versioning enabled, the validation service also checks for the version information and pricing of the promotion. Validation and caching services also run for the products. - Adding a simple promotion in multi mode or single mode follows the same route as that of the product. Validation, pricing, and caching services also follow the time slicing and versioning principles as described in the above section. ## Add to Existing Basket You can add and configure a product, promotion, or simple promotion. - Product: You can add product configurations in single mode or multi mode. The system checks for the validity of the configuration passed in the input. Validation mainly includes the cardinality validations to check whether it violates the minimum, maximum, or group min-max quantity defined in the configuration. With versioning enabled, there can be different versions with varying attributes and hierarchy, so the validation service checks the version validity of the passed input configuration. After these checks, the basket operation flow continues as before and the cache is generated with effectivity as the subset of the effectivity of the earlier cached basked and the new product versions. Along with the original cache information, the system also caches the basket created dates and dates on which root products were added. Those dates are used as reference dates during validation, pricing, and add-child basket operations. - Promotion: By configuring a promotion means the underlying promotional products can be configured and added to the basket. With versioning enabled, the system performs a validation check for the version of the promotional products being added. If validation is successful, then the system creates the order line items for the promotional products, synchronizes the cached basket contents, and applies the promotion on the entire basket. - Simple promotion configuration goes through version and cardinality validation checks for the configuration and pristinity of the existing cached basket. If validations are passed, then the action follows the same route as add promotion. The system creates XLIs and promotional items, and applies validation rules, pricing, and caching the basket with effectivity as that of the common subset of the effectivity of the earlier basket and overall promotional product versions effectivity. ## Add Child Product When an add child product action is initiated, the current basket is fetched from the cache. The input and user shape are included in the generation of the cache key and checked for the cache hit scenario. If the cache is present, it is included in the response. Otherwise, it becomes a cache miss scenario. The offer details are then queried and used to create order line items. The existing basket order line items are synchronized. Pricing and validation are run. In the response, basket actions are added and cached with the cartContext key. With versioning enabled, the pricing and validation of the basket run with the reference date for when the root product was added to the basket. From the basket wrapper, the corresponding information about the date-time when the root product of a child product was added can be stored and retrieved. Partial promotions are applied to the child product. The offer details of the root product are fetched based on the reference date on which the root was added. The basket is cached with the current time slice effectivity. # Add Field Sets to Quote and Quote Line Items To update any fields other than the fields in the preceding list, you can create a field set on Quote for Quote field updates and QuoteLineItems for Quote Line Items field updates. The field set name and label should match QuoteAllowedFieldSet for Quote and QuoteItemAllowedFieldSet for Quote Line Items respectively.. 1. From Setup, click **Object Manager**. In the Quick Find box, enter `Quote` and then select **Quote**. 2. Click **Field Sets**. 3. Click **New**, add a field set with the field label as either QuoteAllowedFieldSet or QuoteItemAllowedFieldSet 4. Add a custom field allowed by SF Field Data security to the fieldset. 5. Verify the new custom field: 1. Use the Create Cart API to create a new basket and save the CartContextKey. 2. Call the Create Cart API again using the CartContextKey and the new fieldset as shown using REST Explorer below:![Create a Field Set](https://developer.salesforce.com/docs/media/fieldset.png) # Add Fields to the Basket With basket operations, you can retrieve additional fields as part of their response for the following objects: Order Pricing, OrderItems, OrderAppliedPromotion, and OrderAppliedPromotionItem. To retrieve additional fields, you need to create fieldsets. You can also set the fields as part of the response. During a cache-miss, when a new basket is generated, the `dc_basket_fs` fieldset field and the default fields that use `dc_basket_fs` (Order Pricing, OrderItems, OrderAppliedPromotion, and OrderAppliedPromotionItem) are cached. When creating an actual order checkout or another basket, in the case of a cache miss, those additional fields are synchronized to the newly created Salesforce objects and cached. These object fields, if not read-only, are editable so you can write custom logic to populate those fields during the basket operation. Those fields and values are carried over during cache miss and order creation. The modifications you’ve made as part of the basket operations can be passed to the order, which recognizes those additional settings. Once the custom field is stored in the cache, other users can see it and it will be returned in other basket calls if the request matches it. **note:** The `dc_basket_fs` fieldset is supported only when Classic DC is enabled and is not available with Standard DC except createCart API. To create a fieldset: 1. From Setup, in the Quick Find box, enter `Object Manager`. 2. Click Object Manager. 3. Click a Salesforce object, for example, Order Pricing. 4. Click Field Sets. 5. Click New. ![Object Manager Order Pricing](https://developer.salesforce.com/docs/media/dc_fieldsets_objmgr.png) 6. Provide the following information: - **Field Set Label**: `dc_basket_fs` - **Field Set Label**: `dc_basket_fs` - **Where is this used?**: Type an answer. 7. Click Save. The Layout Editor appears. ![Layout Editor Field label](https://developer.salesforce.com/docs/media/dc_fieldsets_layouted.png) 8. Drag and drop additional fields as required to the **In the Field Set** section, then click Save. The header page appears with the dc_basket_fs link under the FIELD LABEL column. The link contains the fields in the fieldset that are returned by the API. To make any changes to the fields, click dc_basket_fs or the Edit action from the action arrow. ![Object Manager Order Pricing Field Sets](https://developer.salesforce.com/docs/media/dc_fieldsets_action.png) To view custom fields in the Basket API response, pass the custom fields as parameters in the API request. For example, ``` GET /services/apexrest/vlocity_cmt/v3/catalogs/TESTCKG/basket?fields=vlocity_cmt__IsChangesAccepted__c,vlocity_cmt__IsPriced__c ``` # Add Items to Cart Add items to the cart along with any required child products that are specified in the request body. Compatibility and pricing rules are run against the cart. You must use the **fieldsToUpdate** parameter to update any default line item value. Add line items to cart replaces the OmniCPQServiceWrapper `addProducts` method. ```nolang POST /v2/cpq/carts/{cart_ID}/items ``` 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. When you add child items to the cart: - Specify a `parentRecord` node in the input request. - In the `parentRecord` node, specify the `productHierarchyPath` field. - If the immediate parent of the child item that you're adding is a virtual parent, then also include these fields: - The `Id` field in the `parentRecord` node. Ensure that it's the `PricebookEntryId` of the immediate virtual parent. - The `parentId` field in the `items` node. Ensure that it's the `lineItemId` of the immediate real parent. ## Remote Method ```nolang postCartsItems ``` **note:** In releases prior to CME Spring '20, the postCartsItems method supports the addition of one item at a time. If you must add multiple items, make multiple postCartsItems calls. With CME Spring '20 and later releases, the itemId parameter supports multiple comma-separated values when adding root and child items via postCartsItems method calls if UOWMode is set to true. When the `items` array contains the same pricebook entry ID more than once, Classic Cart APIs collapse those entries into a single cart line item. To add more than one distinct line of the same product, make separate `postCartsItems` calls. To increase quantity on one line, pass a single item with the desired `quantity` or `fieldsToUpdate.quantity`. ## REST Handler ```nolang APIItemsCartsCpqV2 ``` ## Apex Remote Service ```nolang CpqAppHandler ``` ## Apex Remote Input Map ```nolang { "methodName": "postCartsItems", "cartId": "801360000008eNU", "items": [ { { "itemId": "01t36000000pfcKAAQ", "parentId": "01t36000000pfcKAAZ", "fieldsToUpdate": { "quantity": 6, "vlocity_cmt__RecurringManualDiscount__c": 10, "SampleDateTime__c": "2024/10/10 11:46" } } } ] } "itemId" = "pricebookEntryId", "parentId" = "OrderItem.Id" ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). **important:** For the `fieldsToUpdate` attribute, ensure to configure Date and Time values as per locale configuration without the seconds value. For example, `2024/10/10 11:46` for the Japanese locale. See [Supported Date and Time Formats (ICU)](https://help.salesforce.com/s/articleView?id=sf.admin_supported_date_time_format.htm&type=5). Standard Cart APIs ignore locale and require ISO dates (`yyyy-MM-dd`). ## Resource Information | Response Format | JSON | | --------------- | ------------------------------------------------------------- | | Resource URL | `/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/items` | ## Example Request **note:** For more information about `levelBasedApproach`, see [Configuring Cart Item Refresh Levels](https://help.salesforce.com/s/articleView?id=ind.comms_configuring_cart_item_refresh_levels.htm). ```nolang POST { "items": [ { "itemId": "01uf4000000gmRTAAY", "parentId": "802f4000000PZ1VAAW", "parentRecord": { "records": [ { "messages": [], "displaySequence": -1, "Id": { "messages": [], "label": "Order Product ID", "hidden": false, "fieldName": "Id", "editable": false, "dataType": "ID", "value": "802f4000000PZ1VAAW" }, "UnitPrice": { "messages": [], "label": "Unit Price", "hidden": true, "fieldName": "UnitPrice", "editable": false, "dataType": "CURRENCY", "value": 358.95 }, "productId": "01tf4000000Kd0uAAC", "defaultQuantity": 1, "minQuantity": 0, "maxQuantity": 99999, "groupMinQuantity": 0, "groupMaxQuantity": 99999, "sequenceNumber": 1, "productHierarchyPath": "01tf4000000Kd0uAAC", "itemType": "lineItem", "childProducts": { "records": [ { "Name": { "label": "Product Name", "value": "PRODUCT-77151" }, "UnitPrice": { "label": "List Price", "value": 0 }, "vlocity_cmt__RecurringPrice__c": { "label": "Recurring Price", "value": 0 }, "Product2Id": { "label": "Product ID", "value": "01tf4000000Kd0zAAC" }, "Pricebook2Id": { "label": "Price Book ID", "value": "01sf4000003LYn3AAG" }, "Id": { "label": "Price Book Entry ID", "value": "01uf4000000gmRTAAY" }, "defaultQuantity": 0, "productId": "01tf4000000Kd0zAAC", "Product2": { "Name": "PRODUCT-77151", "RecordTypeId": "012f40000004zEOAAY", "vlocity_cmt__IsConfigurable__c": false, "vlocity_cmt__SubType__c": "None", "vlocity_cmt__Type__c": "None" }, "messages": [], "actions": { "addtocart": { "rest": { "params": { "price": true, "validate": true, "includeAttachment": false, "pagesize": 20, "items": [ { "parentId": "802f4000000PZ1VAAW", "quantity": 0, "itemId": "01uf4000000gmRTAAY" } ], "cartId": "801f4000000ChZjAAK" }, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/801f4000000ChZjAAK/items" }, "remote": { "params": { "price": true, "validate": true, "includeAttachment": false, "pagesize": 20, "items": [ { "parentId": "802f4000000PZ1VAAW", "quantity": 0, "itemId": "01uf4000000gmRTAAY" } ], "cartId": "801f4000000ChZjAAK", "methodName": "postCartsItems" } }, "client": { "params": { "pagesize": 0, } } } } } ] }, "vlocity_cmt__RecurringPrice__c": 527.96, "name": "PRODUCT-39982", "provisioningStatus": "New", "Product2Id": "01tf4000000Kd0uAAC", "PricebookEntryId": { "messages": [], "label": "Price Book Entry ID", "hidden": false, "fieldName": "PricebookEntryId", "editable": false, "dataType": "REFERENCE", "value": "01uf4000000gmRJAAY" }, "Quantity": { "messages": [], "label": "Quantity", "hidden": false, "fieldName": "Quantity", "editable": true, "dataType": "DOUBLE", "value": 1 }, "vlocity_cmt__OneTimeTotal__c": { "messages": [], "label": "One Time Total", "hidden": false, "fieldName": "vlocity_cmt__OneTimeTotal__c", "editable": false, "dataType": "CURRENCY", "value": 358.95 }, "vlocity_cmt__RecurringTotal__c": { "messages": [], "label": "Recurring Total", "hidden": false, "fieldName": "vlocity_cmt__RecurringTotal__c", "editable": false, "dataType": "CURRENCY", "value": 527.96 }, "vlocity_cmt__ProvisioningStatus__c": { "messages": [], "label": "Provisioning Status", "hidden": true, "fieldName": "vlocity_cmt__ProvisioningStatus__c", "editable": false, "dataType": "STRING", "value": "New" }, "vlocity_cmt__ProductHierarchyPath__c": { "messages": [], "label": "Product Hierarchy Path", "hidden": true, "fieldName": "vlocity_cmt__ProductHierarchyPath__c", "editable": false, "dataType": "STRING", "value": "01tf4000000Kd0uAAC" }, "vlocity_cmt__LineNumber__c": { "messages": [], "label": "LineNumber", "hidden": true, "fieldName": "vlocity_cmt__LineNumber__c", "editable": false, "dataType": "STRING", "value": "0001" }, "vlocity_cmt__RootItemId__c": { "messages": [], "label": "RootItemId", "hidden": true, "fieldName": "vlocity_cmt__RootItemId__c", "editable": false, "dataType": "STRING", "value": "802f4000000PZ1VAAW" }, "ListPrice": { "messages": [], "label": "List Price", "hidden": true, "fieldName": "ListPrice", "editable": false, "dataType": "CURRENCY", "value": 358.95 }, "vlocity_cmt__OneTimeCharge__c": { "messages": [], "label": "One Time Charge", "hidden": true, "fieldName": "vlocity_cmt__OneTimeCharge__c", "editable": false, "dataType": "CURRENCY", "value": 358.95 }, "vlocity_cmt__RecurringCharge__c": { "messages": [], "label": "Recurring Charge", "hidden": true, "fieldName": "vlocity_cmt__RecurringCharge__c", "editable": false, "dataType": "CURRENCY", "value": 527.96 }, "vlocity_cmt__RecurringManualDiscount__c": { "messages": [], "label": "Recurring Manual Discount", "hidden": false, "fieldName": "vlocity_cmt__RecurringManualDiscount__c", "editable": true, "dataType": "PERCENT", "value": 0 }, "vlocity_cmt__OneTimeManualDiscount__c": { "messages": [], "label": "One Time Manual Discount", "hidden": false, "fieldName": "vlocity_cmt__OneTimeManualDiscount__c", "editable": true, "dataType": "PERCENT", "value": 0 }, "vlocity_cmt__ParentItemId__c": { "messages": [], "label": "ParentItemId", "hidden": true, "fieldName": "vlocity_cmt__ParentItemId__c", "editable": false, "dataType": "STRING" }, "PricebookEntry": { "Product2Id": "01tf4000000Kd0uAAC", "Pricebook2Id": "01sf4000003LYn3AAG", "Id": "01uf4000000gmRJAAY", "Product2": { "Name": "PRODUCT-39982", "Id": "01tf4000000Kd0uAAC", "vlocity_cmt__Type__c": "None", "vlocity_cmt__IsConfigurable__c": "false" } }, "Product2": { "Name": "PRODUCT-39982", "RecordTypeId": "012f40000004zEOAAY", "vlocity_cmt__IsConfigurable__c": false, "vlocity_cmt__SubType__c": "None", "vlocity_cmt__Type__c": "None" }, "vlocity_cmt__ItemName__c": { "messages": [], "label": "Item Name", "hidden": false, "fieldName": "vlocity_cmt__ItemName__c", "editable": true, "dataType": "STRING" }, "actions": { "addtocart": { "rest": { "params": { "price": true, "validate": true, "includeAttachment": false, "pagesize": 20, "items": [ { "parentId": "802f4000000PZ1VAAW", "quantity": 1, "itemId": "01uf4000000gmRJAAY" } ], "cartId": "801f4000000ChZjAAK" }, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/801f4000000ChZjAAK/items" }, "remote": { "params": { "price": true, "validate": true, "includeAttachment": false, "pagesize": 20, "items": [ { "parentId": "802f4000000PZ1VAAW", "quantity": 1, "itemId": "01uf4000000gmRJAAY" } ], "cartId": "801f4000000ChZjAAK", "methodName": "postCartsItems" } }, "client": { "params": { "pagesize": 0, } } }, "cloneitem": { "rest": { "params": { "pagesize": 0, "items": [ { "quantity": 0, "itemId": "802f4000000PZ1VAAW" } ], "cartId": "801f4000000ChZjAAK" }, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/801f4000000ChZjAAK/items/clone" }, "remote": { "params": { "pagesize": 0, "items": [ { "quantity": 0, "itemId": "802f4000000PZ1VAAW" } ], "cartId": "801f4000000ChZjAAK", "methodName": "cloneItems" } }, "client": { "params": { "pagesize": 0, } } } }, "isVirtualItem": false } ] } } ], "pagesize": 0, "levelBasedApproach": false } ``` To use this API to pass child line items, you must also specify the Price Book Entry ID. ``` { "items":[ { "parentRecord":{ "records":[ { "Id":{ "label":"Price Book Entry ID", "value":"01uf4000000gmRJAAY" }, "productHierarchyPath":"" } ] }, "parentId":" ", "itemId":"" } ] } ``` ## Example Result **note:** An entire result can be thousands of lines long. This example has been truncated. ```nolang { "totalSize": 1, "messages": [{ "severity": "INFO", "messageId": null, "message": "Successfully added.", "code": "150", "actions": {} }], "records": [{ "messages": [], "actions": { "addtocart": { "rest": { "params": { "includeAttachment": false, "pagesize": 20, "lastRecordId": null, "query": null, "items": [{ "parentId": "80241000000HalXAAS", "quantity": 1, "itemId": "01u41000001QPs5AAG" }] }, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80141000000Cg8HAAS/items" }, "remote": { "params": { "price": true, "validate": true, "includeAttachment": false, "pagesize": 20, "lastRecordId": null, "query": null, "items": [{ "parentId": "80241000000HalXAAS", "quantity": 1, "itemId": "01u41000001QPs5AAG" }], "cartId": "80141000000Cg8HAAS", "methodName": "postCartsItems" } }, "client": { "params": {} } }, "updateitems": { "rest": { "params": { "fields": null, "price": true, "validate": true, "filters": null, "includeAttachment": false, "pagesize": 20, "lastRecordId": null, "query": null, "items": [{ "itemId": "80241000000HalXAAS" }] }, "method": "PUT", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80141000000Cg8HAAS/items" }, "remote": { "params": { "fields": null, "price": true, "validate": true, "filters": null, "includeAttachment": false, "pagesize": 20, "lastRecordId": null, "query": null, "items": [{ "itemId": "80241000000HalXAAS" }], "cartId": "80141000000Cg8HAAS", "methodName": "putCartsItems" } }, "client": { "params": {} } }, "deleteitem": { "rest": { "params": {}, "method": "DELETE", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80141000000Cg8HAAS/items/80241000000HalXAAS?pagesize=20&includeAttachment=false&validate=true&price=true" }, "remote": { "params": { "price": true, "validate": true, "filters": null, "includeAttachment": false, "pagesize": 20, "lastRecordId": null, "query": null, "id": "80241000000HalXAAS", "cartId": "80141000000Cg8HAAS", "methodName": "deleteCartsItems" } }, "client": { "params": {} } }, "cloneitem": { "rest": { "params": { "items": [{ "itemId": "80241000000HalXAAS" }] }, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80141000000Cg8HAAS/items/clone" }, "remote": { "params": { "id": "80241000000HalXAAS", "cartId": "80141000000Cg8HAAS", "methodName": "cloneItems" } }, "client": { "params": {} } }, "modifyattributes": { "rest": { "params": { "fields": null, "items": [{ "itemId": "80241000000HalXAAS" }] }, "method": "PUT", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80141000000Cg8HAAS/items/80241000000HalXAAS/itemattributes" }, "remote": { "params": { "fields": null, "items": [{ "itemId": "80241000000HalXAAS" }], "itemId": "80241000000HalXAAS", "cartId": "80141000000Cg8HAAS", "methodName": "putItemAttributes" } }, "client": { "params": {} } } }, "displaySequence": -1, "Id": { "value": "80241000000HalXAAS", "messages": [], "label": "Order Product ID", "hidden": false, "fieldName": "Id", "editable": false, "dataType": "ID", "actions": {} }, "Pricebook2Id": "01s41000005dPYQAA2", "Product2Id": "01t41000000sYZVAA2", "UnitPrice": { "value": 2.00, "messages": [], "label": "Unit Price", "hidden": false, "fieldName": "UnitPrice", "editable": true, "dataType": "CURRENCY", "actions": {} }, "Name": "Parent 1", "IsActive": true, "Product2": { "attributes": { "type": "Product2", "url": "/services/data/v38.0/sobjects/Product2/01t41000000sYZVAA2" }, "Id": "01t41000000sYZVAA2", "Name": "Parent 1", "vlocity_cmt__IsConfigurable__c": false, "vlocity_cmt__Type__c": "None", "vlocity_cmt__SubType__c": "None", "RecordTypeId": "012410000006OWUAA2", "vlocity_cmt__JSONAttribute__c": null }, "productId": "01t41000000sYZVAA2", "defaultQuantity": 1.0, "minQuantity": 0.0, "maxQuantity": 99999.0, "groupMinQuantity": 0, "groupMaxQuantity": 99999, "sequenceNumber": 1.00, "productChildItemDefinition": { "attributes": { "type": "vlocity_cmt__ProductChildItem__c", "url": "/services/data/v38.0/sobjects/vlocity_cmt__ProductChildItem__c/a2541000000G0A1AAK" }, "Id": "a2541000000G0A1AAK", "Name": "Root PCI", "vlocity_cmt__IsVirtualItem__c": false, "vlocity_cmt__Quantity__c": 1, "vlocity_cmt__MaxQuantity__c": 99999, "vlocity_cmt__MinQuantity__c": 0, "vlocity_cmt__MaximumChildItemQuantity__c": 99999, "vlocity_cmt__MinimumChildItemQuantity__c": 0, "vlocity_cmt__IsOverride__c": false, "vlocity_cmt__ParentProductId__c": "01t41000000sYZVAA2", "vlocity_cmt__ChildLineNumber__c": "1", "vlocity_cmt__SeqNumber__c": 1.00, "vlocity_cmt__CollapseHierarchy__c": false, "vlocity_cmt__IsRootProductChildItem__c": true, "vlocity_cmt__ParentProductId__r": { "attributes": { "type": "Product2", "url": "/services/data/v38.0/sobjects/Product2/01t41000000sYZVAA2" }, "Id": "01t41000000sYZVAA2", "Name": "Parent 1" } }, "productHierarchyPath": "01t41000000sYZVAA2", "name": "Parent 1", "isVirtualItem": false, "itemType": "lineItem", "PricebookEntryId": { "value": "01u41000001QPs5AAG", "messages": [], "label": "Price Book Entry ID", "hidden": false, "fieldName": "PricebookEntryId", "editable": false, "dataType": "REFERENCE", "actions": {} }, ... ``` ### Add with noResponseNeeded=true ```nolang { "totalSize": 0, "messages": [ { "code": "150", "severity": "INFO", "message": "Successfully added." } ], "actions": { "itempricesupdated": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/801xx000003H4WlAAK/price?price=false&cartId=801xx000003H4WlAAK" }, "remote": { "params": {} }, "client": { "params": {} } } } } ``` # Add Items to Cart The `postCartsItems` API allows clients to add one or more products to an existing cart. This is a core operation in any CPQ (Configure, Price, Quote) process. The API enforces business rules such as product eligibility, quantity constraints, and cart state validation, ensuring that only valid items are added. It can trigger pricing, validation, and promotion logic as needed. Robust error handling ensures atomicity—either all items are added successfully, or none are—while clear error messages guide users in case of issues. The API is designed for extensibility, supporting guest users. ```nolang POST /v2/cpq/carts/{cart_ID}/items ``` 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. ## Apex Remote Service ```nolang CpqAppHandler ``` ## Remote Method ```nolang postCartsItems ``` ## REST Handler ```nolang APIItemsCartsCpqV2 ``` ## REST Method ```nolang createCartItems ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information - **Resource URL:** `/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/items` - **HTTP Method:** POST - **Content-Type:** application/json - **Response Format:** JSON **note:** Starting in the Winter'27 release, you can pass `UnitPrice` and `ListPrice` in `fieldsToUpdate`. To keep caller-supplied price values, set `price` to `false`. When `price` is `true` (the default), the pricing engine runs after `fieldsToUpdate` is applied and can overwrite price fields from pricebook entries and pricing plan rules. Use `price: false` for contract pricing, zero-price items, or any case where the caller owns the price. **note:** Each object in the `items` array creates a distinct cart line item, even when `itemId` is the same pricebook entry. Classic Cart APIs collapse duplicate pricebook entry IDs in one call into a single line item. To add quantity on one line, pass a single item with `quantity`. Date fields in `fieldsToUpdate` must use ISO format (`yyyy-MM-dd`). Standard Cart APIs do not parse locale-based values such as `dd/mm/yyyy`. ## Example REST Request ### Root Add ```http POST /v2/cpq/carts/{cart_ID}/items Content-Type: application/json { "validate": true, "items": [ { "itemId": "01uxx00000099gxAAA" } ], "cartId": "801xx000003H4WlAAK", "price": true, "quantity": 3 } ``` ### Root Add with caller-supplied price ```http POST /v2/cpq/carts/{cart_ID}/items Content-Type: application/json { "validate": true, "items": [ { "itemId": "01uxx00000099gxAAA", "fieldsToUpdate": { "UnitPrice": 0, "ListPrice": 0 } } ], "cartId": "801xx000003H4WlAAK", "price": false } ``` ### Child Add ```http POST /v2/cpq/carts/{cart_ID}/items Content-Type: application/json { "validate": true, "items": [ { "parentId": "802xx000001ni7fAAA", "parentHierarchyPath": "01txx0000006qMaAAI", "itemId": "01uxx00000099iZAAQ", "fieldsToUpdate": {"vlocity_cmt__AttributeSelectedValues__c": null}, "parentRecord": { "records": [ { "vlocity_cmt__RootItemId__c": { "value": "7769bef4-0a0f-4dd5-be09-a989cad663d7" }, "vlocity_cmt__AssetReferenceId__c": { "value": "7769bef4-0a0f-4dd5-be09-a989cad663d7" }, "Id": { "value": "802xx000001ni7fAAA" } } ] } } ], "cartId": "801xx000003H4WlAAK", "price": true } ``` ### Child Add Under Virtual Parent ```http POST /v2/cpq/carts/{cart_ID}/items Content-Type: application/json { "validate": true, "items": [ { "parentId": "802xx000001ni7fAAA", "itemId": "01uxx00000099kBAAQ", "parentRecord": { "records": [ { "isVirtualItem": true, "parentLineItemId": "802xx000001ni7fAAA", "productHierarchyPath": "01txx0000006qMaAAI<01txx0000006tKSAAY" } ] } } ], "cartId": "801xx000003H4WlAAK", "price": true } ``` ## Example REST Response ### Root Bundle Add Response ```nolang { "totalSize": 1, "messages": [ { "code": "150", "severity": "INFO", "message": "Successfully added." } ], "actions": { "itempricesupdated": {} }, "records": [ { "messages": [], "actions": {}, "isVirtualItem": false, "maxQuantity": 99999, "ProductCode": "CODE-77706", "hasChildren": true, "IsActive": true, "defaultQuantity": 1, "productGroups": { "totalSize": 1, "messages": [], "records": [ {} ] }, "childProducts": { "totalSize": 1, "messages": [], "records": [ {} ] } } ] } ``` ### Add with noResponseNeeded=true ```nolang { "totalSize": 0, "messages": [ { "code": "150", "severity": "INFO", "message": "Successfully added." } ], "actions": { "itempricesupdated": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/801xx000003H4WlAAK/price?price=false&cartId=801xx000003H4WlAAK" }, "remote": { "params": {} }, "client": { "params": {} } } } } ``` # Add Multiple Products to a Basket You can add multiple products to a basket at one time using the Basket API. For example, a user might select multiple products and add them to the Basket using a single transaction. Multi-add functionality works for both known and anonymous users. The basket is validated after the products are added. ## Prerequisites - The Catalog should have CatalogCode**c populated; spaces are not allowed in CatalogCode**c. - Products should have ProductCode populated; spaces are not allowed in ProductCode. - The product catalog should be present with products attached to it as records under the CatalogProductRelationship\_\_c object. - The product catalog should be attached to a default pricelist through the DefaultPriceList**c field on the Catalog**c object. - Price list entries should exist for all products attached to the catalog. - Create a custom setting called CacheAPIFields' with the value set to True in the CPQ Configuration Setup. - Ensure you have run the following batch jobs to populate the cache: - Context combinations - Offer Details - Pricing results **note:** - The API cache is generated incrementally with successive calls for this API, and is not pre-generated as is the case with some of the other APIs. - Multi-add promotion in a single basket API call is not supported in Classic DC APIs. Customers requiring this capability must migrate to Standard DC. ## URI /services/apexrest/{_namespace_}/v3/catalogs/{_catalogcode_}/basket/{_cartContextKey_} ## HTTP Method POST ## Parameters | Parameter | Description | | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | | CatalogCode | The code of the catalog whose product is being queried. | | cartContextKey | A persistent cartContext hash key to maintain existing basket. Leave blank to create a new basked. For example: /v3/catalogs/{CATALOGCODE}/basket?urlParam=value | ## Required POST Body Parameters - basketAction - : Choose an action type. AddWithNoConfig If adding directly from offerCode; supplied to the offer parameter. AddAfterConfig If adding from configured offerDetails; supplied to the productConfig parameter. - isDebug - : Set this parameter to true for debugging. ## Optional POST Body Parameters | Parameter | Description | | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | | context | Provide context dimensions as part of context param; examples given at the end | | productConfig | Provide configured offer details taken from response of configure API to add configured offer to cart. It will contain array in case of multi-add. | | sessionKey | Persisting session Key that contains the combination of Order and BasketKey for fresh basket, don't pass anything | | offer | Offer code of the product being added has to be passed. It will contain array in case of multi-add. | ## Runtime Behavior This API provides the ability for a user to add offers to a virtual basket maintained by the user interface. The basket is tracked using the cartContextKey in the URL. For an empty basket, there is no need to pass the cartContextKey. ```nolang /v3/catalogs/{CATALOGCODE}/basket?urlParam=value ``` Depending upon the parameters passed along in the POST body the Orders are either picked from the Session else the pseudo Accounts and Orders are created. This changes the time for processing. For an existing basket with COMPLETECACHEMISS, if the sessionKey is passed in the POST body params the existing Order is used to process else a new Account and Order are created. - The cartContextKey is returned as part of the response of a successful basket operation. - The sessionKey is returned as a part of a successful basket operation. The sessionKey is used to track the Order used for the current basket. - The API uses cartContext to track existing basket contents and appropriate context parameters to price products and run context rules. - The API uses the sessionKey to store the Order Id used to create the basket against the Basket ID. This provides performance improvement by avoiding creation of new Account and Order for every API call for a CACHE MISS scenario. - If pre-cached result is present, that will be returned in case it isn't, this will be treated as a cache-miss and handled (also resulting in a corresponding cache entry) ## Example When the basket is empty, add an item to a basket without configuring. ```nolang Method: POST URL: /services/apexrest/cacheableapis/v3/catalogs/Mobiles/basket Post body: {"offer":["iPhone11","iphone12"],"basketAction":"addWithNoConfig"} ``` Response body (truncated): ```nolang { "cartContextKey": "d48b4abf50f9f98b132202df490f1e62", "createCartAction": { "rest": { "params": { "cartContextKey": "d48b4abf50f9f98b132202df490f1e62" }, "link": "/v3/carts", "method": "createCartAction" } }, "sessionKey": "749b6aba422601cf548cd36401059956", "result": { "totals": { "EffectiveOneTimeTotal__c": 200, "EffectiveRecurringTotal__c": 100 }, "records": [ { "actions": { "deleteFromBasketAction": { "rest": { "params": { "basketAction": "deleteFromBasket", "lineItemKey": "dc4aaedd6a85c60ce7e857925c6bfcf1", "bundleContextKey": "dc4aaedd6a85c60ce7e857925c6bfcf1" }, "link": "/v3/catalogs/Mobiles/basket/d48b4abf50f9f98b132202df490f1e62?contextKey=99914b932bd37a50b983c5e7c90ae93b", "method": "deleteFromBasketAction" } }, "updateBasketAction": { "rest": { "params": { "basketAction": "updateBasket", "lineItemKey": "dc4aaedd6a85c60ce7e857925c6bfcf1", "bundleContextKey": "dc4aaedd6a85c60ce7e857925c6bfcf1" }, "link": "/v3/catalogs/Mobiles/basket/d48b4abf50f9f98b132202df490f1e62?contextKey=99914b932bd37a50b983c5e7c90ae93b", "method": "updateBasketAction" } } }, "lineItemKey": "dc4aaedd6a85c60ce7e857925c6bfcf1", "bundleContextKey": "dc4aaedd6a85c60ce7e857925c6bfcf1", "productCategories": { "messages": [], "totalSize": 0 }, "pricingLogValue": { "LastPricingTime": "2020-12-15T05:33:27.713Z", "PriceAsOfDateTime": "2020-12-15T05:33:27.713Z", "LogVersion": "3.0", "PricingVariableCodeBaseValues": { "REC_MNTH_STD_PRC": 50, "OT_STD_PRC": 100 ``` ## Example When basket is empty, add an item to a basket after configuring. ```nolang Method: POST URL: /services/apexrest/cacheableapis/v3/catalogs/Mobiles/basket POST Body (truncated) { "productConfig": [ { "offerDetails": { "offer": { "priceResult": [ { "adjustments": [], "overrides": [], "chargeamount": 100, "baseamount": 100, "Amount__c": 100, "IsVirtualPrice__c": false, "IsBasePrice__c": true, "effectiveuntildatespec": null, "effectivefromdatespec": null, "SubType__c": "Standard", "Type__c": "Price", "RecurringFrequency__c": null, "ChargeType__c": "One-time", "DisplayText__c": "100$ one time", "UnitPrice": 100 }, { "adjustments": [], "overrides": [], "chargeamount": 50, "baseamount": 50, "Amount__c": 50, "IsVirtualPrice__c": false, "IsBasePrice__c": true, "effectiveuntildatespec": null, "effectivefromdatespec": null, "SubType__c": "Standard", "Type__c": "Price", "RecurringFrequency__c": "Monthly", "ChargeType__c": "Recurring", "DisplayText__c": "50$ recurring" } ], "addtocart": { "rest": { "params": { "context": "{}", "basketAction": "AddWithNoConfig", "offer": "iPhone11" }, "link": "v3/catalogs/Mobiles/basket", "method": "POST" } }, ``` ## Example When basket is empty, add one offer with configuration and another without configuration. ```nolang Method: POST URL: /services/apexrest/cacheableapis/v3/catalogs/Mobiles/basket Post body (truncated): { "offer": "iPhone12", "productConfig": [ { "offerDetails": { "offer": { "priceResult": [ { "adjustments": [], "overrides": [], "chargeamount": 100, "baseamount": 100, "Amount__c": 100, "IsVirtualPrice__c": false, "IsBasePrice__c": true, "effectiveuntildatespec": null, "effectivefromdatespec": null, "SubType__c": "Standard", "Type__c": "Price", "RecurringFrequency__c": null, "ChargeType__c": "One-time", "DisplayText__c": "100$ one time", "UnitPrice": 100 }, { "adjustments": [], "overrides": [], "chargeamount": 50, "baseamount": 50, "Amount__c": 50, "IsVirtualPrice__c": false, "IsBasePrice__c": true, "effectiveuntildatespec": null, "effectivefromdatespec": null, "SubType__c": "Standard", "Type__c": "Price", "RecurringFrequency__c": "Monthly", "ChargeType__c": "Recurring", "DisplayText__c": "50$ recurring" } ], ``` Here is the response, truncated: ```nolang { "offer": "iPhone12", "productConfig": [ { "offerDetails": { "offer": { "priceResult": [ { "adjustments": [], "overrides": [], "chargeamount": 100, "baseamount": 100, "Amount__c": 100, "IsVirtualPrice__c": false, "IsBasePrice__c": true, "effectiveuntildatespec": null, "effectivefromdatespec": null, "SubType__c": "Standard", "Type__c": "Price", "RecurringFrequency__c": null, "ChargeType__c": "One-time", "DisplayText__c": "100$ one time", "UnitPrice": 100 }, { "adjustments": [], "overrides": [], "chargeamount": 50, "baseamount": 50, "Amount__c": 50, "IsVirtualPrice__c": false, "IsBasePrice__c": true, "effectiveuntildatespec": null, "effectivefromdatespec": null, "SubType__c": "Standard", "Type__c": "Price", "RecurringFrequency__c": "Monthly", "ChargeType__c": "Recurring", "DisplayText__c": "50$ recurring" } ], "addtocart": { "rest": { "params": { "context": "{}", "basketAction": "AddWithNoConfig", "offer": "iPhone11" }, ``` # Add Promotion to Cart Add a promotion to the specified cart. If an optional child product belongs to a promotion, the promotion is applied to the newly added product when that product is added to the cart. ```nolang POST /v2/cpq/carts/{cart_ID}/promotions ``` 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 ```nolang postCartsPromoItems ``` ## REST Handler ```nolang APIPromotionsCartsCpqV2 ``` ## Apex Remote Service ```nolang CpqAppHandler ``` ## Apex Remote Input Map ```nolang { methodName:"postCartsPromoItems", cartId:801360000008eNU, items:[ { itemId:01t36000000pfcKAAQ }] } ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | ------------------------------------------------------------------ | | Resource URL | `/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/promotions` | ## Example Request ```nolang POST { "items": [ { "itemId": "a30460000001vbgAAA" } ], "price": false, "validate": false } ``` ## Example Response ```nolang { "messages": [ { "severity": "string", "messageId": "string", "code": 0, "message": "Successfully completed" } ], "records": [ { "messages": [ { "severity": "string", "messageId": "string", "code": 0, "message": "Successfully completed" } ], "displaySequence": -1, "Id": "8016A000000bwElQAI", "Name": "New customer order", "EffectiveDate": "2017-12-25", "AccountId": "0016A0000053kHN", "Account.Name": "Acme Inc.", "EffectiveRecurringTotal__c": 0, "EffectiveOneTimeTotal__c": 0, "EffectiveOrderTotal__c": 0, "OrderNumber": "00000141", "Status": "Draft" } ] } ``` # Add the Billing Zip Code as a Custom Field in Industries CPQ Cart In this task, Felix needs to create a Field Setting so that getCartsItems (called when the cart is loaded) and postCartsItems (called when you click Add to Cart) APIs return the Billing Zip Code field and it displays in Industries CPQ Cart. 1. Go to **Setup**. 2. In the **Quick Find** box, type `Custom Settings`. 3. Click **Custom Settings**. 4. Click **Manage** next to **Field Settings**. ![](https://developer.salesforce.com/docs/media/image101.png) 5. Click **New**. 6. Enter the following for the new Field Setting: | Field | Entry | Notes | | ----------- | --------------------- | ---------------------- | | Name | Billing_Zip_Code\_\_c |   | | Feature | CPQV2 | Links to the CPQ APIs | | Field Name | Billing_Zip_Code\_\_c | API name of the field | | Inclusion | (checked) |   | | Object Name | OrderItem | API name of the object | | Sequence | 1 |   | ![](https://developer.salesforce.com/docs/media/image102.png) 7. Click **Save**. 8. Close the Setup browser tab. See [Test in Industries CPQ Cart](https://developer.salesforce.com/docs/industries/cme/guide/comms-test-in-industries-cpq-cart.md). # Add To Basket Add to basket APIs allows users to add an offer to the basket. The APIs take the offerCode from the input if the default configuration needs to be added or from the configured input if performing the add after configuring an offer. Both types of basket actions (addWithNoConfig and AddAfterConfig) can be performed on an empty basket or an existing basket. ![Add to basket APIs](https://developer.salesforce.com/docs/media/dc_addtobasket_api.png) # Add to Cart Add a product to the cart. ```nolang POST /v2/cpq/carts/{cart_ID}/items ``` **note:** By default, items deleted from a cart are not evaluated for Vlocity Rules. To enable evaluation of deleted items, set the ShouldConsiderDeletedItems configuration setting to true. CME packages are large. 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 ```nolang postCartsItems ``` **note:** The postCartsItems method supports the addition of one item at a time. If you must add multiple items, make multiple postCartsItems calls. ## REST Handler ```nolang APIItemsCartsCpqV2 ``` ## Apex Remote Service ```nolang Class: vlocity_cmt.CardCanvasController Method: global static Object doGenericInvoke(String sClassName, String sMethodName, String input, String options) ``` ## Apex Remote Input Map The following example illustrates how to call this API from Apex code. ```nolang "sClassName": "vlocity_cmt.CpqAppHandler" "sMethodName": "postCartsItems" "input": SAME AS SAMPLE REQUEST BODY "options": {"vlcClass":"vlocity_cmt.CpqAppHandler"} ``` ```nolang Map inputMap = new Map(); Map outputMap = new Map(); Map optionsMap = new Map(); Map itemsMap = new Map(); List items = new List(); Id priceBookEntryId = Id.valueOf('Replace with the pricebook entry id of the product to be added'); Id cartId = Id.valueOf('replace with the id of the cart'); itemsMap.put('itemId', priceBookEntryId); items.add(itemsMap); inputMap.put('items', items); inputMap.put('cartId', cartId); inputMap.put('validate', true); // set to false if validation is not required inputMap.put('price', true); // set to false if pricing is not required vlocity_cmt.CpqAppHandler cpqAppHandlerService = new vlocity_cmt.CpqAppHandler(); cpqAppHandlerService.invokeMethod('postCartsItems', inputMap, outputMap, optionsMap); System.debug('outputMap:' + outputMap); ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | ---------------------------------------------------------------------------------------------------- | | Resource URL | `/v2/cpq/carts/*/items` Example: `/services/apexrest/{namespace}/v2/cpq/carts/801360000000oQ9/items` | ## Example Request ```nolang { "methodName": "postCartsItems", "items": [ { "parentId": "8021N000006wtTTQAY", "parentHierarchyPath": "01to000000Am1FGAAZ", "itemId": "01u1N00000DPpdFQAT", "parentRecord": { "records": [ { "displaySequence": -1, "Id": { "value": "8021N000006wtTTQAY", "previousValue": null, "originalValue": null, "messages": [], "label": "Order Product ID", "hidden": false, "fieldName": "Id", "editable": false, "dataType": "ID", "actions": {} }, "Pricebook2Id": "01so0000000jvwiAAA", "Product2Id": "01to000000Am1FGAAZ", "UnitPrice": { "value": 0, "previousValue": null, "originalValue": null, "messages": [], "label": "Unit Price", "hidden": true, "fieldName": "UnitPrice", "editable": false, "dataType": "CURRENCY", "actions": {} }, "Name": "Product Hier 3", "vlocity_cmt__RecurringPrice__c": 0, "IsActive": true, "Product2": { "attributes": { "type": "Product2", "url": "/services/data/v41.0/sobjects/Product2/01to000000Am1FGAAZ" }, "Name": "Product Hier 3", "vlocity_cmt__IsConfigurable__c": false, "RecordTypeId": "012o0000000pDXFAA2", "Id": "01to000000Am1FGAAZ", "vlocity_cmt__JSONAttribute__c": null }, "productId": "01to000000Am1FGAAZ", "defaultQuantity": 1, "minQuantity": 0, "maxQuantity": 1000, "groupMinQuantity": 0, "groupMaxQuantity": 99999, "sequenceNumber": 1, "productChildItemDefinition": { "attributes": { "type": "vlocity_cmt__ProductChildItem__c", "url": "/services/data/v41.0/sobjects/vlocity_cmt__ProductChildItem__c/a0ro00000050PjxAAE" }, "Id": "a0ro00000050PjxAAE", "Name": "Root PCI", "vlocity_cmt__IsVirtualItem__c": false, "vlocity_cmt__Quantity__c": 1, "vlocity_cmt__MaxQuantity__c": 99999, "vlocity_cmt__MinQuantity__c": 0, "vlocity_cmt__MaximumChildItemQuantity__c": 99999, "vlocity_cmt__MinimumChildItemQuantity__c": 0, "vlocity_cmt__IsOverride__c": false, "vlocity_cmt__ParentProductId__c": "01to000000Am1FGAAZ", "vlocity_cmt__ChildLineNumber__c": "1", "vlocity_cmt__SeqNumber__c": 1, "vlocity_cmt__CollapseHierarchy__c": false, "vlocity_cmt__IsRootProductChildItem__c": true, "vlocity_cmt__ParentProductId__r": { "attributes": { "type": "Product2", "url": "/services/data/v41.0/sobjects/Product2/01to000000Am1FGAAZ" }, "Name": "Product Hier 3", "Id": "01to000000Am1FGAAZ", "RecordTypeId": "012o0000000pDXFAA2" } }, "productHierarchyPath": "01to000000Am1FGAAZ", "name": "Product Hier 3", "isVirtualItem": false, "provisioningStatus": "New", "hasChildren": true, "itemType": "lineItem", "PricebookEntryId": { "value": "01uo000000Bz2qbAAB", "previousValue": null, "originalValue": null, "messages": [], "label": "Price Book Entry ID", "hidden": false, "fieldName": "PricebookEntryId", "editable": false, "dataType": "REFERENCE", "actions": {} }, "Quantity": { "value": 1, "previousValue": null, "originalValue": null, "messages": [], "label": "Quantity", "hidden": false, "fieldName": "Quantity", "editable": true, "dataType": "DOUBLE", "actions": {} }, "vlocity_cmt__OneTimeTotal__c": { "value": 300, "previousValue": null, "originalValue": null, "messages": [], "label": "One Time Total", "hidden": false, "fieldName": "vlocity_cmt__OneTimeTotal__c", "editable": false, "dataType": "CURRENCY", [EXAMPLE TRUNCATED FOR BREVITY] ``` ## Example Response ```nolang { "totalSize": 1, "messages": [ { "severity": "INFO", "messageId": null, "message": "Successfully added.", "code": "150", "bundleId": null, "actions": {} } ], "actions": { "addtocart": { "rest": { "params": { "cartId": "8011N00000157LkQAI", "items": [ { "isPartialPromo": true, "itemId": "a2w1N000001F9TiQAK" } ] }, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/8011N00000157LkQAI/promotions" }, "remote": { "params": { "items": [ { "isPartialPromo": true, "itemId": "a2w1N000001F9TiQAK" } ], "cartId": "8011N00000157LkQAI", "methodName": "postCartsPromoItems" } }, "client": { "params": { "methodName": "postCartsPromoItems", "items": [ { "isPartialPromo": true, "itemId": "a2w1N000001F9TiQAK" } ] } } }, "itempricesupdated": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/8011N00000157LkQAI/price" }, "remote": { "params": { "cartId": "8011N00000157LkQAI", "methodName": "getCartLineItemPrices" } }, "client": { "params": {} } } }, "records": [ { "messages": [], "displaySequence": -1, "vlocity_cmt__InCartQuantityMap__c": { "value": { "01t1N00000AptOXQAZ": 1, "01t1N00000AptOcQAJ": 1, "01t1N00000ApqNdQAJ": 1, "01t1N00000ByiiDQAR": 1 }, "previousValue": null, "originalValue": null, "messages": [], "label": "InCartQuantityMap", "hidden": true, "fieldName": "vlocity_cmt__InCartQuantityMap__c", "editable": false, "dataType": "TEXTAREA", "actions": {} }, "Id": { "value": "8021N000006wtTTQAY", "previousValue": null, "originalValue": null, "messages": [], "label": "Order Product ID", "hidden": false, "fieldName": "Id", "editable": false, "dataType": "ID", "actions": {} }, "isVirtualItem": false, "lineItems": { "totalSize": 0, "messages": [], "records": [ { "messages": [], "actions": { "addtocart": { "rest": { "params": { "items": [ { "quantity": 1, "parentId": "8021N000006wtTTQAY", "parentHierarchyPath": "01to000000Am1FGAAZ", "itemId": "01u1N00000DPpdFQAT" } ], "cartId": "8011N00000157LkQAI", "price": true, "validate": true, "includeAttachment": false, "pagesize": 10, "lastRecordId": null, "query": null }, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/8011N00000157LkQAI/items" }, "remote": { "params": { "methodName": "postCartsItems", "items": [ { "quantity": 1, "parentId": "8021N000006wtTTQAY", "parentHierarchyPath": "01to000000Am1FGAAZ", "itemId": "01u1N00000DPpdFQAT" } ], "cartId": "8011N00000157LkQAI", "price": true, "validate": true, "includeAttachment": false, "pagesize": 10, "lastRecordId": null, "query": null } }, "client": { "params": {} } }, "updateitems": { "rest": { "params": { "items": [ { "itemId": "8021N000006wtUMQAY" } ], "filters": null, "fields": null, "cartId": "8011N00000157LkQAI", "price": true, "validate": true, "includeAttachment": false, "pagesize": 10, "lastRecordId": null, "query": null }, "method": "PUT", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/8011N00000157LkQAI/items" }, "remote": { "params": { "methodName": "putCartsItems", "items": [ { "itemId": "8021N000006wtUMQAY" } ], "filters": null, "fields": null, "cartId": "8011N00000157LkQAI", "price": true, "validate": true, "includeAttachment": false, "pagesize": 10, "lastRecordId": null, "query": null } }, "client": { "params": {} } }, [EXAMPLE TRUNCATED FOR BREVITY] ``` # Add With No Configuration Adding a default configuration to the basket is called adding with no configuration. The basket action input parameter is addwithNoConfig along with the offer code to add to the basket. The pricing and validation rules are run on the basket in case of a cache miss scenario and validation checks to ensure the basket is still pristine in case of cache hit scenarios. The types of basket operations are explained in the following subsections. ## Add to Empty Basket Adding to an empty basket means that there are currently no contents or no basket present. A default configuration of the product is added to the basket. Therefore, a basket is created with the default configuration of the offer defined in EPC. The child products having default quantity as 1 or more (considering their ancestors have a default quantity of 1 or more) are added as a line item. Other products with a quantity of 0 are considered child products and are not added. The following are applied to the content of the basket: - Attribute overrides - Advance rules of auto-add - Auto-remove - Modify - Qualification rules on a price list entry - Tightest match price - Matrix-based pricing - Attribute configuration rules - Cardinality overrides The response is generated and cached with a unique key formed by considering the user shape, basket contents, and the operation performed. - Product: There are two modes in which a product can be added to the basket: - Single mode, where only one product is added - Multi mode,  where multiple products can be added to the basket in a single transaction. The product code provides the cached bundle wrapper or offer details that are currently active and have been cached by the offerDetails batch job. With versioning enabled and time slicing on the offer details, you only get the currently active version of that offer. That version is added to the basket and the validation and pricing rules engine are applied. The basket is cached with the effectivity of that particular time slice of the offer details. The version effectivity of the offer is the effectivity of the basket. After a particular product version ends, the basket is no longer valid. The basket effectivity does not exceed the effectivity of the offer versions. - Promotion: Adding a promotion only works in single mode where you can only add one promotion to the basket. The promotion code provides the offer details that are cached during the offer details batch job and time-sliced with the version effectivity of the associated child products. Promotional offer details are added and basket operations are applied. - Simple promotions can be added in single mode or multi-mode. Simple promotions have only admin time configuration with limited functionality for adjustments and overrides. When the simple promotion offer code(s) are passed in the input, the system queries the cached response and gets the corresponding promotional wrappers. The promotional wrappers create the XLIs and promotional items, run validation and pricing, and cache the basket. ## Add to Existing Basket The Add to an existing basket operation adds the default configuration of the offer to an already created and cached basket that has a cart context key. The cart context key is the parameter passed in the input request URL and using that parameter, the system gets the existing cached basket. If the basket is not found with the cart context key passed, the system throws an error stating that the basket has not been found. The cached basket is fetched from the database and a validation check is performed to determine its condition. These validations occur under the Validate URL parameter, which is defaulted to true, so by default, the system checks for the pristinity of the cached basket before proceeding with the add operation. - Product: Adding multiple products in an existing basket follows a similar route of pricing and validation for adding to an empty basket. The cache effectivity is the subset of the existing basket and the individual version time slices that are currently effective. The reference dates passed for the validation and pricing are the current date-time. The cache key processes the bundle structure of the existing basket and offer plus the catalog codes for the new offers that were added or appended. The user shape results in the cart context key. For the addition of individual offers, the basket also caches the current date-time at which the root products were added. For example, an operation on the child product or update at the time at which the root product was added becomes the reference time. - Promotion: Adding promotions to an existing basket can result in two types of internal operations: - Applying a promotion: When the promotional products are already part of the basket and a promotion is added, the promotion and corresponding discounts apply to the basket. With versioning enabled, the effectivity of the basket corresponds to the time slice. - Add the promotional product: When the type is add or apply and the child products are not present in the existing basket, then the system creates the child product order line items and applies the promotion. Adding a promotion means adding the promotional products as well, so with versioning enabled the same time-sliced policy applies. - Simple promotions can be part of multi-add as well as single add. When adding simple promotions to an existing basket, the run-time behavior of the basket remains the same as that of the v2 promotion. Products are added first and then promotions are applied. For add/update, promotional items are created and promotions added. With versioning enabled, pricing and validation are run with the reference date as the current date-time. Caching follows the same time slice date policy. # Adding or Deleting Basket Items or Attributes Use this API to update the quantity or attributes of an offer that has already been added to a basket. The following example shows a typical sequence of API calls to update an item in a basket for a known user. 1. Use the GetOffersByCatalog API to retrieve a list of offers from the catalog (see [Get Offers by Catalog API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-get-offers-by-catalog-api.md)). ```nolang Method: GET API: /services/apexrest/{namespace}/v3/catalogs/{catalog_code}/offers ``` 2. Based on the list of offers returned by the GetOffersByCatalog API, run the GetOfferDetails API to retrieve details about a particular offer (see [Get Offer Details API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-get-offer-details-api.md)). ```nolang Method: GET API: /services/apexrest/{namespace}/v3/catalogs/{catalog_code}/offers/{offer_code} ``` 3. Create a basket and add an item to it by running the Basket API. If the user is known, use the following API call and body: ```nolang Method: POST API: /services/apexrest/{namespace}/v3/catalogs/{catalog_code}/offers/basket&isloggedin=true Request Body: {"offer": "{offer_code}","basketAction": "AddWithNoConfig"} ``` 4. Note the cartContextKey from the API call in Step 3. Be sure to note the CartContextKey, the lineItemKey, and the bundleContextKey if you intend to change or configure the offer. 5. Update the basket with an API call formatted similar to the following: ```nolang Method: PUT API: /services/apexrest/{namespace}/v3/catalogs/{catalog_code}/basket/{cart_context_key}&isloggedin=true Request Body: {"lineItemKey":"xxxxxxxxxxxx","Quantity":"2" "bundleContextKey":"xxxxxxxxxxxxx"} ``` # addToGroup Method Adds a service point to a group. ## Class ## Input Parameters | Parameter | Required | Description | | ----------- | ------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | parentId | Required | Opportunity ID. | | contextId | Required | Parent cart Id (Master/Enterprise Quote/Order Id) | | groupId | Required | Group ID. | | groupCartId | Required if corresponding cart record is present | Group Quote/Order Id. | | groupJSON | Required | Pass the IDs of member to add to the group.`{"servicePoints":["a3R6g000000BAN3EAO", "a3R6g000000BAN4EAO"]}` | | filters | Optional | A SOQL condition added by the API to narrow query results. For custom CPQ Group Member Types in Custom Metadata, no context filter is applied automatically. You must include a filter (e.g., OpportunityId\_\_c:0060b00000vGbYbAAK) to limit results to the relevant Quote, Opportunity, or Account; otherwise, all records will be returned. | | cartType | Optional: Defaults to Quote | Quote or Order | | memberType | Optional: Defaults to ServicePoint | CPQ Group Member Type Name. For example: ServicePoint | ## Output Parameters | Parameter | Description | | --------- | --------------------- | | message | In case of any error. | ## Example Input Data ``` {"groupId":"a4M0b000002CWMaEAO","groupCartId":"0Q00b000000znU2CAI","groupName":"South Group","parentId":"0060b00000vGbYbAAK","contextId":"0Q00b000000znTYCAY","groupJSON":{"servicePoints":["a3h0b00000CwSUFAA3","a3h0b00000CwSUGAA3"]},"memberType":"ServicePoint","OpportunityId\_\_c":"0060b00000vGbYbAAK","cartType":"Quote"} ``` ## Example Output Data ``` {"error":"OK"} ``` # Advanced Order Delivery Date Input The input for calculating and validating a delivery date based on the order specification's lead-time configuration. ## JSON example ```json { "orderSpecId": "0OSRM00000004Cx2AAE", "orderStartDate": "2026-09-08" } ``` ## Properties | Name | Type | Description | Required or Optional | Available Version | | ---------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ----------------- | | `orderSpecId` | String | The ID of the order specification used to determine lead time and working day configuration. | Required | 68.0 | | `orderStartDate` | String | An optional start date for the delivery date calculation, in YYYY-MM-DD format. If no date is specified, the current date is used. | Optional | 68.0 | # Advanced Order Delivery Date Output The output that contains the calculated delivery date and validation result. ## JSON example ```json { "deliveryDateRange": { "earliestDeliveryDate": "2026-09-11", "latestDeliveryDate": "2026-10-09" }, "nonWorkingDaysConfiguration": { "nonWorkingDays": ["Saturday", "Sunday"] }, "isSuccess": true, "errors": [] } ``` ## Properties | Property Name | Type | Description | Filter Group and Version | Available Version | | ----------------------------- | ------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------- | ------------------------ | ----------------- | | `deliveryDateRange` | [Delivery Date Range](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/responses/delivery-date-range.md) | The earliest and latest allowed delivery dates. Null if validation failed. | Small, 68.0 | 68.0 | | `errors` | [Assortment Error](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/responses/assortment-error.md)[] | The list of errors returned if the operation failed. This list is empty when the operation is successful. | Small, 68.0 | 68.0 | | `isSuccess` | Boolean | Indicates whether the delivery date calculation was successful (true) or not (false). | Small, 68.0 | 68.0 | | `nonWorkingDaysConfiguration` | [Nonworking Days Configuration](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/responses/nonworking-days-configuration.md) | The non-working weekday configuration for the order specification. | Small, 68.0 | 68.0 | # Advanced Order Product List Input The input for the product list. Wraps the Configure, Price, Quote (CPQ) product list with assortment and order specification context. ## JSON example ```json { "productListInput": { "catalogId": "0ZSRM0000000Abc4AA", "categoryId": "0ZGRM0000000Xyz1AA", "limit": 25, "offset": 0, "enableQualification": true, "enablePricing": true, "correlationId": "req-0001" }, "customerAccountId": "001RM000004Wk8xYAC", "orderSpecId": "0OSRM00000004Cx2AAE", "configurationOptions": { "filterByAssortment": true, "includeCategoryHierarchies": true } } ``` ## Properties | Name | Type | Description | Required or Optional | Available Version | | ---------------------- | ------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ----------------- | | `configurationOptions` | [Product API Configuration Options](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/requests/product-api-configuration-options.md) | Optional configuration flags that control API behavior, such as assortment filtering and category hierarchies. | Optional | 68.0 | | `customerAccountId` | String | The ID of the customer account. | Required | 68.0 | | `orderSpecId` | String | The ID of the order specification. | Required | 68.0 | | `productListInput` | Object | The Configure, Price, Quote (CPQ) product list input containing catalog, category, filters, and pricing preferences. For the complete request structure, see [Products List (POST)](https://developer.salesforce.com/docs/atlas.en-us.revenue_lifecycle_management_dev_guide.meta/revenue_lifecycle_management_dev_guide/connect_resources_products_list.htm). | Required | 68.0 | # Advanced Order Product List Output The product list output. Contains the Configure, Price, Quote (CPQ) product list enhanced with assortment and order specification metadata. ## JSON example ```json { "productListOutput": { "result": [ { "id": "01tRM000000P9UuYAK", "name": "Premium Widget", "productCode": "WIDGET-001" } ], "total": 1, "limit": 25, "offSet": 0, "correlationId": "req-0001", "contextId": "ctx-0001" }, "categoryHierarchies": [ { "categoryId": "0ZGRM0000000Xyz1AA", "depth": 2, "path": [ { "id": "0ZGRM0000000Root1AA", "name": "All Products", "parentCategoryId": null, "level": 1 }, { "id": "0ZGRM0000000Xyz1AA", "name": "Beverages", "parentCategoryId": "0ZGRM0000000Root1AA", "level": 2 } ] } ], "orderProductSpecListingBehaviour": [ { "id": "0OSRM00000004Cx2AAE", "name": "Standard Order Spec", "listingBehaviour": "Open" } ], "assortmentIds": ["0ASRM00000004Cx2AAE"], "isSuccess": true, "errors": [] } ``` ## Properties | Property Name | Type | Description | Filter Group and Version | Available Version | | ---------------------------------- | ---------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ | ----------------- | | `assortmentIds` | String[] | The list of assortment IDs that were used to filter the products. | Small, 68.0 | 68.0 | | `categoryHierarchies` | [Category Hierarchy Output](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/responses/category-hierarchy-output.md)[] | The list of category hierarchies for all categories in the product results. Each hierarchy contains the complete path from root to leaf with breadcrumb and depth. Populated only when includeCategoryHierarchies is true. | Small, 68.0 | 68.0 | | `errors` | [Assortment Error](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/responses/assortment-error.md)[] | The list of errors. This list is empty when the operation is successful. Each error has an error code and an error message. | Small, 68.0 | 68.0 | | `isSuccess` | Boolean | Indicates whether the operation was successful (true) or not (false). | Small, 68.0 | 68.0 | | `orderProductSpecListingBehaviour` | [Order Product Spec Listing Behaviour](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/responses/order-product-spec-listing-behaviour.md)[] | The list of order product specifications, each with an ID, name, and listing behavior (Open or Closed). | Small, 68.0 | 68.0 | | `productListOutput` | Object | The Configure, Price, Quote (CPQ) product list output that contains products, facets, and pagination information. | Small, 68.0 | 68.0 | # Advanced Order Product Recommendation Input The input for historical product quantities. Includes the customer account ID, order specification, and optional filters. ## JSON example ```json { "customerAccountId": "001RM000004Wk8xYAC", "orderSpecId": "0OSRM00000004Cx2AAE", "operationType": "avg", "orderStatuses": ["Activated"], "orderItemSpecIds": ["0OSRM00000004Cx2AAE"], "includeProductDetails": true } ``` ## Properties | Name | Type | Description | Required or Optional | Available Version | | ----------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------- | ----------------- | | `customerAccountId` | String | The ID of the customer account. | Required | 68.0 | | `includeProductDetails` | Boolean | If true, retrieves full product details from Configure, Price, Quote (CPQ) Product Discovery and includes them in the productDetails field. The default value is false. | Optional | 68.0 | | `operationType` | String | The aggregation operation used to calculate product quantities across multiple orders. Determines how quantity is calculated when a product appears in multiple orders. Valid values are sum, avg, min, and max. The default value is avg. | Optional | 68.0 | | `orderItemSpecIds` | String[] | An optional list of order item specification IDs to filter order items by. Only items that match these specifications are included in recommendations. | Optional | 68.0 | | `orderSpecId` | String | The ID of the order specification that defines the lookback period and order template. | Required | 68.0 | | `orderStatuses` | String[] | An optional list of order statuses to filter by, such as Draft or Activated. If no status is specified, all statuses are included. | Optional | 68.0 | # Advanced Order Product Recommendation Item A historical product with Configure, Price, Quote (CPQ) product details and aggregated quantities per unit of measure from past orders. ## JSON example ```json { "productId": "01tRM000000P9UuYAK", "recommendedQuantities": [ { "unitOfMeasureId": "0RLRM0000001AbcAAE", "quantity": 12, "orderItemSpecId": "0OSRM00000004Cx2AAE" } ], "productDetails": { "id": "01tRM000000P9UuYAK", "name": "Premium Widget", "productCode": "WIDGET-001", "description": "Premium widget, case of 12" } } ``` ## Properties | Property Name | Type | Description | Filter Group and Version | Available Version | | ----------------------- | -------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | ------------------------ | ----------------- | | `productDetails` | Object | The complete product details retrieved from the Configure, Price, Quote (CPQ) product list service. | Small, 68.0 | 68.0 | | `productId` | String | The ID of the Product2 record. | Small, 68.0 | 68.0 | | `recommendedQuantities` | [Advanced Order Recommended Quantity](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/responses/advanced-order-recommended-quantity.md)[] | The aggregated quantities per unit of measure. | Small, 68.0 | 68.0 | # Advanced Order Product Recommendation Output The historical products with Configure, Price, Quote (CPQ) product details and aggregated quantities. ## JSON example ```json { "result": [ { "productId": "01tRM000000P9UuYAK", "recommendedQuantities": [ { "unitOfMeasureId": "0RLRM0000001AbcAAE", "quantity": 12, "orderItemSpecId": "0OSRM00000004Cx2AAE" } ], "productDetails": { "name": "Premium Widget", "listPrice": 49.99 } } ], "ordersAnalyzed": ["801RM0000001AbcYAM"], "lookbackPeriodInDays": 90, "isSuccess": true, "errors": [] } ``` ## Properties | Property Name | Type | Description | Filter Group and Version | Available Version | | ---------------------- | ---------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | ------------------------ | ----------------- | | `errors` | [Assortment Error](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/responses/assortment-error.md)[] | The list of errors returned if the operation failed. This list is empty when the operation is successful. | Small, 68.0 | 68.0 | | `isSuccess` | Boolean | Indicates whether the operation was successful (true) or not (false). | Small, 68.0 | 68.0 | | `lookbackPeriodInDays` | Integer | The number of days included in the lookback period calculation. | Small, 68.0 | 68.0 | | `ordersAnalyzed` | String[] | The list of order IDs that match the specified filters, including account, order specification, status, and lookback period. | Small, 68.0 | 68.0 | | `result` | [Advanced Order Product Recommendation Item](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/responses/advanced-order-product-recommendation-item.md)[] | The list of historical products with product details and aggregated quantities per unit of measure and order item specification. | Small, 68.0 | 68.0 | # Advanced Order Product Search Input The input for searching products. Wraps the Configure, Price, Quote (CPQ) product search with assortment and order specification context. ## JSON example ```json { "searchInput": { "searchTerm": "widget", "catalogId": "0ZSRM0000000Abc4AA", "limit": 25, "offset": 0, "enablePricing": true, "correlationId": "req-0001" }, "customerAccountId": "001RM000004Wk8xYAC", "orderSpecId": "0OSRM00000004Cx2AAE", "configurationOptions": { "filterByAssortment": true } } ``` ## Properties | Name | Type | Description | Required or Optional | Available Version | | ---------------------- | ------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ----------------- | | `configurationOptions` | [Product API Configuration Options](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/requests/product-api-configuration-options.md) | Optional configuration settings that control API behavior, such as assortment filtering. | Optional | 68.0 | | `customerAccountId` | String | The ID of the customer account. | Required | 68.0 | | `orderSpecId` | String | The ID of the order specification. | Required | 68.0 | | `searchInput` | Object | The Configure, Price, Quote (CPQ) product search input that contains the search term, filters, and pagination. For the complete request structure, see [Global Search (POST)](https://developer.salesforce.com/docs/atlas.en-us.revenue_lifecycle_management_dev_guide.meta/revenue_lifecycle_management_dev_guide/connect_resources_global_search.htm). | Required | 68.0 | # Advanced Order Product Search Output The product search output. Contains Configure, Price, Quote (CPQ) search results enhanced with order specification metadata and optional category hierarchies. ## JSON example ```json { "searchOutput": { "correlationId": "req-0001", "catalogId": "0ZSRM0000000Abc4AA", "contextId": "ctx-0001", "result": [ { "id": "01tRM000000P9UuYAK", "name": "Premium Widget", "productCode": "WIDGET-001" } ], "total": 1, "limit": 25, "apiStatus": { "statusCode": 200, "messages": [] } }, "categoryHierarchies": [], "isSuccess": true, "errors": [] } ``` ## Properties | Property Name | Type | Description | Filter Group and Version | Available Version | | --------------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ | ----------------- | | `categoryHierarchies` | [Category Hierarchy Output](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/responses/category-hierarchy-output.md)[] | The list of category hierarchies for all categories in the search results. Populated only when includeCategoryHierarchies is true. | Small, 68.0 | 68.0 | | `errors` | [Assortment Error](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/responses/assortment-error.md)[] | The list of errors returned if the operation failed. Each error contains an error code and an error message. The list is empty when the operation is successful. | Small, 68.0 | 68.0 | | `isSuccess` | Boolean | Indicates whether the operation was successful (true) or not (false). | Small, 68.0 | 68.0 | | `searchOutput` | Object | The Configure, Price, Quote (CPQ) product search output that contains products, facets, and pagination information. | Small, 68.0 | 68.0 | # Advanced Order Recommended Quantity The aggregated quantity for a specific unit of measure and order item specification combination. ## JSON example ```json { "unitOfMeasureId": "0RLRM0000001AbcAAE", "quantity": 12, "orderItemSpecId": "0OSRM00000004Cx2AAE" } ``` ## Properties | Property Name | Type | Description | Filter Group and Version | Available Version | | ----------------- | ------- | -------------------------------------------------------------------------------------------------------------- | ------------------------ | ----------------- | | `orderItemSpecId` | String | The ID of the order item specification that this quantity belongs to. Null if it isn't set on the order items. | Small, 68.0 | 68.0 | | `quantity` | Integer | The aggregated quantity for this unit of measure based on the specified operation type. | Small, 68.0 | 68.0 | | `unitOfMeasureId` | String | The ID of the unit of measure record. | Small, 68.0 | 68.0 | # Advanced Orders for Telesales Advanced Orders for Telesales helps sales reps quickly build and place large orders during telesales interactions. Use the Advanced Order REST APIs to browse assortments and products, get a customer's previously ordered products and valid delivery dates, get instant pricing for order line items, and place orders in a single request for Manufacturing, Automotive, and Consumer Goods telesales. With the Advanced Order Business APIs, you can: - Retrieve the product assortments available to a customer account for an order specification. - Get a filtered product list, search the product catalog, and view category hierarchies. - Get the products a customer previously ordered, with quantities aggregated by unit of measure. - Get the valid delivery date range for an order based on lead-time configuration. - Get instant pricing for order line items. - Place an order in one request by submitting its products, pricing, and tax preferences together. Manufacturing Cloud, Automotive Cloud, and Consumer Goods Cloud extend the standard Salesforce platform with a set of standard and custom objects that support account-based selling, assortment and location management, inventory movement, product cataloging, and advanced order capture. This reference describes the objects that make up that "Orders" object domain — spanning the account hierarchy, assortment/location model, inventory operations, standard product catalog objects, and the Advanced Orders feature. Each object's reference lists its description, supported API calls, any special access rules, and its fields (including, for each relationship field, its relationship name and the object(s) it refers to), plus its associated objects (such as feed, history, and sharing objects), where documented. Note on API version availability: All 29 objects covered in this guide are available in API version 68.0 and later. Note on shared objects: Account, AccountAccountRelation, InternalOrganizationUnit, PartyRoleRelation, and Product2 are foundational objects also documented in the Object Reference for the Salesforce Platform or a companion cloud developer guide (direct links are in the Data Model). AccountFlattenedHierarchy, AccountInternalOrgUnit, AccountRole, and InternalOrgUnitUser are additional objects shared with the companion Penny Perfect Pricing guide, with no single canonical external reference; their full documentation is in this guide, under Other Shared Objects. ## Standard Objects Advanced Orders for Telesales uses standard Salesforce objects to store order, product, and assortment data. For the list of standard objects and their key fields, see [Standard Objects](/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects). ## Business APIs Use the Advanced Order Business APIs to browse assortments and products, retrieve historical orders and delivery dates, and place orders. For the resources, request bodies, and response bodies, see [Advanced Order Business APIs](/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-rest). # Advanced Rules with Digital Commerce The Digital Commerce API caching leverages the advanced rules framework. Advanced rules determine the product configuration and relationships by applying Entity Filters. Advanced rules support the ability to create Entity Filters for product relationships. For more information, see [Advanced Rules Framework](https://help.salesforce.com/s/articleView?id=ind.comms_advanced_rules_framework.htm). Advanced rules are supported within the configure and basket operations. ![Customer SLA Rule Set](https://developer.salesforce.com/docs/media/dc_advanced_rules.png) The following advanced rules are supported for Digital Commerce: - [Defining Advanced Rules Using Configuration Type](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-defining-advanced-rules-using-configuration-type.md), which supports product relationships. You can create entity filters for product relationships. - [Defining Advanced Rules Using Attribute Configuration Type](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-defining-advanced-rules-using-attribute-configuration-type.md), which lets you define advanced rules using the product configuration procedure. You can also use advanced rules to create entity filters. The following advanced rules are not applicable for Digital Commerce: - Pricing - For Digital Commerce APIs, use [Pricing Plan](https://help.salesforce.com/s/articleView?id=ind.comms_pricing_plans_in_epc.htm) or [Tightest Match](https://help.salesforce.com/s/articleView?id=ind.comms_tightest_match.htm). - Eligibility - see [Context Eligibility Rules with Digital Commerce](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-context-eligibility-rules.md). - Availability - with Digital Commerce # Affected Cache API The Get Affected Cache API gets the cached records affected by the derived cachedAPIChange objects received from the [Derive Change Entities API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-derive-change-entities-api.md). This API takes the derived cachedAPIchange Ids as input and maps them to the cachedAPIResponse entries that are affected by the derived Ids. The system internally creates a cachedAPIChangeEntry using the Id of the cachedAPIchange object passed in the input and the affected response from the CachedAPIResponse object. If you add a new offer, then there are no cachedAPIResponse objects present and no entities in CachedAPIResponse object are affected. In this case, the cacheKey field of CachedAPIChangeEntry object would be null. The default value of the `CacheAPI.RegenerateBasket` custom setting is `regenerate`. This setting specifies whether to invalidate or regenerate the Digital Commerce API basket cache as part of the regenerate process. You can set this to invalidate only the basket records and not regenerate them. For example, if you have made a pricing change and computed the impacted entities from the [Derive Change Entities API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-derive-change-entities-api.md), then posting this change determines which cached records have been impacted due to this derivation (regeneration case). You can obtain the List\ or cachedAPIChangeIds required in the request body of this API from the cachedAPIChangeIds node in the response body of the [Derive Change Entities API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-derive-change-entities-api.md). There are up to three different API calls provided by the action nodes of this API's response. They are: - invalidateAction (required): Invalidates the cache entries that have become inaccurate due to catalog offer changes. You must pass the cachedAPIResponseIds provided in the invalidateAction node received in the response from Get Affected Cache. For example: `POST /services/apexrest/vlocity_cmt/v3/admin/catalogs/regenerate/invalidate?expirationTime=2021-08-24T12:08:56` If you run the invalidateAction then call regenerateAction while the parameter is set to invalidateAction, the cache is left in an invalidated state. - generateAction: This call is required if the generateAction node is present in the response from Get Affected Cache. If you have at least one offer availability change based on the response you received from the Get Affected Cache, then you must execute certain populate cache APIs again using the catalog codes provided in the response. For example, you may receive the generateAction asking you to perform five of the populate cache APIs with the catalog code AS_hierarchywithpromotion. - regenerateAction: If you receive regenerateAction nodes in your response from GetAffectedCache, then you must execute an API call for each node in the chronological sequence provided, for example, perform the node with Sequence 8, followed by the node with Sequence 9, etc. You must append the ChangeEntryId parameter and its provided value to the URI. For example: `POST /v3/admin/catalogs/{value}/offers/{value}/{APIname}?ChangeEntryId={value}` These three API calls must be executed with the invalidateAction calls first, followed by the generateAction calls, and finally the regenerateAction calls. In some cases, you do not need to perform generateAction calls, and you do not receive a corresponding node. ## URI /services/apexrest/vlocity_cmt/v3/admin/catalogs/regenerate/affectedCache ## HTTP Method POST ## URI Parameters You can make this cache effective from a future date using the cacheEffectiveStartTime parameter. Here is an example of how to use it: | Parameter | Example | Default | Optional/Required | Notes | | ----------------------- | ------------------- | ------- | ----------------- | --------------------------------------------------------------------------- | | cacheEffectiveStartTime | 2021-08-24T12:08:56 | Null | Optional | This parameter is for future-dated cache. The format is YYYY-MM-DDThh:mm:ss | ```nolang POST /services/apexrest/vlocity_cmt/v3/admin/catalogs/regenerate/affectedCache?cacheEffectiveStartTime=2021-08-24T12:08:56 ``` ## Request Body Parameters | Parameter | Data Type | Description | Optional/Required | | ------------------ | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------- | | cachedAPIChangeIds | String | Unprocessed cachedAPIChange Ids are the output of the [Derive Change Entities APIDerive Change Entities API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-derive-change-entities-api.md), | Required | ## Sample Post Body This is a sample post for cachedAPIChangeIds. ```nolang { "cachedAPIChangeIds": [ "a4Q5g000000TmqjEAC", "a4Q5g000000TmqkEAC", "a4Q5g000000TmqlEAC", "a4Q5g000000TmqmEAC", "a4Q5g000000TmqnEAC", "a4Q5g000000TmqoEAC" ] } ``` ## Sample Input cachedAPIChangeIds contain derived Ids from the cached API change object, which could be a list of changes. This is sample input for cachedAPIChangeIds. ```nolang { "cachedAPIChangeIds": [ "a4Q5g000000TmqjEAC", "a4Q5g000000TmqkEAC", "a4Q5g000000TmqlEAC", "a4Q5g000000TmqmEAC", "a4Q5g000000TmqnEAC", "a4Q5g000000TmqoEAC" ] } ``` ## Remote API This is an example of how you invoke the API using Apex: ```nolang String methodName; Map input = new Map(); Map output = new Map(); Map options = new Map(); // Setting remote parameters methodName = 'getAffectedResponseEntity'; input.put('methodName',methodName);//required input.put('apiName','regenerate'); //requires List cachedAPIChangeMap = new List(); cachedAPIChangeMap.add('a4Q5g000000PQiKEAW'); input.put('cachedAPIChangeIds',cachedAPIChangeMap); //required //remote action invocation regen_234_1.CpqAppHandler appHandler = new regen_234_1.CpqAppHandler(); appHandler.invokeMethod(methodName, input, output, options); ``` ## Parallel Invocation You can run this API in parallel for different cachedAPIChangeIds. For example, if there are 100 unprocessed cachedAPIChange entries from the DeriveChangeAPI (CAC1, CAC2.....CAC100), you can run parallel threads of the Derive Change API with each individual cachedAPIChangeIds. ```nolang THREAD1 - POST /services/apexrest/vlocity_cmt/v3/admin/catalogs/regenerate/affectedCache Body : {"cachedAPIChangeIds":CAC1} THREAD2 - POST /services/apexrest/vlocity_cmt/v3/admin/catalogs/regenerate/affectedCache Body : {"cachedAPIChangeIds":CAC2} THREAD3 - POST /services/apexrest/vlocity_cmt/v3/admin/catalogs/regenerate/affectedCache Body : {"cachedAPIChangeIds":CAC3} . . . . THREAD100 - POST /services/apexrest/vlocity_cmt/v3/admin/catalogs/regenerate/affectedCache Body : {"cachedAPIChangeIds":CAC100} ``` ## HTTP Headers | Header | Description | | ------------ | ---------------- | | Content-Type | application/json | ## Response Body The return status indicates success or failure with a reason for the error. List\ may include records that could be a generateAction, regenerateAction, or invalidateAction node. ``` { "records": [ { "Sequence": 6, "regenerateAction": { "offersItem": { "rest": { "requestBody": { "offerIds": [ "01t5g000001q3wWAAQ" ] }, "params": { "ChangeEntryId": "a525g000000CjbQAAS", "forceinvalidatecache": true, }, "link": "/v3/admin/catalogs/CM_CAT_B/offersitem", "method": "POST" } } } }, { "Sequence": 7, "regenerateAction": { "getOffers": { "rest": { "requestBody": null, "params": { "pagesize": "20", "offset": "0", "context": "{\"AF\":\"false\",\"AT\":\"false\"}", "ChangeEntryId": "a525g000000CjaBAAS", "forceinvalidatecache": true }, "link": "/v3/catalogs/CM_CAT_B/offers", "method": "GET" } } } }, { "Sequence": 9, "regenerateAction": { "getOfferDetails": { "rest": { "requestBody": null, "params": { "forceinvalidatecache": true, "ChangeEntryId": "a525g000000CjVaAAK", "context": "{\"AF\":\"true\",\"AT\":\"true\"}" }, "link": "/v3/catalogs/CM_CAT/offers/POPA", "method": "GET" } } } }, { "Sequence": 10, "regenerateAction": { "bundleWrapper": { "rest": { "requestBody": { }, "params": { "forceinvalidatecache": true, "ChangeEntryId": "a525g000000CjVbAAK" }, "link": "/v3/admin/catalogs/mobiles/offers/01t4W00000BgarjQAB/bundlewrapper", "method": "POST" } } } }, { "Sequence": 11, "regenerateAction": { "basket": { "rest": { "requestBody": { "basketAction": "addWithNoConfig", "offer": [ "POPA", "PB" ] }, "params": { "forceinvalidatecache": true, "ChangeEntryId": "a525g000000Cni3AAC", "oldCacheKey": "d88da4dfb8a0810947942cc885a83f82" }, "link": "/v3/catalogs/CM_CAT/basket", "method": "POST" } } } }, { "invalidateAction": { "invalidateCachedResponse": { "rest": { "requestBody": { "cachedAPIResponseIds": [ "a0a5g0000005JbKAAU", "a0a5g0000005JaGAAU", "a0a5g0000005JbTAAU", "a0a5g0000005JbUAAU", "a0a5g0000005JbVAAU", "a0a5g0000005JbWAAU" ] }, "params": { }, "link": "/v3/admin/catalogs/regenerate/invalidate", "method": "POST" } } } }, { "generateAction": { "catalogCodes": [ "CM_CAT_B", "CM_CAT" ], "apiNames": [ "catalogprofile", "ruleSetCombination", "contextDimension", "contextCombination", "contextEligibility" ] } } ], "errorCode": "INVOKE-200", "error": "OK" } ``` ## HTTP Response Codes | Code | Description | | ---- | --------------------- | | 200 | OK | | 500 | Internal Server Error | # Alternative method: login-based authorization This method requires specific permissions for the user validating the connected app. It may fail in some cases where the permissions are restrictive, thus we recommend the preferred method above. 1. From the Connected Application in the section "API (Enable OAuth Settings)", retrieve the “Consumer Key” and “Callback URL” - YOUR_CLIENT_ID : Consumer Key - YOUR REDIRECT_URL : Callback URL 2. Depending on where to use the connected app, build a URL based on one of the following: - If the connected app is in the Sandbox/Test salesforce domain: ```nolang https://test.salesforce.com/services/oauth2/authorize?response_type=token&client_id=&redirect_uri= ``` - If using the standard salesforce domain: ```nolang https://login.salesforce.com/services/oauth2/authorize?response_type=token&client_id=&redirect_uri= ``` ![DCG Connected App Setup - Login based authorization](https://developer.salesforce.com/docs/media/dcg_4.png) After the URL is built, open it in your browser. The link redirects to the Salesforce login page. Log in using the Salesforce username and password which will authorize the access. # Annual Pricing Variable A custom field with a defined pricing variable alone isn't sufficient for annual prices. Rollups are needed for both the line items and the order header. The order total must incorporate the annual prices, and these prices must be capable of handling adjustments, discounts, and other modifications. Annual pricing variable enables users to specify an annual price for products within the Enterprise Product Catalog (EPC). This pricing detail can then be utilized in both the Industries Configure, Price, Quote (CPQ) Cart and the Standard Digital Commerce API. ## Initial Setup ### Create Custom Fields on Order Item | Field Label | Field Name | Data Type | Purpose | | ----------------------- | -------------------------- | --------------- | --------------------------------------------------- | | Annual Charge | AnnualCharge\_\_c | Currency(16, 2) | Store base annual price from PLE or ABP | | Annual Calculated Price | AnnualCalculatedPrice\_\_c | Currency(16, 2) | Net price, if discount is present | | Annual Effective Total | AnnualEffectiveTotal\_\_c | Currency(16, 2) | Annual total for root items (Bundle Total) | | Annual Manual Discount | AnnualManualDiscount\_\_c | Percent(2, 2) | Discount percentage field | | Annual Total | AnnualTotal\_\_c | Currency(16, 2) | Total for calculated price and rollup with quantity | ### Create Custom Fields on Order | Field Label | Field Name | Data Type | Formula | | ----------------------- | ------------------------- | ---------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Total: Annual Charges | AnnualTotal\_\_c | Roll-Up Summary (Annual Total) | - | | Effective Total: Annual | AnnualEffectiveTotal\_\_c | Roll-Up Summary (Annual Effective Total) | - | | Order Total | OrderTotal2\_\_c | Formula | vlocity_cmt\_\_OneTimeTotal\_\_c + vlocity_cmt\_\_Tax\_\_c +( vlocity_cmt\_\_RecurringTotal\_\_c \* vlocity_cmt\_\_NumberOfContractedMonths\_\_c )+(AnnualTotal\_\_C\*(vlocity_cmt\_\_NumberOfContractedMonths\_\_c/12)) | | Effective Order Total | EffectiveOrderTotal2\_\_c | Formula | vlocity_cmt\_\_EffectiveOneTimeTotal\_\_c + vlocity_cmt\_\_Tax\_\_c +( vlocity_cmt\_\_EffectiveRecurringTotal\_\_c \* vlocity_cmt\_\_NumberOfContractedMonths\_\_c ) + (AnnualEffectiveTotal\_\_c \* (vlocity_cmt\_\_NumberOfContractedMonths\_\_c) / 12) | **note:** The total formulas use the vlocity_cmt\_\_NumberOfContractedMonths\_\_c field to prorate Annual totals. This can be adjusted or changed independently without affecting the rest of the configuration. ### Create Annual Pricing Variable | Pricing Variable Name | Code | Aggregation | Charge Type | Frequency | Scope | Applies To Variable | Pricing Variable Binding Name | Object | Field | Type | Sub-Type | ValueType | | ------------------------------------ | ---------------------------------- | ----------- | ----------- | --------- | ------------ | ------------------------------------ | -------------------------------------------- | --------- | -------------------------- | ----- | -------- | --------------- | | Annual Charge Adjustment Absolute | ANNUAL_CHARGE_ADJ_ABS | Unit | Adjustment | Yearly | Line | Annual Std Price | | | | Price | Standard | Pricing Element | | Annual Charge Adjustment Percent | ANNUAL_CHARGE_ADJ_PERC | Unit | Adjustment | Yearly | Line | Annual Std Price | | | | Price | Standard | Pricing Element | | Annual Std Price | ANNUAL_CHARGE | Unit | Recurring | Yearly | Line | | Annual Std Price - OrderItem | OrderItem | AnnualCharge\_\_c | Price | Standard | Pricing Element | | Annual Std Price Calculated | ANNUAL_STD_PRC_CALC | Unit | Recurring | Yearly | Line | | Annual Std Price Calculated - OrderItem | OrderItem | AnnualCalculatedPrice\_\_c | Price | Standard | Calculated | | Annual Std Price Discount Pct Manual | ANNUAL_STD_PRC_DISC_PCT_MAN | Unit | Adjustment | Yearly | Line | Annual Std Price | | | | Price | Standard | Calculated | | Annual Std Price Total | ANNUAL_STD_PRC_TOTAL | Quantity | Recurring | Yearly | Line | | Annual Std Price Total - OrderItem | OrderItem | AnnualTotal\_\_c | Price | Standard | Calculated | | Effective Annual Std Price Total | EFF_ANNUAL_STD_PRC_TOTAL | Quantity | Recurring | Yearly | Line | | Effective Annual Std Price Total - OrderItem | OrderItem | AnnualEffectiveTotal\_\_c | Price | Standard | Calculated | | Group Rollup Annual Std Price Total | GROUP_ROLLUP_ANNUAL_STD_PRC_TOTAL | Quantity | Recurring | Yearly | Group Rollup | Parent Rollup Annual Std Price Total | | | | Price | Standard | Calculated | | Parent Rollup Annual Std Price Total | PARENT_ROLLUP_ANNUAL_STD_PRC_TOTAL | Quantity | Recurring | | | | Parent Rollup Annual Std Price Total - Order | OrderItem | AnnualEffectiveTotal\_\_c | Price | Standard | Calculated | | Rollup Annual Std Price Total | ROLLUP_ANNUAL_STD_PRC_TOTAL | Quantity | Recurring | | Rollup | Annual Std Price Total | | | | Price | Standard | Calculated | ### Create Custom Pricing Hook Here's the sample code for creating a custom pricing hook. ``` global with sharing class PricingVariableMapHookImplementation implements vlocity_cmt.VlocityOpenInterface { global Boolean invokeMethod (String methodName, Map input,Map output, Map option) { System.debug ('debug PricingVariableCalcHook: class called'); if(methodName == 'calculate.PostInvoke') { calculatePostInvoke (input, output); } return true; } private void calculatePostInvoke(Map input,Map output) { // New code from here System.debug('?? initial output map: '+JSON.serialize(output)); Boolean isRoot = (Boolean)input.get('isRoot'); System.debug('?? isRoot: '+(Boolean)input.get('isRoot')); Map calculatedPricingLogDataMap = (Map)output.get('calculatedPricingLogData'); Map pricingVariableCodeToValueMap = (Map)output.get('pricingVariableCodeValueMap'); // Below 2 checks for apply promo scenario for cart API as apply promo is still uses classic flow // Should not be required for standard DC API if(calculatedPricingLogDataMap == null ) { calculatedPricingLogDataMap = (Map)output.get('pricingLogDataMap'); } if(pricingVariableCodeToValueMap == null ) { pricingVariableCodeToValueMap = (Map)output.get('pricingVariableMap'); } Decimal lineQuantity = getValueFromPVC(pricingVariableCodeToValueMap, 'LINE_QUANTITY'); Decimal annualStdPrice = getValueFromPVC(pricingVariableCodeToValueMap,'ANNUAL_CHARGE'); System.debug('?? annualStdPrice: ' + String.valueOf(annualStdPrice)); Decimal annualStdPriceDiscPctManual = getValueFromPVC(pricingVariableCodeToValueMap,'ANNUAL_STD_PRC_DISC_PCT_MAN'); Decimal rollupAnnualStdPriceTotal = getValueFromPVC(pricingVariableCodeToValueMap,'ROLLUP_ANNUAL_STD_PRC_TOTAL'); System.debug('?? rollupAnnualStdPriceTotal: ' + String.valueOf(rollupAnnualStdPriceTotal)); //getValueFromPVC(pricingVarCodeValueMap, PricingVariableCode.EFF_REC_MONTH_STD_PRICE_TOTAL); Decimal annualStdPriceCalc = annualStdPrice - (annualStdPrice * (annualStdPriceDiscPctManual / 100.0)); Double annualStdPriceTotal = lineQuantity * (annualStdPriceCalc.doubleValue() + rollupAnnualStdPriceTotal.doubleValue()); // Should consider rounding of value pricingVariableCodeToValueMap.put('ANNUAL_STD_PRC_TOTAL',annualStdPriceTotal); pricingVariableCodeToValueMap.put('ANNUAL_STD_PRC_CALC',annualStdPriceCalc); calculatedPricingLogDataMap.put('ANNUAL_STD_PRC_TOTAL', new Map{ 'format'=> '[%s (%s) + Rollup %s (%s)] x %s (%s)', 'data'=>new List{'Annual Calculated Price', String.valueOf(annualStdPriceCalc), 'Annual Total', String.valueOf(rollupAnnualStdPriceTotal), 'LINE_QUANTITY', String.valueOf(lineQuantity) }}); if (isRoot) { pricingVariableCodeToValueMap.put('EFF_ANNUAL_STD_PRC_TOTAL',annualStdPriceTotal); System.debug('?? annualStdPriceTotal: ' + String.valueOf(annualStdPriceTotal)); }24 System.debug('?? final output map'+JSON.serialize(output)); //logic for line item totals and rollups //Set line item level custom fields //Getting the cart document instance vlocity_cmt.CpqCartDocument cart = (vlocity_cmt.CpqCartDocument)input.get('cartDocument'); String currentItemId = (String)input.get('itemId'); System.debug('debug currentItemId:'+currentItemId); //method to get all the line items Map outputMap = cart.call('getAllItems', new Map{'hierarchyLevel'=>-1}); Map allItemsMap = (Map) outputMap.get('result'); //Getting the cartDocumentItem having id as currentItemId vlocity_cmt.CpqCartDocumentItem currentItem = allItemsMap.get(currentItemId); Map itemArgs = new Map(); itemArgs.put('annualrecurringcharge', annualStdPrice); Double total = 0.0; itemArgs.put('annualtotal', annualStdPriceTotal); currentItem.call('setItemFields', new Map{'fieldValueMap' => itemArgs}); } private Decimal getValueFromPVC(Map pricingVarCodeValueMap, String pricingVariableCode) { Object val = pricingVarCodeValueMap.get(pricingVariableCode); if (val == null) { pricingVarCodeValueMap.put(pricingVariableCode, 0.0); } else { pricingVarCodeValueMap.put(pricingVariableCode, val); } return Decimal.valueOf((Double) pricingVarCodeValueMap.get(pricingVariableCode)); } } ``` ### Create Interface Implementation Record First, create the interface. Then, associate the Active Implementation Class from the `Interface Implementation Detail` related list. The Active Implementation Class field will be automatically populated once the implementation record is created. - Interface Name: `CpqPricingVariableCalcHook` - Active Implementation Class: `PricingVariableMapHookImplementation` ## Enable Standard Digital Commerce You need to enable standard digital commerce. See [Enable Standard Digital Commerce](https://developer.salesforce.com/docs/industries/cme/guide/comms-enable-standard-digital-commerce.html). ### Create Cart Mapping Entries for Annual Custom Fields | Name | Destination Field name | Destination SObject Type | Source Field Name | Source SObject Type | Source Field Type | | -------------------------------- | ---------------------- | ------------------------ | --------------------- | ------------------- | ----------------- | | OrderItem>CPQCartDocumentItem101 | AnnualCharge | CpqCartDocumentItem | AnnualCharge | OrderItem | string | | OrderItem>CPQCartDocumentItem102 | AnnualCalculatedPrice | CpqCartDocumentItem | AnnualCalculatedPrice | OrderItem | string | | OrderItem>CPQCartDocumentItem103 | AnnualEffectiveTotal | CpqCartDocumentItem | AnnualEffectiveTotal | OrderItem | string | | OrderItem>CPQCartDocumentItem104 | AnnualManualDiscount | CpqCartDocumentItem | AnnualManualDiscount | OrderItem | string | | OrderItem>CPQCartDocumentItem105 | AnnualTotal | CpqCartDocumentItem | AnnualTotal | OrderItem | string | ### Add Custom Fields to Basket You need to add fields to the basket. See [Add Fields to the Basket](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-add-fields-to-the-basket.html?_ga=2.238836163.29198268.1715680337-1254941895.1715671052). # Anonymous and Known User Browsing As online activities increase, so do the number of online user accounts. Users do not want to create yet another account unless there is a clear benefit to doing so. The benefit occurs when the customer has decided to purchase an item from the website and it is time to close the sale. Otherwise, shoppers may go to great lengths to avoid signing in to complete a purchase, including abandoning their cart. The solution to this issue is to give people the option of anonymous browsing to gauge their interest in purchasing products. A typical conversion funnel in e-commerce illustrates the route your customers take from first becoming aware of your brand to making a purchase. ![A typical conversion funnel based on the sales process that you can use to convert prospects to actual customers.](https://developer.salesforce.com/docs/media/dc_ecommfunnel.png) The e-commerce conversion funnel relates to the APIs for anonymous browsing, such as Get Offers By Catalog, Get Offer Details, Get Featured Offers, etc. For more information on the APIs, see [Digital Commerce (Cacheable) APIs](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-digital-commercecacheableapis.md). During anonymous browsing, you can filter the list of products retrieved from the shared catalog based on context information by creating a context eligibility rule as described in the [Anonymous and Known User Browsing Use Case](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-use-case.md). # API Task Reference for Digital Commerce The table below shows which Digital Commerce API to use given a specific task to perform. Also shown are the API methods to use (GET, POST, or PUT). | Task | API method | API | | ---------------------------------------------------------------------- | ---------- | ------------------------------------------------------------------------------------------------- | | Retrieve a list of offers from a catalog | GET | [Get Offers by Catalog API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-get-offers-by-catalog-api.md) | | Retrieve a list of featured offers | GET | [Get Offers by Catalog API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-get-offers-by-catalog-api.md) | | Retrieve offers that contain a specified product | GET | [Get Offers by Catalog API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-get-offers-by-catalog-api.md) | | Retrieve offer details and child items | GET | [Get Offer Details API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-get-offer-details-api.md) | | Configure an offer and view updated prices, quantities, and attributes | POST | [Post Offer Details with Configuration API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-post-offer-details-with-configuration-api.md) | | Put item in basket | POST | [Create Basket with BasketAction](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-create-basket-with-basketaction.md) | | Put selection into existing basket | POST | [Update Basket Contents API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-update-basket-contents-api.md) | | Retrieve cart items | GET | [Get Basket Details API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-get-basket-details-api.md) | | Convert basket to Salesforce order | POST | [Create Cart from Basket](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-create-cart-from-basket.md) | # API Troubleshooting Use the table in this topic to diagnose problems that occur when executing the Digital Commerce APIs.

Problem Area

Possible solution

getOffers API returns null result.

  • Ensure that the ContextEligibilityGenerator and GetPrices jobs have been run.

getOffers API returns "attempt to dereference null object" error.

  • Ensure that all context rules are configured correctly.

  • Ensure that the Context dimension name and code are the same. (Only applicable for CME Fall '18 .)

getOfferDetails API returning "attempt to dereference null" error.

  • Ensure that all of the products in the hierarchy are active.

  • Ensure that the Product Hierarchy maintenance job has been run.

  • Ensure that the GetOffersHierarchyHelper and GetPrices jobs have been run.

getOfferDetails API not returning the PriceResult node.

  • Ensure that the GetPrices job has been run.

  • Ensure that the offer has both one-time and recurring prices defined.

getOfferDetails API fails with no error in response.

Ensure that virtual products do not have any attributes assigned. Assigning attributes to virtual products results in unpredictable results when calling the Digital Commerce APIs.

getOfferDetails API not returning the result node.

This error is likely caused by your product not having a price list entry or your catalog does not have a Price List defined in the vlocity_cmt_DefaultPriceListId_c field.

GetOfferDetails API returns "Invalid context input for context key"

This error is returned when the user passes an invalid context parameter in the URL, or when the context key of cartContext, eligibilityContext, or groupContext has expired in the cachedapiresponse**c table.

The getOfferDetails batch job returns the following error: Too many SOQL queries.

Check the value of the batchSize parameter. Go to the Vlocity API Metadata tab, and select the record whose API name is GetOfferDetails. Ensure the value is set as follows:

{batchSize":1"}

ConfigureOffer API returning "attempt to dereference null" error.

Ensure that the CacheAPIFields custom setting has been set to true. CacheAPIFields is not required for CME 103.1.14 and later versions.

ConfigureOffer API returning "attempt to dereference null" error for a promotion.

Ensure that the CacheAPIPartialConfigure custom setting is set.

The API cache batch jobs are not creating any batch records.

Ensure that the following jobs have been run:

Interface Implementation Maintenance (Restore)

Interface Implementation Maintenance (Merge)

The above jobs are run by navigating to Vlocity CMT Administration > Maintenance Jobs.

The GetPrices batch job is not running any batch records.

Ensure that you have added a default price list to the catalog.

The Add To Basket API returns the following error: error: VLC-PPLAN-ERR-001 No custom setting value found for DefaultPricingPlan".

  • Check the Implementation for "PricingInterface."

  • If the Active Implementation is "PricingPlanService," then verify that "Default Pricing Plan" exists in EPC and that it is active. Check whether the CPQ Configuration custom setting Name = DefaultPricingPlan and Value = DEFAULT_PRICING_PLAN exist.

The Add To Basket API returns a time out error.

Run the following query:

SELECT count() FROM vlocity_cmt**OrderPriceAdjustment**c where vlocity_cmt**OrderItemId**c = null and vlocity_cmt**Source**c = 'Agent';

The above query should not return any rows. If the query returns rows, it is invalid data. Please investigate why these records are generated and remove them.

The Add To Basket API fails withError: ‘null input to JSON parser’,

Or GetOfferDetails returns an empty response for a specific product.

Check and delete all attributes (JSONAttribute) from ‘Virtual Item’ products used as part of product hierarchies.

JSONAttribute is not supported for Virtual Items and should not be used.

The API cache batch jobs are not populating the cache or the Digital Commerce APIs are returning null results.

Ensure that the CachedAPIResponse**c.Type**c pick list values are up to date. See the lists below:

The following values are new for CME Fall '18 :

  • item

  • itemDetails

  • priceResult

  • catalogCtxEligibilityResult

  • cartContext

  • eligibilityContext

  • hierarchyResult

  • itemConfig

  • orderConfiguration

The following values currently exist in CME Winter '19:

  • item

  • itemDetails

  • priceResult

  • catalogCtxEligibilityResult

  • cartContext

  • eligibilityContext

  • hierarchyResult

  • itemConfig

  • orderConfiguration

The following values are new in CME Winter '19:

  • dataProfileResultItem

  • ruleSetCombinationResultItem

  • catalogCtxQualificationMap

The following values currently exist in the CME Summer '19:

  • item

  • itemDetails

  • priceResult

  • catalogCtxEligibilityResult

  • cartContext

  • eligibilityContext

  • hierarchyResult

  • itemConfig

  • orderConfiguration

  • dataProfileResultItem

  • ruleSetCombinationResultItem

  • catalogCtxQualificationMap

The following values are new in CME Summer '19:

  • groupContext

  • basketWrapper

  • assetReferenceKey

 

Digital Commerce APIs use the CachedAPIResponse**c custom object to cache responses. Like other custom objects, CachedAPIResponse\_\_c can store records until the org's data storage limit is reached.

Error Code: INVOKE-200, Unable to process basket operation

Ensure that you followed the Post Install Steps for CME Summer '19. Specifically, the section about adding the picklist values for the CachedAPIResponse object. For details, see Post-Upgrade Steps for Winter '19 to Summer '19 for ​Salesforce Industries Communications, Media, and Energy.

When the Vlocity API Metadata record or records return a null API Name field value and/or a null API Parameter field value, you will see a 500 response with an attempt to de-reference a null object in the response body.

Ensure that you check all the Vlocity API Metadata records, and delete the ones that have a null API Name or a null API Parameter name.

# Apply Adjustment Apply an adjustment (such as a discount, markup, or override) to a price for a cart and line item, which are specified by the cartId and id parameters. The PricingElementServiceImplementation supports this API. ```nolang POST /v2/cpq/carts/{cart_ID}/items/{ID}/pricing ``` The caller can add the new `skipCartRefresh` parameter to the applyAdjustments API call. If `skipCartRefresh` is set to True, the `getCartsItems` API will not be triggered. If it is omitted or set to False, getCartsItems will be triggered. The getCartsItems API runs pricing on the cart after adjustments are applied. Skipping this call significantly improves API performance. To execute pricing after applyAdjustments, you can either call getCartLineItemPrices (available under the actions node in the response) or invoke getCartsItems separately. ## Remote Method ```nolang applyAdjustment ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | -------------------------------------------------------------------------- | | Resource URL | `/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/items/{ID}/pricing` | ## Example Request ```nolang POST /services/apexrest/vlocity_cmt/v2/cpq/carts/{cartId}/items/{itemId}/pricing { "adjustments": [ { "DetailType": "ADJUSTMENT", "Field": "vlocity_cmt__OneTimeCharge__c", "PricingVariableCode": "OT_STD_PRC", "AdjustmentType": "Adjustment", "AdjustmentMethod": "Percent", "AdjustmentValue": -50 } ], "skipCartRefresh": true } ``` ## Example Result ```nolang { "totalSize": 1, "messages": [], "records": [ { "messages": [], "actions": { "addtocart": { "rest": { "params": { "items": [ { "quantity": 1, "parentId": "80246000000hhNzAAI", "itemId": "01u46000001Z8aCAAS" } ], "cartId": "80146000000h5jmAAA", "price": true, "validate": true, "includeAttachment": false, "pagesize": 20, "lastRecordId": null, "query": null }, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items" }, "remote": { "params": { "methodName": "postCartsItems", "items": [ { "quantity": 1, "parentId": "80246000000hhNzAAI", "itemId": "01u46000001Z8aCAAS" } ], "cartId": "80146000000h5jmAAA", "price": true, "validate": true, "includeAttachment": false, "pagesize": 20, "lastRecordId": null, "query": null } }, "client": { "params": {} } }, "updateitems": { "rest": { "params": { "items": [ { "itemId": "80246000000hhNzAAI" } ], "filters": null, "fields": null, "cartId": "80146000000h5jmAAA", "price": true, "validate": true, "includeAttachment": false, "pagesize": 20, "lastRecordId": null, "query": null }, "method": "PUT", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items" }, "remote": { "params": { "methodName": "putCartsItems", "items": [ { "itemId": "80246000000hhNzAAI" } ], "filters": null, "fields": null, "cartId": "80146000000h5jmAAA", "price": true, "validate": true, "includeAttachment": false, "pagesize": 20, "lastRecordId": null, "query": null } }, "client": { "params": {} } }, "deleteitem": { "rest": { "params": {}, "method": "DELETE", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhNzAAI?pagesize=20&includeAttachment=false&validate=true&price=true&cartId=80146000000h5jmAAA&id=80246000000hhNzAAI" }, "remote": { "params": { "methodName": "deleteCartsItems", "id": "80246000000hhNzAAI", "filters": null, "fields": null, "cartId": "80146000000h5jmAAA", "price": true, "validate": true, "includeAttachment": false, "pagesize": 20, "lastRecordId": null, "query": null } }, "client": { "params": {} } }, "cloneitem": { "rest": { "params": { "items": [ { "itemId": "80246000000hhNzAAI" } ], "id": "80246000000hhNzAAI", "cartId": "80146000000h5jmAAA" }, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/clone" }, "remote": { "params": { "methodName": "cloneItems", "items": [ { "itemId": "80246000000hhNzAAI" } ], "id": "80246000000hhNzAAI", "cartId": "80146000000h5jmAAA" } }, "client": { "params": {} } }, ``` **note:** An entire result can be thousands of lines long. This example has been truncated. ## API Troubleshooting Use the table in this topic to diagnose problems that occur when executing the the API. | Error Message | Description | | -------------------------------------------- | --------------------------------------------------------------------------------------- | | A virtual price cannot be adjusted. | This error message is displayed if you try to adjust a base price of a virtual product. | | Cannot apply adjustment without base charge. | This error message is displayed:
    |
  • If you try to adjust the base price of a product that hasn't been initialized. For example, If you haven't assigned a Recurring Charge Price List Entry to a product, and you try to apply an adjustment to the RecurringCharge, the API returns the error message.
  • If you try to adjust a calculated price, the API returns the error message. Calculated prices are derived from other base prices. For example, the UnitPrice of a product is calculated based on the base price of the product and the quantity of the product.If you want to adjust base prices that haven't been initialized, you can set the `CheckVariableBasePrice` CPQ Custom Setting to `False`. This setting allows you to make adjustments to the base prices, but it can lead to unexpected results.
| **note:** Adjustments can be made without a PriceListEntryID. # Apply Adjustment Apply an adjustment (such as a discount, markup, or override) to a price for a cart and line item, which are specified by the cartId and id parameters. ```nolang POST /v2/cpq/carts/{cart_ID}/items/{ID}/pricing ``` The caller can add the new `skipCartRefresh` parameter to the applyAdjustments API call. If `skipCartRefresh` is set to True, the `getCartsItems` API will not be triggered. If it is omitted or set to False, getCartsItems will be triggered. The getCartsItems API runs pricing on the cart after adjustments are applied. Skipping this call significantly improves API performance. To execute pricing after applyAdjustments, you can either call getCartLineItemPrices (available under the actions node in the response) or invoke getCartsItems separately. ## Remote Method ```nolang applyAdjustment ``` ## Example Request ```nolang POST /services/apexrest/vlocity_cmt/v2/cpq/carts/{cartId}/items/{itemId}/pricing { "adjustments": [ { "DetailType": "ADJUSTMENT", "Field": "vlocity_cmt__OneTimeCharge__c", "PricingVariableCode": "OT_STD_PRC", "AdjustmentType": "Adjustment", "AdjustmentMethod": "Percent", "AdjustmentValue": -50 } ], "skipCartRefresh": true } ``` ## Example Result ```nolang { "totalSize": 1, "messages": [], "records": [ { "messages": [], "actions": { "addtocart": { "rest": { "params": { "items": [ { "quantity": 1, "parentId": "80246000000hhNzAAI", "itemId": "01u46000001Z8aCAAS" } ], "cartId": "80146000000h5jmAAA", "price": true, "validate": true, "includeAttachment": false, "pagesize": 20, "lastRecordId": null, "query": null }, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items" }, "remote": { "params": { "methodName": "postCartsItems", "items": [ { "quantity": 1, "parentId": "80246000000hhNzAAI", "itemId": "01u46000001Z8aCAAS" } ], "cartId": "80146000000h5jmAAA", "price": true, "validate": true, "includeAttachment": false, "pagesize": 20, "lastRecordId": null, "query": null } }, "client": { "params": {} } }, "updateitems": { "rest": { "params": { "items": [ { "itemId": "80246000000hhNzAAI" } ], "filters": null, "fields": null, "cartId": "80146000000h5jmAAA", "price": true, "validate": true, "includeAttachment": false, "pagesize": 20, "lastRecordId": null, "query": null }, "method": "PUT", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items" }, "remote": { "params": { "methodName": "putCartsItems", "items": [ { "itemId": "80246000000hhNzAAI" } ], "filters": null, "fields": null, "cartId": "80146000000h5jmAAA", "price": true, "validate": true, "includeAttachment": false, "pagesize": 20, "lastRecordId": null, "query": null } }, "client": { "params": {} } }, "deleteitem": { "rest": { "params": {}, "method": "DELETE", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhNzAAI?pagesize=20&includeAttachment=false&validate=true&price=true&cartId=80146000000h5jmAAA&id=80246000000hhNzAAI" }, "remote": { "params": { "methodName": "deleteCartsItems", "id": "80246000000hhNzAAI", "filters": null, "fields": null, "cartId": "80146000000h5jmAAA", "price": true, "validate": true, "includeAttachment": false, "pagesize": 20, "lastRecordId": null, "query": null } }, "client": { "params": {} } }, "cloneitem": { "rest": { "params": { "items": [ { "itemId": "80246000000hhNzAAI" } ], "id": "80246000000hhNzAAI", "cartId": "80146000000h5jmAAA" }, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/clone" }, "remote": { "params": { "methodName": "cloneItems", "items": [ { "itemId": "80246000000hhNzAAI" } ], "id": "80246000000hhNzAAI", "cartId": "80146000000h5jmAAA" } }, "client": { "params": {} } }, ``` **note:** An entire result can be thousands of lines long. This example has been truncated. ## API Troubleshooting Use the table in this topic to diagnose problems that occur when executing the the API. | Error Message | Description | | -------------------------------------------- | --------------------------------------------------------------------------------------- | | A virtual price cannot be adjusted. | This error message is displayed if you try to adjust a base price of a virtual product. | | Cannot apply adjustment without base charge. | This error message is displayed:
    |
  • If you try to adjust the base price of a product that hasn't been initialized. For example, If you haven't assigned a Recurring Charge Price List Entry to a product, and you try to apply an adjustment to the RecurringCharge, the API returns the error message.
  • If you try to adjust a calculated price, the API returns the error message. Calculated prices are derived from other base prices. For example, the UnitPrice of a product is calculated based on the base price of the product and the quantity of the product.If you want to adjust base prices that haven't been initialized, you can set the `CheckVariableBasePrice` CPQ Custom Setting to `False`. This setting allows you to make adjustments to the base prices, but it can lead to unexpected results.
| **note:** Adjustments can be made without a PriceListEntryID. # Apply Template Applies an existing Sales Configuration Template to a target Quote or Order by cloning the template cart’s line items. ## Resource Information - **Resource URL:** `/services/apexrest//v1/cpq/templates/{templateId}/apply/{cartId}` - **HTTP Method:** POST - **Content-Type:** application/json - **Response Format:** JSON ## URL Parameters | Parameter | Type | Required | Description | | ---------- | ------ | -------- | ----------------------------------------------------------- | | templateId | String | Yes | The SalesConfigTemplate\_\_c record ID. | | cartId | String | Yes | The target Quote or Order ID to receive the template items. | ## Request Body | Parameter | Type | Required | Description | | ---------- | ------- | -------- | ------------------------------------------------------------------------------ | | asyncMode | Boolean | No | Set to true to run the clone operation asynchronously. Default: false. | | pricing | Boolean | No | Set to true to execute pricing after applying the template. Default: false. | | validation | Boolean | No | Set to true to execute validation after applying the template. Default: false. | ## Example REST Request `POST /services/apexrest/vlocity_cmt/v1/cpq/templates/a1Bxx0000004XyzDEF/apply/0Q0xx0000009AbcGHI` ``` { "asyncMode": false, "pricing": true, "validation": true } ``` ## Example REST Response Success Response (200): Sync Mode ``` { "success": true, "errorCode": "INVOKE-200", "error": "OK", "result": { "messages": [], "records": [ { "cartId": "0Q0xx0000009AbcGHI", } ] } } ``` Success Response (200): Async Mode ``` { "success": true, "errorCode": "INVOKE-200", "error": "OK", "result": { "messages": [], "records": [ { "cartId": "0Q0xx0000009AbcGHI", "jobId":"7071T00000ABCDEFGH" } ] } } ``` # Apply Template Applies an existing Sales Configuration Template to a target Quote or Order by cloning the template cart’s line items. ## Resource Information - **Resource URL:** `/services/apexrest//v1/cpq/templates/{templateId}/apply/{cartId}` - **HTTP Method:** POST - **Content-Type:** application/json - **Response Format:** JSON ## URL Parameters | Parameter | Type | Required | Description | | ---------- | ------ | -------- | ----------------------------------------------------------- | | templateId | String | Yes | The SalesConfigTemplate\_\_c record ID. | | cartId | String | Yes | The target Quote or Order ID to receive the template items. | ## Request Body | Parameter | Type | Required | Description | | ---------- | ------- | -------- | ------------------------------------------------------------------------------ | | asyncMode | Boolean | No | Set to true to run the clone operation asynchronously. Default: false. | | pricing | Boolean | No | Set to true to execute pricing after applying the template. Default: false. | | validation | Boolean | No | Set to true to execute validation after applying the template. Default: false. | ## Example REST Request `POST /services/apexrest/vlocity_cmt/v1/cpq/templates/a1Bxx0000004XyzDEF/apply/0Q0xx0000009AbcGHI` ``` { "asyncMode": false, "pricing": true, "validation": true } ``` ## Example REST Response Success Response (200): Sync Mode ``` { "success": true, "errorCode": "INVOKE-200", "error": "OK", "result": { "messages": [], "records": [ { "cartId": "0Q0xx0000009AbcGHI", } ] } } ``` Success Response (200): Async Mode ``` { "success": true, "errorCode": "INVOKE-200", "error": "OK", "result": { "messages": [], "records": [ { "cartId": "0Q0xx0000009AbcGHI", "jobId":"7071T00000ABCDEFGH" } ] } } ``` # applyToGroup Method Starts the Apply to Group batch job for a group. ## Class ## Input Parameters

Parameter

Required

Description

ApplyToGroupIPName

Required

Name of Integration Procedure to execute for each members.

BatchSize

Optional: Default to 10

Batch Size is the chunk size for batch job.

applyToGroupFailed

Optional

Failed records.

cartType

Optional: Default to Quote

Quote or Order.

contextId

Required

Master quote or order ID.

groupCartId

Required

Group cart ID.

groupId

Required

Group ID.

hasPostProcess

Optional: Default to false

If true, it executes qualification rules after the apply-to-group job completes.

parentId

Required

Opportunity ID.

retrycount

Optional

The number of times of retry of failed members because of a ROW LOCK ERROR.

Max retry count is 5 by default. But you can change it by setting the CPQ Configuration custom settings.

MS.ATG.MaxRetry = 5

startJobVIPName

Optional

Name of the integration procedure, used for the queued apply-to-group job.

## Output Parameters | Parameter | Description | | ------------ | --------------------------------------------------------------------------------- | | isJobStarted | True or false: True if the apply to group job started. False if it's not started. | ## Example Input Data ``` {"ApplyToGroupIPName":"MultiService_ApplyToGroup","BatchSize":25,"applyToGroupFailed":"","cartType":"Quote","contextId":"0Q05g000000x5etCAA","groupCartId":"0Q05g000000x5f3CAA","groupId":"a3W5g000000LNyxEAG","groupIds":[],"hasPostProcess":"false","parentId":"0065g000006Lh4mAAC","retrycount":"","startJobVIPName":"MultiService_StartApplyToGroup"} ``` ## Example Output Data ``` {"isJobStarted":true,"errorCode":"INVOKE-200","error":"OK"} ``` # Asset To Basket The Asset to Basket API converts the asset to a basket on which basket operations can be performed. This API is only for logged-in users. The API accepts the list of root Items IDs in the input and gets the assets bundle to convert to a basket. The API has a similar cache hit when the basket with the same context key has been cached. A cache miss occurs when the basket and order configurations are not found in the cache. There is also a mode of a partial cache hit when the basket with a superset key (containing all promotions and adjustments that are valid based on requested date-time) is present in the cache. However, some of the adjustments and promotional items must be trimmed from the request date time. This partial hit mode operates in memory. Therefore, the flow does not need to go through the full v2 FDO mode, thereby greatly reducing the processing time. With versioning enabled, the assets and promotional products or associated adjustments can be versioned. During the key computation, the system takes into account the shape of the assets, including promotions, adjustments, and asset line items. The shapes for whom assets were created could be the same but the product versions may differ, thereby creating the same bundle shape for assets that could be incorrect. During the asset shape computation, the system considers the time slice of the root assets as well. The time-sliced dates for the asset root products at the time they were converted to assets are included in the context key computation. In case of a cache miss scenario, while doing v2 FDO implementation, the reference dates and request date-time are passed to the FDO implementation, pricing, validation, and response generator services. The basket is still cached with the default cache policy because the version date-times are included on the context key itself. The basket operations on the assetized baskets still include the reference time as the time when the asset to basket was done (cache hit). The corresponding cardinality validation service takes that cached version information into consideration. The reference date information is cached in the basket wrapper and any operation done on the assetized basket includes the version information in its key computation. ![Asset to Basket API](https://developer.salesforce.com/docs/media/dc_assettobasket_api.png) # Associated Objects This section describes the objects associated with the standard objects in Advanced Orders for Telesales. - [StandardObjectNameChangeEvent](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/associated-objects/change-event.md): A ChangeEvent object is available for each object that supports Change Data Capture. - [StandardObjectNameFeed](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/associated-objects/feed.md): StandardObjectNameFeed is the model for all feed objects associated with standard objects. - [StandardObjectNameHistory](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/associated-objects/history.md): StandardObjectNameHistory is the model for all history objects associated with standard objects. - [StandardObjectNameOwnerSharingRule](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/associated-objects/owner-sharing-rule.md): StandardObjectNameOwnerSharingRule is the model for all owner sharing rule objects associated with standard objects. - [StandardObjectNameShare](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/associated-objects/share.md): StandardObjectNameShare is the model for all share objects associated with standard objects. # Associated Objects This section describes the objects associated with the standard objects in Penny Perfect Pricing. - [StandardObjectNameChangeEvent](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/penny-perfect-pricing-objects/associated-objects/change-event.md): A ChangeEvent object is available for each object that supports Change Data Capture. - [StandardObjectNameFeed](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/penny-perfect-pricing-objects/associated-objects/feed.md): StandardObjectNameFeed is the model for all feed objects associated with standard objects. - [StandardObjectNameHistory](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/penny-perfect-pricing-objects/associated-objects/history.md): StandardObjectNameHistory is the model for all history objects associated with standard objects. - [StandardObjectNameOwnerSharingRule](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/penny-perfect-pricing-objects/associated-objects/owner-sharing-rule.md): StandardObjectNameOwnerSharingRule is the model for all owner sharing rule objects associated with standard objects. - [StandardObjectNameShare](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/penny-perfect-pricing-objects/associated-objects/share.md): StandardObjectNameShare is the model for all share objects associated with standard objects. # AssociatedLocation Represents a physical or logical location (such as a store, warehouse, or distribution center) associated with a parent record — currently, an Account — over a defined active date range. Used to model which locations are tied to a given account for assortment, inventory, and order-management purposes. This object is available in API version 68.0 and later. ## Supported Calls `create()`, `delete()`, `describeLayout()`, `describeSObjects()`, `getDeleted()`, `getUpdated()`, `query()`, `retrieve()`, `search()`, `undelete()`, `update()`, `upsert()` ## Special Access Rules Available only in orgs with Manufacturing Cloud, Automotive Cloud, or Consumer Goods Cloud enabled, or with the relevant Account Hierarchy / B2B relationship features licensed. ## Fields ### ActiveFrom **Type:** dateTime **Properties:** Create, Filter, Nillable, Sort, Update **Description:** The start date and time from which this location association is active. ### ActiveTo **Type:** dateTime **Properties:** Create, Filter, Nillable, Sort, Update **Description:** The date and time at which this location association ends and is no longer active. ### AssociatedLocationNumber **Type:** string **Properties:** Autonumber, Defaulted on create, Filter, idLookup, Sort **Description:** An auto-generated, unique identifying number for the associated location record. ### CurrencyIsoCode **Type:** picklist **Properties:** Create, Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** ISO code for the currency of this record. Possible values are: AED (UAE Dirham), USD (U.S. Dollar), and every other active currency ISO code configured for the org. The default value is USD. Available only if multiple currencies are enabled for the org. ### LastReferencedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** The timestamp for when the current user last accessed a record related to this associated location. ### LastViewedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** The timestamp for when the current user last viewed this record. ### LocationId **Type:** reference **Properties:** Create, Filter, Group, Sort, Update **Description:** The ID of the Location record associated with the parent record. **Relationship Name:** Location **Refers To:** Location ### ParentRecordId **Type:** reference **Properties:** Create, Filter, Group, Sort **Description:** The ID of the parent record (currently Account) that this location is associated with. This field is a relationship field. It's the master in a master-detail relationship. **Relationship Name:** ParentRecord **Refers To:** Account ### Type **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** Categorizes the nature of the association between the parent record and the location. ## Associated Objects This object has the following associated objects. If the API version isn't specified, they're available in the same API versions as this object. Otherwise, they're available in the specified API version and later. - [AssociatedLocationChangeEvent](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/change-event.md): Change events are available for the object. - [AssociatedLocationFeed](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/feed.md): Feed tracking is available for the object. - [AssociatedLocationHistory](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/history.md): History is available for tracked fields of the object. - [AssociatedLocationOwnerSharingRule](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/owner-sharing-rule.md): Sharing rules are available for the object. - [AssociatedLocationShare](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/share.md): Sharing is available for the object. # Assortment Represents a defined collection or grouping of products — such as a customer selling assortment, authorization list, or planning assortment — used to control which products are available, orderable, or assigned to a given context (account, location, or catalog) over a specified date range. This object is available in API version 68.0 and later. ## Supported Calls `create()`, `delete()`, `describeLayout()`, `describeSObjects()`, `getDeleted()`, `getUpdated()`, `query()`, `retrieve()`, `search()`, `undelete()`, `update()`, `upsert()` ## Special Access Rules Available only in orgs with Consumer Goods Cloud or Retail Execution features enabled. ## Fields ### AssortmentSpecId **Type:** reference **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The ID of the AssortmentSpec record that defines the template/specification this assortment was generated from. **Relationship Name:** AssortmentSpec **Refers To:** AssortmentSpec ### CurrencyIsoCode **Type:** picklist **Properties:** Create, Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** ISO code for the currency of this record. Possible values are: AED (UAE Dirham), USD (U.S. Dollar), and every other active currency ISO code configured for the org. The default value is USD. ### Description **Type:** textarea **Properties:** Create, Filter, Nillable, Sort, Update **Description:** A free-text description of the purpose or contents of this assortment. ### EndDate **Type:** date **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The date on which this assortment stops being active. ### IsClosedAssortment **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether the assortment is closed (true), meaning only the explicitly listed products are allowed, versus open. The default value is false. ### LastReferencedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** The timestamp for when the current user last accessed a record related to this assortment. ### LastViewedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** The timestamp for when the current user last viewed this record. ### Name **Type:** string **Properties:** Create, Filter, Group, idLookup, Sort, Update **Description:** The name of the assortment. ### OwnerId **Type:** reference **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** The ID of the user or queue that owns this assortment record. **Relationship Name:** Owner **Refers To:** Group, User ### StartDate **Type:** date **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The date on which this assortment becomes active. ### Type **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The category of assortment. Possible values are AuthorizationList, CustomerSellingAssortment, LocationAuthorizationList, OrderSpecification, PlanningAssortment, and VisitSpecification. ## Associated Objects This object has the following associated objects. If the API version isn't specified, they're available in the same API versions as this object. Otherwise, they're available in the specified API version and later. - [AssortmentChangeEvent](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/change-event.md): Change events are available for the object. - [AssortmentFeed](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/feed.md): Feed tracking is available for the object. - [AssortmentHistory](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/history.md): History is available for tracked fields of the object. - [AssortmentOwnerSharingRule](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/owner-sharing-rule.md): Sharing rules are available for the object. - [AssortmentShare](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/share.md): Sharing is available for the object. # Assortment Error A single error, with an error code and message, such as a validation failure. ## JSON example ```json { "errorCode": "INVALID_API_INPUT", "errorMessage": "The customerAccountId is invalid." } ``` ## Properties | Property Name | Type | Description | Filter Group and Version | Available Version | | -------------- | ------ | ----------------------------------------------- | ------------------------ | ----------------- | | `errorCode` | String | The error code, for example, INVALID_API_INPUT. | Small, 68.0 | 68.0 | | `errorMessage` | String | The human-readable error message. | Small, 68.0 | 68.0 | # Assortment Input The input to get the assortments for a customer account and order specification. Assortment resolution always uses the current date. ## JSON example ```json { "customerAccountId": "001RM000004Wk8xYAC", "orderSpecId": "0OSRM00000004Cx2AAE" } ``` ## Properties | Name | Type | Description | Required or Optional | Available Version | | ------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------- | -------------------- | ----------------- | | `customerAccountId` | String | The ID of the customer account whose assortments are resolved. | Required | 68.0 | | `orderSpecId` | String | The ID of the order specification. Determines the assortment resolution strategy and the internal organization unit context. | Required | 68.0 | # Assortment Item A single assortment, with its ID, type, and associated products. ## JSON example ```json { "id": "0ASRM00000004Cx2AAE", "type": "AuthorizationList", "products": [{ "id": "01tRM000000P9UuYAK" }] } ``` ## Properties | Property Name | Type | Description | Filter Group and Version | Available Version | | ------------- | ---------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------ | ----------------- | | `id` | String | The ID of the assortment. | Small, 68.0 | 68.0 | | `products` | [Assortment Product](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/responses/assortment-product.md)[] | The list of products that belong to this assortment, filtered by order date validity. | Small, 68.0 | 68.0 | | `type` | String | The type of assortment, for example, AuthorizationList or LocationAuthorizationList. | Small, 68.0 | 68.0 | # Assortment Output The list of assortments, with their types and products, and the order product specification listing behavior. ## JSON example ```json { "assortments": [ { "id": "0ASRM00000004Cx2AAE", "type": "AuthorizationList", "products": [{ "id": "01tRM000000P9UuYAK" }] } ], "errors": [], "isSuccess": true, "orderProductSpecListingBehaviour": [ { "id": "0OSRM00000004Cx2AAE", "name": "Standard Order Spec", "listingBehaviour": "Open" } ] } ``` ## Properties | Property Name | Type | Description | Filter Group and Version | Available Version | | ---------------------------------- | ---------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | ------------------------ | ----------------- | | `assortments` | [Assortment Item](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/responses/assortment-item.md)[] | The list of assortments, each with an ID, type, and product IDs. | Small, 68.0 | 68.0 | | `errors` | [Assortment Error](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/responses/assortment-error.md)[] | The list of errors. This list is empty when the operation is successful. Each error has an error code and an error message. | Small, 68.0 | 68.0 | | `isSuccess` | Boolean | Indicates whether the operation was successful (true) or not (false). | Small, 68.0 | 68.0 | | `orderProductSpecListingBehaviour` | [Order Product Spec Listing Behaviour](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/responses/order-product-spec-listing-behaviour.md)[] | The list of order product specifications, each with an ID, name, and listing behavior (Open or Closed). | Small, 68.0 | 68.0 | # Assortment Product A single product that belongs to an assortment. ## JSON example ```json { "id": "01tRM000000P9UuYAK" } ``` ## Properties | Property Name | Type | Description | Filter Group and Version | Available Version | | ------------- | ------ | ----------------------------------------------------------------- | ------------------------ | ----------------- | | `id` | String | The ID of the product (Product2) that belongs to this assortment. | Small, 68.0 | 68.0 | # AssortmentProduct Represents a single product's membership within an Assortment, including product-specific attributes such as target facing, target price, default order quantity, and the active date range for that product within the assortment. This object is available in API version 68.0 and later. ## Supported Calls `create()`, `delete()`, `describeLayout()`, `describeSObjects()`, `getDeleted()`, `getUpdated()`, `query()`, `retrieve()`, `search()`, `undelete()`, `update()`, `upsert()` ## Special Access Rules Available only in orgs with Consumer Goods Cloud or Retail Execution features enabled. ## Fields ### AccountProductNumber **Type:** string **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** An account-specific identifying number or code for the product within this assortment. ### AssortmentId **Type:** reference **Properties:** Create, Filter, Group, Sort **Description:** The ID of the parent Assortment record this product belongs to. This field is a relationship field. It's the master in a master-detail relationship. **Relationship Name:** Assortment **Refers To:** Assortment ### CurrencyIsoCode **Type:** picklist **Properties:** Create, Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** ISO code for the currency of this record. Possible values are: AED (UAE Dirham), USD (U.S. Dollar), and every other active currency ISO code configured for the org. The default value is USD. ### DefaultOrderQuantity **Type:** int **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The default quantity of this product to use when it's added to an order from this assortment. ### EndDate **Type:** date **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The date on which this product stops being part of the assortment. ### IsFavorite **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether this product is flagged as a favorite within the assortment. The default value is false. ### LastReferencedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** The timestamp for when the current user last accessed a record related to this assortment product. ### LastViewedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** The timestamp for when the current user last viewed this record. ### Name **Type:** string **Properties:** Autonumber, Defaulted on create, Filter, idLookup, Sort **Description:** An auto-generated name for the assortment product record. ### PriorityProductType **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** Categorizes the priority or role of this product within the assortment (for example, a must-stock or featured item). ### ProductId **Type:** reference **Properties:** Create, Filter, Group, Sort, Update **Description:** The ID of the Product2 record included in the assortment. This field is a relationship field. **Relationship Name:** Product **Refers To:** Product2 ### StartDate **Type:** date **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The date on which this product becomes part of the assortment. ### TargetFacing **Type:** int **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The target number of facings (shelf positions) for this product at a location. ### TargetPrice **Type:** double **Properties:** Create, Filter, Nillable, Sort, Update **Description:** The target selling price for this product within the assortment. ## Associated Objects This object has the following associated objects. If the API version isn't specified, they're available in the same API versions as this object. Otherwise, they're available in the specified API version and later. - [AssortmentProductChangeEvent](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/change-event.md): Change events are available for the object. - [AssortmentProductFeed](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/feed.md): Feed tracking is available for the object. - [AssortmentProductHistory](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/history.md): History is available for tracked fields of the object. - [AssortmentProductOwnerSharingRule](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/owner-sharing-rule.md): Sharing rules are available for the object. - [AssortmentProductShare](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/share.md): Sharing is available for the object. # Assortments (POST) Returns the list of assortments (authorized product lists) that a customer account is entitled to for a given order specification. ## Resource ``` /connect/macz/assortments ``` ## Resource example ``` https://yourInstance.salesforce.com/services/data/v68.0/connect/macz/assortments ``` ## Available version 68.0 ## HTTP methods POST ## Request body for POST See [Assortment Input](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/requests/advanced-order-assortment-input.md). ```json { "customerAccountId": "001RM000004Wk8xYAC", "orderSpecId": "0OSRM00000004Cx2AAE" } ``` | Name | Type | Description | Required or Optional | Available Version | | ------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------- | -------------------- | ----------------- | | `customerAccountId` | String | The ID of the customer account whose assortments are resolved. | Required | 68.0 | | `orderSpecId` | String | The ID of the order specification. Determines the assortment resolution strategy and the internal organization unit context. | Required | 68.0 | ## Response body for POST See [Assortment Output](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/responses/assortment-output.md). # AssortmentSpec Defines a reusable template or specification for generating Assortment records — including the assortment type, usage type, and account-assignment rule — used by assortment planning and generation processes. This object is available in API version 68.0 and later. ## Supported Calls `create()`, `delete()`, `describeLayout()`, `describeSObjects()`, `getDeleted()`, `getUpdated()`, `query()`, `retrieve()`, `search()`, `undelete()`, `update()`, `upsert()` ## Special Access Rules Available only in orgs with Consumer Goods Cloud or Retail Execution features enabled. ## Fields ### AccountAssignment **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** Specifies how many accounts must be assigned when this specification is used. Possible values are ExactlyOne, No, OneOrMore, and ZeroOrMore. ### AssortmentType **Type:** picklist **Properties:** Create, Filter, Group, Restricted picklist, Sort, Update **Description:** The category of assortment this specification generates. Possible values are AuthorizationList, CustomerSellingAssortment, LocationAuthorizationList, OrderSpecification, PlanningAssortment, and VisitSpecification. ### CurrencyIsoCode **Type:** picklist **Properties:** Create, Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** ISO code for the currency of this record. Possible values are: AED (UAE Dirham), USD (U.S. Dollar), and every other active currency ISO code configured for the org. The default value is USD. ### Description **Type:** textarea **Properties:** Create, Filter, Nillable, Sort, Update **Description:** A free-text description of the purpose of this assortment specification. ### InternalOrganizationUnitId **Type:** reference **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The ID of the InternalOrganizationUnit record this specification applies to. This field is a relationship field. **Relationship Name:** InternalOrganizationUnit **Refers To:** InternalOrganizationUnit ### IsActive **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether this specification is currently active and available for use. The default value is false. ### LastReferencedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** The timestamp for when the current user last accessed a record related to this specification. ### LastViewedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** The timestamp for when the current user last viewed this record. ### Name **Type:** string **Properties:** Create, Filter, Group, idLookup, Sort, Update **Description:** The name of the assortment specification. ### OwnerId **Type:** reference **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** The ID of the user or queue that owns this specification record. This field is a polymorphic relationship field. **Relationship Name:** Owner **Refers To:** Group, User ### UsageType **Type:** picklist **Properties:** Create, Defaulted on create, Filter, Group, Restricted picklist, Sort, Update **Description:** Categorizes the usage context of this specification. The only possible value is Retail. The default value is Retail. ## Associated Objects This object has the following associated objects. If the API version isn't specified, they're available in the same API versions as this object. Otherwise, they're available in the specified API version and later. - [AssortmentSpecChangeEvent](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/change-event.md): Change events are available for the object. - [AssortmentSpecFeed](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/feed.md): Feed tracking is available for the object. - [AssortmentSpecHistory](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/history.md): History is available for tracked fields of the object. - [AssortmentSpecOwnerSharingRule](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/owner-sharing-rule.md): Sharing rules are available for the object. - [AssortmentSpecShare](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/share.md): Sharing is available for the object. # Attribute Basket Cache Exclusion To increase performance and reduce overhead, you can specify whether product attributes are excluded from the API cache. When defining product and pricing metadata, product administrators have a goal of maximizing the effectiveness of the application caching infrastructure. To achieve this, a product administrator typically identifies and excludes those attributes that do not affect pricing or configuration validity, because these attributes do not define the minimum unique set of API cache entries. The Attribute Basket Cache exclusion feature provides Product Administrators this ability by selectively excluding basket cache attributes from the context that defines API call uniqueness. The Attribute Basket Cache exclusion feature reduces the number of possible basket combinations to achieve a minimum set of unique and useful entries. As a result, there is increased likelihood of cache hits and the elimination of additional cache entries that are effectively redundant. To determine whether a product attribute is excluded from the cache, observe whether **Exclude From Basket Cache** is checked in the attribute's General Properties. **note:** The Attribute Basket Cache exclusion feature may be used with caching either on the Salesforce platform or on the Digital Commerce Gateway. The operation of the feature is subtly different between configurations. Please review the information below within the context of your deployment choice. Prior to the Fall '20 release, executing the Basket API, all attribute values (whether updated or not) were saved to a basket and returned in the response. In contrast, beginning with the Fall '20 release, attributes that are defined as “Excluded” will be ignored in the API request from the standpoint of pricing or configuration. The best practice for application developers is to not populate the excluded attributes in the request. This will reduce the potential for inappropriate re-use of data in the API response. API Responses: The behavior of the API response is different depending upon the cache deployment configuration selected. *On Platform Cache:*  In this configuration, when a cache hit occurs, the API response will reflect the specific response that triggered the creation of the cache record. The response might include excluded attribute data if it was provided in the initial request. In this situation, all excluded attributes in any API response should be disregarded. Observing the best practice of not providing any excluded attributes in any request alleviates this potential issue. *Digital Commerce Gateway Cache:* In this configuration, when a cache hit occurs, the API response will include the “excluded attribute" data mirrored from the current request. Again, the best practice is not to provide excluded data in the request. In either configuration, any excluded attributes provided will not be saved to the basket. Management of "Excluded Attribute" data for UI Application Use: If your implementation requires the UI to display previously entered updated values for “excluded attributes” then note the following: _On Platform Cache_: Store the requested updated values outside of the request and then append the values as part of the response. _Digital Commerce Gateway Cache_: The best practice is to store the requested updated values outside of the request and then append the values as part of the response. While it is possible to consume the provided excluded attributes from the API response, be aware that this will increase message size and excluded attributes will not be saved in the basket cache, nor will they trigger the pricing or validation calculations. ## Example The following scenario illustrates an example of how attribute exclusion works and the subtle differences between on- and off-platform usage. Consider a scenario in which an on-platform user initiates a PostConfigure or Basket API call. Suppose a user wishes to purchase a mobile phone, which has three attributes: color, capacity, and IMEI (international mobile equipment identity). During the product definition phase, the mobile phone was configured using the Enterprise Product Console (EPC) with the color and capacity attributes identified as cacheable, while IMEI was set to non-cacheable. Generally, IMEA is not associated with the device until the mobile phone is provisioned, and is left blank during order capture. Now suppose a user adds the mobile phone to the basket and configures all three attributes. A cache miss occurs because the attribute values are not contained in the cache. Here is a step-by-step workflow through the example: - User 1 initiates a PostConfigure or Basket API call wanting to purchase a mobile phone that has three attributes: - Product: Mobile Phone - Attribute 1: Color (Identified as cacheable) - Attribute 2: Capacity (Identified as cacheable) - Attribute 3: IMEI (Identified as non-cacheable) - An API call is made specifying updates to attributes 1, 2, and 3 as shown here: - Update Attribute 1: "Black" - Update Attribute 2: "64GB" - Update Attribute 3: "111111111111111" - The result is a cache miss because none of the attributes exist in the cache response object for the request. After the update, the attribute values are as follows: - Attribute 1: "Black" - Attribute 2: "64GB" - Attribute 3: "111111111111111" Now consider a second nearly identical API call but this time two of the three attributes are now contained in the cache because of the previous call. Note that in this case attribute 3 is not changed from "111111111111111" to "123456789123456" because "111111111111111" was contained in the cache. - User 2: Initiates PostConfigure or Basket API with the following: - Product: Mobile Phone - Attribute 1 (cacheable) - Attribute 2 (cacheable) - Attribute 3 (non-cacheable) - Request - Update attribute 1: "Black" - Update attribute 2: "64GB" - Update attribute 3: "123456789123456" - The result is a cache hit because attribute 1, "Black" and "64GB" exist in the cache. The value for attribute 3 remains the same because the value was stored in the cache from the previous API call. - Update attribute 1: "Black" - Update attribute 2: "64GB" - Update attribute 3: "111111111111111" - Note that the response does not change with the updated value. Now consider the same scenario as before but run on off-platform. The results are nearly but not quite identical. As before, a user initiates a PostConfigure or Basket API call with one product that has three attributes. Attribute 1 and 2 have been configured as cacheable while attribute 3 is not cacheable: - User 1 initiates a PostConfigure or Basket API call with the following: - Product: Mobile Phone - Attribute 1 (cacheable) - Attribute 2 (cacheable) - Attribute 3 (non-cacheable) - An API call is made specifying updates to all three attributes: - Update attribute 1: "Black" - Update attribute 2: "64GB" - Update attribute 3: "111111111111111" - The result is a cache miss because attribute 1, "Black" and attribute 2 "64GB" do not exist in the cache response object for the first request. - Update attribute 1: "Black" - Update attribute 2: "64GB" - Update attribute 3: "111111111111111" As before, a second nearly identical API call is made but this time attributes 1 and 2 are now contained in the cache because of the previous API call. In this case, however, attribute 3 is updated with the second API call. - User 1 initiates a PostConfigure or Basket API call with the following: - Product: Mobile Phone - Attribute 1 (cacheable) - Attribute 2 (cacheable) - Attribute 3 (non-cacheable) - An API call is made specifying updates to attributes 1 and 2: - Update attribute 1: "Black" - Update attribute 2: "64GB" - Update attribute 3: "123456789123456" - The result is a cache miss because attribute 1, "Black" and attribute 2, "64GB" do not exist in the cache response object for the first request. However, attribute 3 is updated. - Update attribute 1: "Black" - Update attribute 2: "64GB" - Update attribute 2: "123456789123456" \<-- The responses _does_ change with the updated value. 1 In either configuration, excluded attributes are not saved to the basket. Therefore, best practice is to omit values for non-cacheable attributes during a basket operation; instead, append them after the Salesforce order record is created. # Basket APIs Digital Commerce Basket APIs provide functionality to add, update, and delete offers in the basket. The basket is a virtual cart created for an anonymous or logged-in user to add or update an offer listing before placing an actual order. Basket APIs provide flexibility to add a product, apply a promotion, update a product’s attributes, change a product’s quantity, add a child product in the hierarchy, create a basket from an asset, and make changes before submitting the order. Basket APIs are consistent with other APIs in having a caching mechanism to cache the basket configuration with a cache key. The cache key comprises the user’s shape and operational details so if another user with a similar context performs a similar operation, the basket APIs can leverage the response already computed, thereby creating a cache-hit and drastically reducing the turn-around time for the requests. Digital Commerce Basket APIs include: - [Add To Basket](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-add-to-basket.md) - [Add With No Configuration](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-add-with-no-configuration.md) - [Add After Configuration](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-add-after-configuration.md) - [Delete From Basket](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-delete-from-basket.md) # Basket Operations in Digital Commerce You use basket operations to add, subtract, or modify the contents of a basket. The POST REST endpoint provides the ability for a user to add offers to a virtual basket maintained by the user interface. The basket is tracked using the cartContextKey in the URL; for an empty basket, there is no need to pass the cartContextKey, which is returned as part of the response of a successful basket operation Offers may include both products and promotions. Offers can be added directly or after configuring them. The API returns a list of bundle structures in the basket. The list structure is compliant with pricing, overrides, rules, adjustments, attributes, and so on. The API uses cartContext to track existing basket contents and appropriate context parameters to price products and run rules. If the API result is present in the cache, that result is returned. If the result is not in the cache, it is treated as a cache-miss, and the result is stored in the cache for successive calls. The API also allows users to delete from an existing basket with the deleteBundleNumber parameter. # Basket Validation Basket validation ensures that certain conditions are met before performing an operation on a basket. The following basket items are checked: - The user is eligible for the offers contained in the basket. - The offers in the basket are effective. - The price list entries that were used to create the basket are still effective. Basket validation is enabled or disabled by passing the validatebasket query parameter. The default value is true. To turn off the basket validation, pass false as the value for the query parameter. The basket operations that supports basket validation are shown here: | Basket Operation | Description | | ------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------- | | Add offer to a basket | The effectivity and eligibility of the bundle offer is checked. If the offer is eligible and effective, the add-to-basket will proceed. | | Add new offer to an existing basket | The existing basket is validated. Only when the basket is valid, any add or update operations are allowed. | | Update an existing basket | The existing basket is validated. Only when the basket is valid, any add or update operations are allowed. | | Get basket details | The basket details are validated. Depending on the validation result, the response will be modified. | | Delete offer from an existing basket | The delete operation is performed first, and the validation is preformed on the remaining offers in the basket. | | Create cart using a basket | The basket is validated. Only if the validation is successful will cart creation be allowed. | The fields in the table below are checked when performing effectivity checking: | Attributes | Fields | | ---------------------- | ----------------------------------------------------------------------------------------------------------- | | For products | IsActive, IsOrderable, SellingStartDate, SellingEndDate, EndOfLifeDate | | For promotions | IsActive, IsOrderable, EffectiveFrom, EffectiveUntil | | For price list entries | IsActive, EffectiveFrom, EffectiveUntil, CalculatedEffectiveDate (based on applied TimePlan and TimePolicy) | **important:** Adding assets to the basket after the SellingEndDate is not supported due to implementation limitations. ## Example 1: Validation when adding a new offer to a basket When adding an offer (either a product or promotion) to the basket (either an empty basket or an existing valid basket), the eligibility and effectivity of the offer that is being added is checked. Only when the offer is eligible and effective will the basket be created. For invalid offers, depending on the reason, the different responses are shown below. Example: An ineligible offer is added for anonymous users. ```nolang Request URL /services/apexrest/dc_108/v3/catalogs/DTHCatalog/basket Request Body {"offer":"DTHOffer","basketAction":"AddWithNoConfig"} Condition The product, DTHOffer, has a rule applied. The rule is valid for Account SLA=Silver. The default value for rule dimension is Bronze. Response {"success":false,"result":{"BasketValidationResult":{"IneligibleOffers":["DTHOffer"]}},"errorCode":"422","error":"One or more offers are ineligible."} ``` Response: ![validation1](https://developer.salesforce.com/docs/media/validation_1.png) Example: An ineligible offer is added for logged-in users. ```nolang Request URL /services/apexrest/dc_108/v3/catalogs/DTHCatalog/basket?context={"accountId":"<>"}&isloggedin=true Request Body {"offer":"DTHOffer","basketAction":"AddWithNoConfig"} Condition The product, DTHOffer, has a rule applied. The is valid for Account SLA = Silver. The default value for rule dimension is Bronze Response {"success":false,"result":{"BasketValidationResult":{"IneligibleOffers":{"DTHOffer":"The SLA of Account should be SILVER"}}},"errorCode":"422","error":"One or more offers are ineligible."} ``` Response: ![Validation2](https://developer.salesforce.com/docs/media/validation_2.png) Example: The offer being added is not effective. ```nolang Request URL /services/apexrest/dc_108/v3/catalogs/DTHCatalog/basket Request Body {"offer":"SportsPack","basketAction":"AddWithNoConfig"} Condition The SellingEndDate of the offer SportsPack has expired Response {"success":false,"result":{"BasketValidationResult":{"InvalidOffers":{"SportsPack":["SellingEndDate"]}}},"errorCode":"422","error":"The offer being added to the basket is ineffective"} ``` Response ![Validation3](https://developer.salesforce.com/docs/media/validation_3.png) Example: The product being added to the basket does not have a valid price list entry. ```nolang Request URL /services/apexrest/dc_108/v3/catalogs/DTHCatalog/basket Request Body {"offer":"EntertainmentPack","basketAction":"AddWithNoConfig"} Condition There are no valid PLEs on the offer EntertainmentPack  Response {"success":false,"errorCode":"INVOKE-500","error":"No valid price list entry found for product EntertainmentPack"} ``` Response: ![Validation4](https://developer.salesforce.com/docs/media/validation_4.png) ## Example 2: Validation while running a basket operation on an invalid basket An existing basket might have one or more ineligible offers in it. This may be because the basket was created in an older version of the product (pre-Fall '20) or the basket was created with validatebasket query parameter set to false. For this example, assume that the basket was created with a bundle named DTHOffer, and DTHOffer is eligible only if the account SLA is Silver. Also, the default value of the SLA is Bronze. Below is the basket structure: Example: Validation while performing basket operation on an invalid basket having ineligible offer(s) ```nolang { "totalSize": 1, "records": [ { "displaySequence": -1, "Id": { "value": "8026g000003qmNjAAI", "previousValue": null, "originalValue": null, "messages": [], "label": "Order Product ID", "hidden": false, "fieldName": "Id", "editable": false, "dataType": "ID", "alternateValues": null, "actions": {} }, "Pricebook2Id": "01s6g000008qDnSAAU", "Product2Id": "01t6g000003yHyWAAU", "ProductCode": "DTHOffer", "UnitPrice": { "value": 0, "previousValue": null, "originalValue": null, "messages": [], "label": "Unit Price", "hidden": true, "fieldName": "UnitPrice", "editable": false, "dataType": "CURRENCY", "alternateValues": null, "actions": {} }, "Name": "DTHOffer", "IsActive": true, "dc_108__RecurringPrice__c": 25, "Product2": { "attributes": { "type": "Product2", "url": "/services/data/v49.0/sobjects/Product2/01t6g000003yHyWAAU" }, "Id": "01t6g000003yHyWAAU", "Name": "DTHOffer", "dc_108__IsConfigurable__c": false, "dc_108__GlobalGroupKey__c": "eeed75c1-d269-c274-796d-0babcbf4d6fb", "dc_108__Type__c": "None", "dc_108__SubType__c": "None", "RecordTypeId": "0126g000001MCLdAAO", "dc_108__JSONAttribute__c": null }, "CurrencyCode": "USD", "productId": "01t6g000003yHyWAAU", "defaultQuantity": 1, "minQuantity": 0, "maxQuantity": 99999, "groupMinQuantity": 0, "groupMaxQuantity": 99999, "sequenceNumber": 1, "productChildItemDefinition": { "attributes": { "type": "dc_108__ProductChildItem__c" }, *** and so on *** ``` For the above basket, a subsequent basket operation will return one of the following responses: - Anonymous user: ```nolang Operation Add Promotion to existing Basket Condition The basket was created by an anonymous user and the next basket operation is also being performed by an anonymous user. Request URL/services/apexrest/dc_108/v3/catalogs/DTHCatalog/basket/273ea5445b7b80ab40b566baab089e41 Request Body {"basketAction":"AddWithNoConfig","offer":"10%OffDTH"} Response { "success": false, "cartContextKey": "273ea5445b7b80ab40b566baab089e41", "result": { "BasketValidationResult": { "isBasketValid": false, "basketValidationMessage": "One or more offers are ineligible.", "IneligibleOffers": [ "DTHOffer" ] }, "totals": { "EffectiveOneTimeTotal__c": 200, "EffectiveRecurringTotal__c": 25 }, "records": [ { "actions": { "deleteFromBasketAction": { "rest": { "params": { "basketAction": "deleteFromBasket", "lineItemKey": "eb4ba8910c60a25ae4d4dda7a1b60c64", "bundleContextKey": "eb4ba8910c60a25ae4d4dda7a1b60c64" }, "link": "/v3/catalogs/DTHCatalog/basket/273ea5445b7b80ab40b566baab089e41?contextKey=9d6af941cb9c06b0a31d0e6be2dddf17", "method": "deleteFromBasketAction" } }, "updateBasketAction": { "rest": { "params": { "basketAction": "updateBasket", "lineItemKey": "eb4ba8910c60a25ae4d4dda7a1b60c64", "bundleContextKey": "eb4ba8910c60a25ae4d4dda7a1b60c64" }, "link": "/v3/catalogs/DTHCatalog/basket/273ea5445b7b80ab40b566baab089e41?contextKey=9d6af941cb9c06b0a31d0e6be2dddf17", "method": "updateBasketAction" } } }, (truncated for brevity) ``` Result: ![Validation5](https://developer.salesforce.com/docs/media/validation_5.png) - Logged-in user, case 1: ```nolang Operation Add Promotion to existing Basket Condition The basket was created by a logged in user with account id <> having SLA as Bronze and the next basket operation is also being performed by the same user without any change to the account shape. Request URL/services/apexrest/dc_108/v3/catalogs/DTHCatalog/basket/f4f58e16f583e8843ab5cc7c101b864e?context={"accountId":"AccountId1"}&isloggedin=true Request Body {"basketAction":"AddWithNoConfig","offer":"10%OffDTH"} ``` Result: ![Validation6](https://developer.salesforce.com/docs/media/validation_6.png) - Logged-in user, case 2 ```nolang Operation Add Promotion to existing Basket Conditions - the response will be similar for both the cases mentioned below Condition 1 - The basket was created by logged in user with account id <> having SLA as Bronze and the next basket operation is being performed by same user but the account SLA has changed to Silver Condition 2 - The basket was created by logged in user with account id <> having SLA as Bronze and the next basket operation is being performed by different user with account id <> with account SLA Silver Request URL/services/apexrest/dc_108/v3/catalogs/DTHCatalog/basket/f4f58e16f583e8843ab5cc7c101b864e?context={"accountId":"AccountId2"}&isloggedin=true Request Parameter {"basketAction":"AddWithNoConfig","offer":"10%OffDTH"} ``` Result: ![Validation7](https://developer.salesforce.com/docs/media/validation_7.png) ## Validation while performing a basket operation on an invalid basket having eligible but ineffective offer(s) After some time interval, the offers in the basket are eligible but,For offer SportsPack, - The SellingEndDate and EndOfLifeDate are ineffective. - The Effective Until Date of the OT PLE,50\$OTCharge, used, is now ineffective Once the basket is ineffective, further basket operations (except getBasket) return a response similar to the response shown below. Response ![](https://developer.salesforce.com/docs/media/validation_8.png) ## Understanding the response structure When an invalid basket is found during basket validation, the response will contain an extra node named BasketValidationResult. In the node, the details about why the basket is invalid are available. The InvalidOffers node contains: - InvalidPLEs - This node contains the details of all the ineffective price list entries for all of the invalid offers in the basket. - InvalidProducts - This node contains the details of the products that are invalid, with the name of the fields indicating which product is invalid. - InvalidPromotions - This node contains the details of the promotion(s) that are invalid, with the name of the fields indicating which the promotion is invalid. If basket validation fails, the errorCode in the response will be 422 with an appropriate error message. When a getBasket operation is performed, an extra nextAction node is available in the response. This node contains details about how to correct the basket. See the examples for more information. ## Basket validation limitations - For add-to-basket operations, validation is performed only when basketAction is set to AddWithNoConfig. - Price list entry validation is only for price list entries that were used to create the basket. If an offer has more than one price list entry but was not used, then the validation will not be performed for those price list entries. - Price list entry validation is performed only if the basket was created with active PricingInterface implementation as PricingPlanService. - Basket validation does not support the price list entry validation if the pricing is done using a custom implementation for PricingInterface; for example, if the prices were picked from a Matrix. - For price list entry validation, there must be an entry in the CachedAPIResponse\_\_c SObject of Type=pleOfferMap and cacheKey=\<\> must be available. If the basket was created using a version earlier than Fall '20, the pleOfferMap will not be available for that basket; therefore the PLE validation for that basket will be skipped. - Basket validation does not apply to the effectivity of the CatalogProductRelationship. - When adding a new offer to either an empty or existing basket, validation is performed only for the root offer; that is, only for the offer passed in the post body of the API call. Validations are not done for child products or auto-add relationship products. - Effectivity checking for new offers is supported starting in Fall '20f. If offer details were generated in an earlier version, the effectivity check for the offer being added to the basket will not occur. - The eligibility check for the offers in the basket is done only for the offers present in the catalog passed in the input. If there are offers from different catalogs, they will not be checked for eligibility. # Before You Begin To use Standard Digital Commerce, enable the required configuration settings. - Enable JSONAttribute V2 Schema. For more information, see [JSONAttribute v2 Schema Upgrade Considerations](https://help.salesforce.com/s/articleView?id=ind.comms_jsonattribute_v2_schema_upgrade_considerations.htm&type=5). - Enable CPQ Configuration settings: - UseAssetReferenceIdForParentAndRoot - CacheAPI.CreateCartFromContextKey - Upgrade to Winter '23. - Test the existing Digital Commerce APIs on your org. For more information, see [Digital Commerce (Cacheable) APIs](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-digital-commercecacheableapis.md). - Verify that the required picklist values for CachedAPIResponse**c.Type**c object are available in your org. - compiledPricingData - compiledOfferHierarchy - compiledAdvancedRule - compiledTemporaryData - cartDocument - compiledContextRule - compiledCalculationMatrix - compiledPromotionData - compiledJobInfo # Before You Begin The following provides a high-level overview of the sequence of operations to perform when using the standard cart APIs. - [Enable GUIDs for Industries CPQ](https://help.salesforce.com/s/articleView?id=ind.comms_enable_guids.htm&type=5) - [Check Feature Compatibility](https://developer.salesforce.com/docs/industries/cme/guide/review-the-considerations.md) - [Known Limitations](https://developer.salesforce.com/docs/industries/cme/guide/standard-cart-known-limitations.md) - [Enable JSONAttribute V2 Schema](https://developer.salesforce.com/docs/industries/cme/guide/enable-json-attributev2-schema.md) - [Enable the Standard Cart APIs](https://developer.salesforce.com/docs/industries/cme/guide/enable-standard-cart-apis.md) - [Execute the Administration Tasks](https://developer.salesforce.com/docs/industries/cme/guide/execute-administration-tasks.md) **note:** When `UseAssetReferenceIdForParentAndRoot` is set to true, it improves performance by reducing DML statements in Add-to-Cart and other transactions. See [CPQ Configuration Settings Reference](https://help.salesforce.com/s/articleView?id=ind.comms_t_cpq_configuration_settings_reference_148927.htm&type=5). # Browse Operations in Digital Commerce You use the browse APIs to retrieve information about products in your catalog. Browse operations consist mostly of GET API calls that you use to find featured offers, offer details, list featured offers and so on. # Bundle Wrapper API The Bundle Wrapper API takes the catalog code and offerId and populates the bundle wrapper in the cache, which consists of the in-memory order line item objects used during basket operations. You must execute this API for each product offerId that you received in the response from the Catalog Profile API. You can obtain the offerId required in the URI of this API from the result of the apiResponse.data.catalogProductRelationDetails.Product node in the response body of the [Catalog Profile API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-catalog-profile-api.md). ## Precondition You must first run the [Catalog Profile API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-catalog-profile-api.md) to obtain the offerId required in the request body of this API. ## URI /services/apexrest/{namespace}/v3/admin/catalogs/{catalogCode}/offers/{offerId}/bundlewrapper ## HTTP Method POST No parameters need to be passed in the POST body. ## URI Parameters If you specify just one of these two parameters, it follows the behavior described in the table below and accepts your defined time for the parameter you specified. If you are using one or both parameters, you must specify them with the same values for all of the Populate Cache APIs in this sequence. | Parameter | Example | Default | Optional/Required | Notes | | ------------------ | ------------------- | ------------------------------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | effectiveStartTime | 2001-07-04T12:08:56 | Current date and time | Optional | effectiveStartTime is the time that you want your cached catalog entries to be effective. It should be in the UTC date-time format. Your effectiveStartTime must occur after the current time for which you are executing the Populate Cache APIs or you will receive an error message. | | expirationTime | 2001-07-04T12:08:56 | effectiveStartTime + TimeToLive | Optional | expirationTime is the time that you want your cached catalog entries to expire. It should also be in the UTC date-time format. Your expirationTime must occur after your effectiveStartTime or you receive an error message. TimeToLive is a custom setting created in CPQ Configuration Setup. It has a default value of 30 days. | Here is an example of how to pass the URI parameters: ```nolang GET /services/apexrest/vlocity_cmt/v3/admin/catalogs/AS-Test-Catalog/bundlewrapper?effectiveStartTime=2021-07-04T12:08:56&expirationTime=2021-08-04T12:08:56 ``` ## Remote API This is an example of how you invoke the API using Apex: ```nolang String methodName; Map input = new Map(); Map output = new Map(); Map options = new Map(); // Setting remote parameters methodName = 'getOfferDetailsToBundle'; String body = '{}' ; input.put('apiName', 'CMBundleWrapper'); // required input.put('methodName', methodName); // required input.put('catalogCode', 'mobiles'); // required input.put('offers', '01t4W00000BgaKvQAJ'); // required input.put('effectiveStartTime', null); // optional input.put('expirationTime', null); // optional input.put('requestBody',body); input.put('requestURL', '/v3/admin/catalogs/mobiles/offers/01t4W00000BgaKvQAJ/bundlewrapper'); // required //remote action invocation vlocity_cmt.CpqAppHandler appHandler = new vlocity_cmt.CpqAppHandler(); appHandler.invokeMethod(methodName, input, output, options); ``` ## Parallel Invocation You can run this API in parallel for multiple offers. For example, if there are 10 catalogs (Catalog1, Catalog2..Catalog 10) and each catalog has 100 offers, you can run this API for all 1,000 offers in parallel threads. ```nolang THREAD1 - GET /services/apexrest/{namespace}/v3/admin/catalogs/catalog1/offers/offer1/bundlewrapper THREAD2 - GET /services/apexrest/{namespace}/v3/admin/catalogs/catalog1/offers/offer2/bundlewrapper ...... THREAD10 - GET /services/apexrest/{namespace}/v3/admin/catalogs/catalog1/offers/offer10/bundlewrapper THREAD11 - GET /services/apexrest/{namespace}/v3/admin/catalogs/catalog2/offers/offer11/bundlewrapper ...... THREAD1000 - GET /services/apexrest/{namespace}/v3/admin/catalogs/catalog10/offers/offer/bundlewrapper ``` ## HTTP Headers | Header | Description | | ------------ | ---------------- | | Content-Type | application/json | ## Response Body This example shows the catalog code, offer Id, and other details. ``` { "cacheKey": "7d61d12269ad083e59e84a80a7c846aa", "apiResponse": { "assetRefIdToItemIdMap": {}, "bundleContextKey": null, "idToXLIMap": { "8024W00000BMysKQAT": { "Id": "8024W00000BMysKQAT", "vlocity_cmt__AssetReferenceId__c": "3cc84430-b88e-4d5f-aebf-a058bdaf0324", "vlocity_cmt__CurrencyPaymentMode__c": "currency", "vlocity_cmt__Action__c": "Add", "vlocity_cmt__ProvisioningStatus__c": "New", "UnitPrice": 0, "OrderId": "8014W00000468jiQAA", "Product2Id": "01t4W00000BgaKvQAJ", "vlocity_cmt__Product2Id__c": "01t4W00000BgaKvQAJ", "vlocity_cmt__LineNumber__c": "0001", "vlocity_cmt__ProductHierarchyPath__c": "01t4W00000BgaKvQAJ", "PricebookEntryId": "01u4W00000A0GdgQAF", "Quantity": 1, "attributes": { "url": "/services/data/v51.0/sobjects/OrderItem/8024W00000BMysKQAT", "type": "OrderItem" } } }, "lineItemskeyMap": {}, "lineItemType": "OrderItem", "lineKeyToAttributeShapeMap": null, "lineKeyToBundleShapeMap": null, "lineKeyToPromoShapeMap": null, "parentLineKeyToChildLinekeys": null, "promoCodeToItemIds": {}, "rootItemId": null, "rootLineKey": null, "xliIdToAppliedPromotionItemsMap": {}, "xliIdToPriceAdjustmentsMap": {} }, "catalogCode": "mobiles", "errorCode": "INVOKE-200", "error": "OK" } ``` ## HTTP Response Codes | Code | Description | | ---- | --------------------- | | 200 | OK | | 500 | Internal Server Error | # Business APIs Use the Advanced Order Business APIs to browse assortments and products, get a customer's previously ordered products and valid delivery dates, and place orders in a single request. Each resource supports the POST method. You can access the Advanced Order Business APIs using REST endpoints. These REST APIs follow similar conventions as Connect REST APIs. To understand the architecture, authentication, rate limits, and how the requests and responses work, see the [Connect REST API Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/intro_what_is_chatter_connect.htm). The Advanced Order Business APIs include: - [Resources](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-rest/resources.md)—The Advanced Order resources and the endpoints they support. - [Request Bodies](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-rest/request-bodies.md)—The request body representations that the resources accept. - [Response Bodies](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-rest/response-bodies.md)—The response body representations that the resources return. # Business APIs Use the Penny Perfect Pricing Business APIs to get instant, penny-perfect pricing for advanced order line items. You can access the Penny Perfect Pricing Business APIs using REST endpoints. These REST APIs follow similar conventions as Connect REST APIs. To understand the architecture, authentication, rate limits, and how the requests and responses work, see the [Connect REST API Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/intro_what_is_chatter_connect.htm). The Penny Perfect Pricing Business APIs include: - [Resources](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/penny-perfect-pricing-rest/resources.md)—The Penny Perfect Pricing resources and the endpoints they support. - [Request Bodies](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/penny-perfect-pricing-rest/request-bodies.md)—The request body representations that the resources accept. - [Response Bodies](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/penny-perfect-pricing-rest/response-bodies.md)—The response body representations that the resources return. Penny Perfect Pricing works with these APIs: - To get instant pricing for order line items, use the [Get Instant Price API](/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-rest/get-instant-price.html). - To calculate prices, see [Pricing (POST)](https://developer.salesforce.com/docs/atlas.en-us.revenue_lifecycle_management_dev_guide.meta/revenue_lifecycle_management_dev_guide/connect_resources_headless.htm). - To set up pricing data, insert External Pricing Key Value and External Pricing Key Value Tiers records with the standard [Bulk API](https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/asynch_api_intro.htm). - To place an order using the calculated prices, use the [Place Order API](/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-rest/place-order.html). - To flatten the account hierarchies of accounts under an internal organization unit, use the [Flatten Account Internal Organization Unit Hierarchy API](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/penny-perfect-pricing-rest/resources/flatten-account-iou-hierarchy.md). # Cache Initialization Batch Jobs Cache initialization batch jobs run on the cached catalog product relationship and make use of the productIds and promotion Ids. They also generate the cache data for the offer information, its eligibility for a given context, its pricing information, its hierarchy and promotional products linked to that promotion, some computed data such as bundles, promotional wrappers, and some metadata information to use by both GET and POST APIs. ![Cache initialization batch jobs](https://developer.salesforce.com/docs/media/dc_batch_cache_processor.png) Products can have different versions according to the version start and end dates, so there is a detailed offers listing that considers the versions of the products and the time frame for which that version is effective. Therefore, a batch job computes and caches that information. That information is worked upon by the cache initializing batch jobs and APIs to generate the relevant caches. ## Version Info Generator Batch The Version Info Generator batch job caches the catalog products, promotions, and promotional item IDs that are used by all other Digital Commerce APIs and batch jobs as a snapshot of the offers listed under a catalog at any given time. ![Version Info Generator Batch](https://developer.salesforce.com/docs/media/dc_version_info_generator_batch.png) With versioning enabled, the productId and promotional item IDs can be different over time, so this batch job gets the information about the product versions and promotional item versions falling in between the selected cache effective start and end dates. Using that information, this batch job divides the entire time frame into multiple time slices. For each time slice, there is only one version of any offer. The time slices are disjointed sets of time frames having a start and end time where no two offer versions under a catalog overlap. At any given time, there is only have one version of an offer. ![Version Info Generator Batch - Time Slices](https://developer.salesforce.com/docs/media/dc_offerversiontimeline.png) In the above example, there are three products. The cache effective start time is March 1st and end time is March 31st. These are represented in the form of a timeline: - Product 1 has three versions: Version 1 ( - 3rd March), Version 2 (3rd March - 7th March), Version 3 (7th March - 31st March). - Product 2 has two versions: Version 1 (3rd March - 15th March), Version 2 (15th March - ). - Product 3 has three versions: Version 1, ( - 1st March), Version 2 (1st March - 15th March), Version 3 (15th March - 31st March). To compute the time slices, the batch job takes each offer version falling in between the selected cache dates. Using the global group key of the product associated with the catalog by catalog product relationship, the batch job gets all the product versions where the corresponding version start date starts on or after the selected cache start date or version end date ends on or before the selected cache end date. In the above example, the versions Product 1 Version 1, Product 1 Version 3, Product 2 Version 1, Product 2 Version 2, Product 3 Version 2, and Product 3 Version 3 are considered. Product 3 Version1 is not considered because its version end date occurs before the cache start date. The boundary of the cache entries are the selected cache start time and cache expiration time. The time slices are computed by taking the relevant product versions into consideration. In the above example, there are four-time slices generated between the selected date. - Time slice 1 (TS1) : 1st March - 3rd March - Time slice 2 (TS2) : 3rd March - 7th March - Time slice 3 (TS3) : 7th March - 15th March - Time slice 4 (TS4) : 15th March - 31st March ![Version Info Generator Batch - Time Slices](https://developer.salesforce.com/docs/media/dc_timesliceversions.png) For each time slice, there is a unique version of each product and no two product version dates intersect in any time slice. In the above example, for each time slice, product versions are as follows: - Time slice 1 (TS1): 1st March - 3rd March: Product 1 Version 1, Product 3 Version 2. - Time slice 2 (TS2): 3rd March - 7th March: Product 1 Version 2, Product 2 Version 1, Product 3 Version 2. - Time slice 3 (TS3): 7th March - 15th March: Product 1 Version 3, Product 2 Version 1, Product 3 Version 2. - Time slice 4 (TS4): 15th March - 31st March: Product 1 Version 3, Product 2 Version 2, Product 3 Version 3. The processed information is then cached and the effectivity of the cache is according to time slice effectivity date. These time slices and the product version information in each time slice are cached and used by the subsequent batches and run-time APIs. Other than the catalog product and promotions in the given time frame, there is more metadata information computed and cached by this batch job. The information cached by the Version Info Generator batch job is: - timesliceList: This type of cache holds information about the time slices for a catalog between given cache start and end dates. The cache key is formed with the hash of catalogCode and cache effective start and expiration time. ```nolang [ { "timesliceKey": "Key1", "VersionStartDateTime": "2021-03-01T08:00:00.000+0000", "VersionEndDateTime": "2021-03-03T08:00:00.000+0000" }, { "timesliceKey": "Key2", "VersionStartDateTime": "2021-03-03T08:00:00.000+0000", "VersionEndDateTime": "2021-03-07T08:00:00.000+0000" }, { "timesliceKey": "Key3", "VersionStartDateTime": "2021-03-07T08:00:00.000+0000", "VersionEndDateTime": "2021-03-15T08:00:00.000+0000" }, { "timesliceKey": "Key4", "VersionStartDateTime": "2021-03-15T08:00:00.000+0000", "VersionEndDateTime": "2021-03-31T08:00:00.000+0000" } ] ``` - timeSliceInfo: This type of cache contains information about the offer versions that were effective between the time slice dates and is populated for each time slice. This is the snapshot of the catalog products, promotions, and promotion items. ```nolang [ { "productId": "P1V1Id", "globalGroupKey": "fad333e1-7876-5a0e-11b7-7c693f2aaf32", "versionStartDate": "2021-03-01T08:00:00.000+0000", "versionEndDate": "2021-03-03T08:00:00.000+0000" }, { "productId": "P3V2Id", "globalGroupKey": "59c6236a-bc7c-89b4-e32e-aaeb8992e450", "versionStartDate": "2021-03-01T08:00:00.000+0000", "versionEndDate": "2021-03-15T14:31:00.000+0000" } ] ``` - versionInfoList: This cache contains the superset list of all the versions of products, promotions, and promotionItems for the selected catalog that occur between the selected cache start and expiration dates. This cache acts as a master list for the batch jobs that need the list of all the offerId versions associated with the catalog directly (as the catalog product relationship and promotional items) or indirectly (another version of the product queried using the global group key of the associated product). ```nolang { "versionGroupKeys": [ "CKProdut1GK1", "CKProdut2GK1", "CKProdut3GK1", "CKPromotion1", "CKPromotion2" ], "products": [ "P1V1Id", "P1V2Id", "P1V3Id", "P2V2Id", "P2V3Id", "P3V1Id", "P3V2Id", "P3V3Id" ], "promotions": { "Promo1Id": [ "P1V1Id", "P2V2Id", "P2V3Id" ] } } ``` - versionInfo: This cache contains information about all the versions of an offer that were effective between the selected cache dates. ```nolang [{ "productId": "P1V1Id", "globalGroupKey": "fad333e1-7876-5a0e-11b7-7c693f2aaf32", "versionStartDate": "2021-03-01T08:00:00.000+0000", "versionEndDate": "2021-03-03T08:00:00.000+0000" }, { "productId": "P1V2Id", "globalGroupKey": "fad333e1-7876-5a0e-11b7-7c693f2aaf32", "versionStartDate": "2021-03-03T08:00:00.000+0000", "versionEndDate": "2021-03-07T14:31:00.000+0000" }, { "productId": "P1V3Id", "globalGroupKey": "fad333e1-7876-5a0e-11b7-7c693f2aaf32", "versionStartDate": "2021-03-07T08:00:00.000+0000", "versionEndDate": "2021-03-31T14:31:00.000+0000" }] ``` # Cache Management Most anonymous visitors on a commerce website spend most of their browsing experience viewing products that capture their interest. Consequently, as users make their way down the commerce funnel towards purchasing the product, we organically create the cache based on the request made to our Industries CPQ engine. As time goes by, we have a robust set of cached records within our cached response object. What is cache management? When Digital Commerce API calls are made, the API response cache is checked before processing the request. The handling of API requests and cache creation is cache management. Cache management covers the Awareness, Interest, Desire, and Decision phases of a customer journey as depicted in the illustration. ![Each customer action corresponds to a cache management API. Viewing products is the Get Offers API. Viewing product details is the Get Offer Details API. Configuring a product is the Configure API. Intent to purchase is the Basket Action API. Purchasing is the Create Order API.](https://developer.salesforce.com/docs/media/dc_cm_ecommfunnel.png) This graphic illustrates an example use-case: anonymous browsing at the top of the funnel and new user checkout near the bottom of the funnel. Other industry examples can have differing percentages. For example, a media industry Pay Per View event could indicate more than 90% of visitors viewing your product landing page through complete purchase with 0% traffic intending to purchase, due to the nature of the Pay Per View user experience. You can also customize and optimize the relevant Cache Management jobs by leveraging Cache Management APIs. But before we look at the Cache Management APIs, let's better understand the concept of cache management. ## Cache Misses vs Cache Hits A cache miss is when an application makes an API request, but the requested response is not in the cache and needs to be processed. A cache hit is when the request is found and retrieved from the cache response object. For example, you are making a Digital Commerce API call to retrieve a list of offers for a sales catalog named Tablets. The API response cache is checked to see if there is a match for the request. If there is a match, then it is a cache hit, and it quickly returns the cached tablets offer list. If there is no match, a cache miss occurs and the Industries CPQ engine processes it before returning the appropriate tablets offer list and adding it to the cache to help reduce cache misses. In terms of the Digital Commerce APIs, specific data not found in the cache could be related to basket configurations, uncached eligibility contexts, or logged-in user contexts. Digital Commerce is designed to reduce cache misses during the Browse, Configure, and Cart phases of the user journey, but cache misses are an inevitable occurrence. ## Organic vs Inorganic Cache Creation *Organic cache creation* is the generation of cache responses during a real-time request. Organic cache creation is triggered during a cache miss scenario. Digital Commerce organically creates the cache for all Basket operations and the GetOffers and GetOfferDetails requests for logged-in user contexts. *Inorganic cache creation* is the generation of cache responses as executed by the cacheable API jobs. It increases cache hit scenarios and reduces cache misses to improve performance. Digital Commerce allows you to inorganically create the cache for GetOffers and GetOfferDetails for anonymous users by running the Populate Cache API jobs. For both organic and inorganic cache creation, the number of generated cached permutations is determined by variations in the product catalog and the cached values specified as part of context dimensions. ## Administering the Cache There are currently two ways to manage your cached responses. The first is by executing the [Populate Cache Job](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-populate-cache-job.md). This job concentrates on addressing the top of the commerce funnel journey. Specifically, the top of the funnel is to support anonymous browsing of the commercial product catalog and viewing the product details. As users make their way down the commerce funnel towards purchasing the product, you organically create the cached based on the request made to the CPQ Engine. As time goes by, you end up with a robust set of cached records within your cached response object. However, when a product administrator makes changes to an existing product catalog, for example modifying an associated attribute or price, we then update the existing cache that corresponds to the change. This brings us to the second way to manage the cache, which is by executing the [Regenerate Cache Job](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-regenerate-cache-job.md). This job concentrates on making updates to the existing cache based on changes made to the product catalog. The Cache Management APIs are intended to work with your continuous integration/continuous development implementation. # Cache Management sObjects The cache management mechanism listens to the following sObjects. - Attribute Assignment(AttributeAssignment\_\_c) - Catalog (Catalog\_\_c) - Catalog Product Relationship (CatalogProductRelationship\_\_c) - Price List Entry (PriceListEntry\_\_c) - Product (Product2) - Product Child Item (ProductChildItem\_\_c) - Product Configuration Procedure (ProductConfigurationProcedure\_\_c) - Product Relationship (ProductRelationship\_\_c) - Promotion (Promotion\_\_c) - Promotion Item (PromotionItem\_\_c) - Vlocity Calculation Matrix Row (CalculationMatrixRow\_\_c) - Vlocity Context Dimension (ContextDimension\_\_c) - Vlocity Entity Filter Condition (EntityFilterCondition\_\_c) - Vlocity Entity Filter (EntityFilter\_\_c) - Vlocity Rule Assignment (RuleAssignment\_\_c) - Vlocity Rule (Rule\_\_c) - Vlocity Attachment(VlocityAttachment\_\_c) # Cache Metadata While the cache is being populated in cached API response objects, the system caches metadata information about those cache entries. That information is then used by the regenerate batch job to get the affected cache entries and generate or regenerate the cache data. As a prerequisite to caching metadata, the corresponding trigger setting should be enabled. With versioning, different versions of the same product use the same offer code where a change in the sObjects can affect: - One version of the cache if it’s a fixed reference. - All versions of the cache if it’s a floating reference. - Some versions of the cache if it’s a hybrid reference. Caching the metadata in the cached API response offers objects involves a mechanism to: - Link the cache entry with its version: If there are any changes in EPC for the released products that affect only one particular version of the cache entries, then linking the cache entry with its version performs a delta regeneration of the cache entries for that particular offer version. This includes an OfferId column to account for the unique ID of a particular product version. - Link the cache entry with the time slice(s) to which it belongs: If there is any change in the qualifying context rule or rule associations affecting the eligibility of the product, then the catalog level entries (Context eligibility result items, Offers List, etc.) need to be regenerated to include or exclude that product. Having information about the time slices to which offers belong means performing a delta regeneration of only those time slices catalog level entries. This information can be derived from using the VersionInfo list and TimeSliceInfo types of data cached by the version info generator batch ![Link the cache entry with the time slice(s) to which it belongs](https://developer.salesforce.com/docs/media/dc_cachemetadata.png) # Cache Regenerate Batches Cache regenerate batches are responsible for generating and regenerating the cache data. If there are new offer listings for a catalog and no earlier cache is present for that offer, the batches operate in the generate mode. In Generate mode, the batch jobs generate the cache data for that offer and its listing for that catalog. If there are changes for any offer or the catalog for which the cache data has already been populated, then the system does a correction of the cache data and reflects the changes in the cache. The batch job runs in the regenerate mode, where it regenerates the cache entries. If an offer is deleted or has been made inactive and not orderable, then the corresponding cache data is made inactive by limiting the expiration time of the cache. Cache regeneration batch jobs also operate on the Future Dated Cache Mode, where changes are reflected from a future date and time selected by the user. In this mode, the effectivity of the currently affected cache entry is limited by making the expiration time equal to the effective date-time selected by the user. The next instance of the cache is effective from the selected date time. There are four steps for regenerating the responses: 1. Derive Aggregate Entity Batch ![Cache Regenerate Batches - Derive Aggregate Entity Batch](https://developer.salesforce.com/docs/media/dc_dae_batch.png) 2. Invalidate / Set Current Cache Validity ![Derive Aggregate Entity Batch - Invalidate or Set Current Cache Validity](https://developer.salesforce.com/docs/media/dc_invalidate_batch.png) 3. Catalog Level Batch ![Cache Regenerate Batches - Catalog Level Batch](https://developer.salesforce.com/docs/media/dc_cataloglevel_batch.png) 4. Offer Level Batch ![Cache Regenerate Batches - Offer Level Batch](https://developer.salesforce.com/docs/media/dc_offerlevel_batch.png) # Cache Regenerate Scope The cache management triggers track the changes to the list of sObjects. Cache regeneration batches operate on those changes, which are populated in the cached API change table. The system tracks the Create, Update, Delete operations performed on those SObjects. Below are the SObjects for Product Model alteration as a result of a new/updated/deleted: - Fixed Reference - New/updated Top Offer (Products) - Child Offer (Products) - Child Offer (Promotions)(child product of a promotional product) - Price List Entry - Price Adjustment - Product Context Qualification Rule - Promotion Context Qualification Rule - Pricing Context Qualification Rule - Product Attachments - Product Attributes - Product Structure - Rule assignments - Floating Reference - Pricing Matrix executed by Pricing Plan via Calculation Procedure - Product Relationship - Product Configuration Procedure - Vlocity (Sales) Product Catalog Product Relationship - Hybrid Reference - Price Override - No versioning - New/updated Top Offer (Promotions). However, the promotional items are part of Hybrid Reference. - Vlocity (Sales) Product Catalog # Cache Regeneration Cache Regeneration is a mechanism to refresh the cache, both on and off the Salesforce platform. Therefore, Vlocity Product Model changes include the ability to reverberate against existing or non-existing cache response, on Salesforce Platform and AWS, as a result of executing either the Digital Commerce APIs or running the Cache jobs. This includes the ability to reflect Vlocity Product Model revisions. The following data can be modified for released products: - Version start date - Version end date - Product Name - Description - Version label - Product Code - Orderable flag - Active flag - Status fields Digital Commerce cache regeneration includes: - [Cache Metadata](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-cache-metadata.md) - [Register Changes](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-register-changes.md) - [Cache Regenerate Scope](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-cache-regenerate-scope.md) - [Cache Regenerate Batches](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-cache-regenerate-batches.md) - [Derive Aggregate Entities](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-derive-aggregate-entities.md) - [Invalidate/Set Current Cache Validity](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-invalidate-set-current-cache-validity.md) - [Regenerate Catalog-Level Cache Data](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-regenerate-catalog-level-cache-data.md) - [Regenerate Offer Level Cache Data](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-regenerate-offer-level-cache-data.md) # Cancel Cart Items In a supplemental order, this API provides the ability to cancel a line item. When you cancel a line item, you are cancelling the change that is represented by that line item. This lists includes several examples: - When the action for the line item action is Add, then the user’s intent in the original order was to add a new asset to the account. Cancelling that action in a supplemental order means the new asset is not added. - When the action for the line item action is Change, the user’s intent in the original order was to make changes to an asset through the MACD Asset-based Order Item record. Cancelling that action in a supplemental order implies the user did not want to make the change. So, the asset configuration does not change. - When the action for the line item action is Disconnect, the user’s intent in the original order was to disconnect the asset. Cancelling that action in a supplemental order implies the user no longer wants to disconnect the asset, so, the asset is not disconnected through the supplemental order. - When the action for the line item action is Existing, the user’s intent in the original order was to make changes to a related line item that was pulled in from the Account. Cancelling that action in a supplemental order means you are not making any changes to that particular line item. ## REST Not available. There is no REST endpoint for this API. ## How to Invoke this API To invoke this API, use the following APEX method: ```nolang /** * This method can be used to create a followOn order. * Inputs: * orderId - Id. The original order's Id. **/ public static void createFollowOnOrder(Id orderId) { final String methodName = 'cancelCartItems'; Map inputMap = new Map { 'cartId' => orderId, 'itemIds' => new List { 'rootItemId' }, 'methodName' => methodName }; Map outputMap = new Map(); Map optionsMap = new Map(); vlocity_cmt.CpqAppHandler handler = new vlocity_cmt.CpqAppHandler(); handler.invokeMethod(methodName, inputMap, outputMap, optionsMap); // traverse the result that was returned, to find the followOn order id. vlocity_cmt.JSONResult result = (vlocity_cmt.JSONResult) outputMap.get('result'); } ``` ## Example 1 - Create an Amend Order CPQ uses this flow to create an Amend order. ![](https://developer.salesforce.com/docs/media/cartapi_amendorder.png) ## Example 2 - Create a Cancel Order CPQ uses this flow to create a Cancel order. ![](https://developer.salesforce.com/docs/media/cartapi_cancelorder.png) ## Example 3 - Discard a Supplemental Order To discard the supplemental order, set the supplemental order’s `OrderStatus__c = Discarded`. # Cancel Order Cancel an order. Calling this API creates a supplemental order and submits it to Order Management (XOM). After XOM processes the supplemental order, the original order is updated to canceled status. ```nolang POST /v2/cpq/carts/{cart_ID}/cancel ``` The Cancel Order API uses the Supplemental and Cancel Order interface implementations that predate the CME Winter '20 release, including SupplementalOrderService and XOMSupplementalOrderLifeCycle. See [In-Flight Order Cancellation](https://help.salesforce.com/s/articleView?id=ind.comms_in_flight_order_cancellation.htm) (or the instructions for your pre-CME Winter '20 release). This API does not use [Order Management Integration Layer](https://help.salesforce.com/s/articleView?id=ind.comms_order_management_integration_in_industries_cpq.htm) features. 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 ```nolang cancelCart ``` ## REST Handler ```nolang APICancelCartsCPQV2 ``` ## Apex Remote Service ```nolang CpqAppHandler ``` ## Apex Remote Input Map ```nolang {"methodName":"cancelCart", "cartId":"80146000000iwCx"} ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | -------------------------------------------------------------- | | Resource URL | `/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/cancel` | ## Example Request ```nolang POST /services/apexrest/v2/cpq/carts/{cart_ID}/cancel {} ``` ## Example Request Body ```nolang { "totalSize": 1, "messages": [ { "code": "305", "severity": "INFO", "message": "Your order has been cancelled." } ], "records": [ { "displaySequence": -1, "vlocity_cmt__OrderStatus__c": "Cancelled", "vlocity_cmt__IsChangesAllowed__c": false } ] } ``` # Cart APIs Industries Configure, Price, Quote Web APIs (CPQ APIs) enable client application users to shop for and order products and services. The CPQ APIs provide a layer of abstraction between the client app developers and the CPQ developers who are configuring and customizing the underlying CPQ logic. # Cart Wrapper and CartItem Wrapper for Custom Pricing Plan Cart wrapper and CartItemWrapper interface provides minimum viable functionalities to operate on cart and cart items. Use these interfaces to add your own custom steps in the pricing plan steps. CartItemWrapper Interface: ![CartItemWrapper Interface](https://developer.salesforce.com/docs/media/cartwraaper_dc.png) 1. To work with the Cart Wrapper interface: 1. Get the cart wrapper instance for CpqCart or CpqCartDocument using the method: **note:** Do not use the same instance of CpqCartDocument for every pricing step. For each step, get the instance using the method mentioned below. ``` **For CpqCart CartWrapper wrapper = (CartWrapper)PricingPlanService.getFromPricingContext('Parent'); ** For CpqCartDocument CartWrapper wrapper = (CartWrapper)input.get('cartDocument'); ``` 2. Call the Item wrapper APIs using the wrapper.call(methodName, args). The Below table lists the supported methods for CpqCart:Item | Method Name | Arguments | Description | | ----------------------------- | -------------------------------------------------------- | ----------------------------------------------------- | | CpqConstants.GET_CART_FIELD | CpqConstants.FIELD | Method to get the fields of the order. | | CpqConstants.SET_CART_FIELD | CpqConstants.FIELD, CpqConstants.VALUE | Method to set the order field value. | | CpqConstants.GET_SOBJECT_TYPE |   | Method to get the SObjectType of the underlying cart. | | CpqConstants.GET_ITEM_IDS |   | Method to get the item ids. | | CpqConstants.GET_ALL_ITEMS | CpqConstants.HIERARCHY_LEVEL(optional: -1 full hierachy) | Method to get all the line items. | | CpqConstants.GET_CHILD_ITEMS | CpqConstants.ITEM_ID | Method to get all the child line items. | | CpqConstants.DELETE_LINE_ITEM | CpqConstants.ITEM_ID | Method to delete a line item. | 2. To work with the the CartItem Wrapper interface: 1. The line items present in the basket can be accessed using the wrapper class of CpqCartDocumentItem or CpqCartItem. Get the cart wrapper instance for CpqCart or CpqCartDocument using the method: ``` **For CpqCartItem Map result = wrapper.call('getAllItems', null); Map allItems = (Map) result.get(CpqConstants.RESULT); ** For CpqCartDocumentItem Map result = wrapper.call('getAllItems', null); Map allItems = (Map) result.get(CpqConstants.RESULT); ``` 2. Call the wrapper APIs using the wrapper.call(methodName, args). the below table lists the supported methods for CpqCart: | Method Name | Arguments | Description | | -------------------------------- | ---------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | | CpqConstants.GET_ITEM_FIELD | CpqConstants.FIELD | Method to get an item field, or a field from the item's related SObjects. | | CpqConstants.SET_ITEM_FIELD | CpqConstants.FIELD, CpqConstants.VALUE | Method to set the value of an item field. | | CpqConstants.GET_SOBJECT_TYPE |   | Method to get the SObjectType of the underlying cartitem. | | CpqConstants.GET_ITEM_FIELDS | CpqConstants.FIELDS | Method to get multiple item fields. | | CpqConstants.SET_ITEM_FIELDS | CpqConstants.FIELD_VALUE_MAP | Method to set multiple item fields. | | CpqConstants.GET_ITEM_ATTRIBUTES | CpqConstants.FLATTENED_ATTRIBUTE_VALUES), CpqConstants.USE_DISPLAY_TEXT_FOR_VALUES | Method to get the attribute node of the item. There are 2 parameters according to which the attribute nodes are returned. | | CpqConstants.SET_ITEM_ATTRIBUTES | CpqConstants.ATTRIBUTE_CODE_TO_VALUE_MAP | Method to set the item attributes. | | CpqConstants.GET_CHILD_ITEM_IDS |   | Method to get the child item ids. | **Sample Code** **note:** - The cart wrapper would internally call the V2 APIs for Digital Commerce or CPQ APIs. - The cart wrapper would call the V3 APIs for Standard Digital Commerce APIs. ``` // namespace.className managed package global inherited sharing class CustomPricingPlanImplementation implements VlocityOpenInterface { global boolean invokeMethod(String methodName, Map input, Map output, Map options) { if (methodName == 'testV2CustommPricingPlanImpl'){ testV2CustomPricingPlan(input, output, options); } if (methodName == 'testV3CustommPricingPlanImpl'){ testV3CustomPricingPlan(input, output, options); } return true; } private void testV2CustomPricingPlan(Map input, Map output, Map options) { Map args = new Map(); CartWrapper wrapper = (CartWrapper)PricingPlanService.getFromPricingContext('Parent'); Map result = wrapper.call('getAllItems', null); if(result.containsKey(CpqConstants.RESULT)){ Map allItems = (Map) result.get(CpqConstants.RESULT); for(Id itemId : allItems.keySet()) { CartItemWrapper itemWrapper = allItems.get(itemId); // args.put(CpqConstants.FIELD, 'vlocity_lwc8__ItemName__c'); // args.put(CpqConstants.VALUE, 'DummyName'); args.put(CpqConstants.FIELD, 'vlocity_lwc8__EffectiveRecurringTotal__c'); // args.put(CpqConstants.VALUE, 205); itemWrapper.call(CpqConstants.SET_ITEM_FIELD, args); } } } private void testV3CustomPricingPlan(Map input, Map output, Map options) { Map args = new Map(); CartWrapper wrapper = (CartWrapper)input.get('cartDocument'); Map result = wrapper.call('getAllItems', null); if(result.containsKey(CpqConstants.RESULT)){ Map allItems = (Map) result.get(CpqConstants.RESULT); for(String itemId : allItems.keySet()) { CartItemWrapper itemWrapper = allItems.get(itemId); // args.put(CpqConstants.FIELD, 'vlocity_lwc8__ItemName__c'); // args.put(CpqConstants.VALUE, 'DummyName'); args.put(CpqConstants.FIELD, 'vlocity_lwc8__EffectiveRecurringTotal__c'); // args.put(CpqConstants.VALUE, 205); itemWrapper.call(CpqConstants.SET_ITEM_FIELD, args); } } Map args1 = new Map(); args.put(CpqConstants.FIELD, 'vlocity_lwc8__EffectiveRecurringTotal__c'); args.put(CpqConstants.VALUE, 410); wrapper.call(CpqConstants.SET_CART_FIELD, args); } } ``` # Cart-Based APIs and Guest Users The following URIs and their corresponding Cart-Based REST APIs, remote actions, and CpqAppHandler calls allow guest users to create and update records. - /carts [Create Cart](https://developer.salesforce.com/docs/industries/cme/guide/comms-create-cart.md) `POST /carts` - /cpq/carts/\* - [Get Cart Summary](https://developer.salesforce.com/docs/industries/cme/guide/comms-get-cart-summary.md) `GET /cpq/carts/{encrypted_cart_ID}` - Update Cart Summary (see [Industries Configure, Price, Quote Web APIs v2 Documentation](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary)) `PUT /cpq/carts/{encrypted_cart_ID}` - /cpq/carts/\*/attributes [Get Filterable Attributes](https://developer.salesforce.com/docs/industries/cme/guide/comms-get-filterable-attributes.md) `GET /cpq/carts/{encrypted_cart_ID}/attributes` - /cpq/carts/\*/cancel - [Cancel Order](https://developer.salesforce.com/docs/industries/cme/guide/comms-cancel-order.md) `POST /cpq/carts/{encrypted_cart_ID}/cancel` - [Create Supplemental Order](https://developer.salesforce.com/docs/industries/cme/guide/comms-create-supplemental-order.md) `POST /cpq/carts/{encrypted_order_ID}/cancel` - Send Updates on Cancellations (see [Industries Configure, Price, Quote Web APIs v2 Documentation](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary)) `PUT /cpq/carts/{encrypted_cart_ID}/cancel` - [Submit a Cancel Order Request](https://developer.salesforce.com/docs/industries/cme/guide/comms-submit-a-cancel-order-request.md) `POST /v2/cpq/carts/{encrypted_order_ID}/cancel` - /cpq/carts/\*/items - [Add Items to Cart](https://developer.salesforce.com/docs/industries/cme/guide/comms-add-items-to-cart.md) `POST /cpq/carts/{encrypted_cart_ID}/items` - [Add to Cart](https://developer.salesforce.com/docs/industries/cme/guide/comms-add-to-cart.md) `POST /cpq/carts/{encrypted_cart_ID}/items` - [Get Cart Items](https://developer.salesforce.com/docs/industries/cme/guide/comms-get-cart-items.md) `GET /cpq/carts/{encrypted_cart_ID}/items` - [Get Line Items by ID](https://developer.salesforce.com/docs/industries/cme/guide/comms-get-line-items-by-id.md) `GET /cpq/carts/{encrypted_cart_ID}/items` - [Remove Items from Cart](https://developer.salesforce.com/docs/industries/cme/guide/comms-remove-items-from-cart.md) `DELETE /cpq/carts/{encrypted_cart_ID}/items` - [Update Items in Cart](https://developer.salesforce.com/docs/industries/cme/guide/comms-update-items-in-cart.md) `PUT /cpq/carts/{encrypted_cart_ID}/items` - /cpq/carts/\*/items/checkout - [Checkout Items in Cart](https://developer.salesforce.com/docs/industries/cme/guide/comms-checkout-items-in-cart.md) `POST /cpq/carts/{encrypted_cart_ID}/items/checkout` - [Check Status of the Cart](https://developer.salesforce.com/docs/industries/cme/guide/comms-check-status-of-the-cart.md) `GET /cpq/carts/{encrypted_cart_ID}/items/checkout` - /cpq/carts/_/items/_/itemattributes [Update Item Attributes](https://developer.salesforce.com/docs/industries/cme/guide/comms-update-item-attributes.md) `PUT /cpq/carts/{encrypted_cart_ID}/items/{itemId}/itemattributes` - /cpq/carts/_/items/_/pricing - [Apply Adjustment](https://developer.salesforce.com/docs/industries/cme/guide/comms-apply-adjustment.md) `POST /cpq/carts/{encrypted_cart_ID}/items/{itemId}/pricing` - Apply an Adjustment (Discount, Markup, or Override to a Price) see [Industries Configure, Price, Quote Web APIs v2 Documentation](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary) `PUT /cpq/carts/{encrypted_cart_ID}/items/{itemId}/pricing` - [Delete Adjustment](https://developer.salesforce.com/docs/industries/cme/guide/comms-delete-adjustment.md) `DELETE /cpq/carts/{encrypted_cart_ID}/items/{itemId}/pricing` - [Get Price Waterfall for Price](https://developer.salesforce.com/docs/industries/cme/guide/comms-get-price-waterfall-for-price.md) `GET /cpq/carts/{encrypted_cart_ID}/items/{itemId}/pricing` - /cpq/carts/\*/price - [Price Items in Cart (Query)](https://developer.salesforce.com/docs/industries/cme/guide/comms-price-items-in-cart__query-.md) `GET /cpq/carts/{encrypted_cart_ID}/price` - [Run Pricing for Items to Cart](https://developer.salesforce.com/docs/industries/cme/guide/comms-run-pricing-for-items-to-cart.md) `POST /cpq/carts/{encrypted_cart_ID}/price` - /cpq/carts/\*/pricelists [Get Price Lists for Cart](https://developer.salesforce.com/docs/industries/cme/guide/comms-get-price-lists-for-cart.md) `GET /cpq/carts/{encrypted_cart_ID}/pricelists` - /cpq/carts/\*/products - [Get Details of Product](https://developer.salesforce.com/docs/industries/cme/guide/comms-get-details-of-product.md) `GET /cpq/carts/{encrypted_cart_ID}/products/{pricebookEntryId}` - [Get List of Products](https://developer.salesforce.com/docs/industries/cme/guide/comms-get-list-of-products.md) `GET /cpq/carts/{encrypted_cart_ID}/products` - [Get Products by ID](https://developer.salesforce.com/docs/industries/cme/guide/comms-get-products-by-id.md) `GET /v2/cpq/carts/{encrypted_cart_ID}/products?{id}&includeAttachment=[true|false]` - /cpq/carts/\*/promotions - [Add Promotion to Cart](https://developer.salesforce.com/docs/industries/cme/guide/comms-add-promotion-to-cart.md) `POST /cpq/carts/{encrypted_cart_ID}/promotions` - [Delete Applied Promo Items](https://developer.salesforce.com/docs/industries/cme/guide/comms-delete-applied-promo-items.md) `DELETE /cpq/carts/{encrypted_cart_ID}/promotions` - [Get Applied or Available Promotions for Cart](https://developer.salesforce.com/docs/industries/cme/guide/comms-get-applied-or-available-promotions-for-cart.md) `GET /cpq/carts/{encrypted_cart_ID}/promotions` - [Get Cart Promotions](https://developer.salesforce.com/docs/industries/cme/guide/comms-get-cart-promotions.md) `GET /cpq/carts/{encrypted_cart_ID}/promotions` - [Post Cart Promotion Items](https://developer.salesforce.com/docs/industries/cme/guide/comms-post-cart-promotion-items.md) POST /cpq/carts/{encrypted_cart_ID}/promotions - /cpq/catalogs/\* [Get Catalog Information](https://developer.salesforce.com/docs/industries/cme/guide/comms-get-catalog-information.md) `GET /cpq/catalogs` # cartRollup Method Responsible for cart rollups. ## Class ## Input Parameters | Parameter | Required | Description | | ----------- | -------- | ----------------- | | cartId | Required | Quote or Order ID | | pricingPlan | Optional | Pricing plan code | ## Output Parameters | Parameter | Description | | ------------- | --------------------------------------------------------------- | | statusMessage | Status message | | pricingOutput | Map of error, error code, or errorResult (in case of any error) | | errorCode | Error code | | error | Error | ## Example Input Data ``` {"cartId":"801Hr000001t1s1IAA"} ``` ## Example Output Data ``` {"statusMessage":"Completed Successfully.","Failed":false,"pricingOutput":{"errorCode":"INVOKE-200","error":"OK"},"errorCode":"INVOKE-200","error":"OK"} ``` # Catalog Level Batch Jobs These types of batch jobs, for example, DataProfileBatch Job and ContextEligibilityBatch job, operate on the catalog level for the list of offers associated with the catalog. ## Data Profile Batch Job The data profile batch job caches the catalog profile, list of offers, and metadata information associated with that catalog. This information is used in subsequent batches. The data profile batch job iterates through the catalogProductRelationships and gets the list of valid offers between the given start and end caching dates and the catalog code selected. The other batches, such as getOffers, use this cached information, iterate through those lists of offers, and generate the offer profiles. The catalog data profile result item batch job computes the time slice key using the catalog code and selected start and end time. Using the timeslice key, the job gets the time slice list with the information of the number of time slices, its corresponding effectivity dates, and time-slice key. The cache data in each time slice is then processed by the batch job and used as input to the batch. Corresponding catalog result items are generated and cached with the effectivity of the cache according to the effective cache date times of the time slice. ![Data Profile Batch Job](https://developer.salesforce.com/docs/media/dc_dataprofile_batchjob.png) The following table shows an example of the Cached Data instance. | Comments | ApiResponse\_\_c | CacheKey\_\_c | Code\_\_c | EffectiveStartTime\_\_c | ExpirationTime\_\_c | Type\_\_c | | ---------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | --------- | ---------------------------- | ---------------------------- | --------------------- | | Data profile result item of time slice 1 | {"profileType":"catalog","code":"VersionCatalog1","data":{"sortedCatalogEligibilityObjectListMap":["01t4x000000ZL08AAG","01t4x000000ZL0DAAW","01t4x000000ZL4wAAG","01t4x000000ZL0DAAW","promotionalId1"]},"catalogProductRelationDetails":{"Promotion":[{"promotionId1":"promotionalItemId1"}],"Product":["01t4x000000ZL08AAG","01t4x000000ZL0DAAW","01t4x000000ZL4wAAG","01t4x000000ZL0DAAW"]},"catalogCodeToRuleAssignments":{},"metrics":{"pcisCount":0,"promosCount":1,"prodsCount":4}} | dprKey | catalog1 | 2021-03-01T08:00:00.000+0000 | 2021-03-03T08:00:00.000+0000 | dataprofileResultItem | | Data profile result item of time slice 2 | {"profileType":"catalog","code":"VersionCatalog1","data":{"sortedCatalogEligibilityObjectListMap":["01t4x000000ZL08AAG","01t4x000000ZL4rAAG","01t4x000000ZL4wAAG","01t4x000000ZL0DAAW","promotionId1"]},"catalogProductRelationDetails":{"Promotion":[{"promotionId1":"promotionalItemId2","promotionId2":"promotionalItemId3"}],"Product":["01t4x000000ZL08AAG","01t4x000000ZL4rAAG","01t4x000000ZL4wAAG","01t4x000000ZL0DAAW"]},"catalogCodeToRuleAssignments":{},"metrics":{"pcisCount":0,"promosCount":2,"prodsCount":4}} | dprKey | catalog1 | 2021-03-03T08:00:00.000+0000 | 2021-03-15T08:00:00.000+0000 | dataprofileResultItem | ## Context Eligibility Generator Batch Job This batch job caches the eligible offers for a context combination. It queries all the cacheable context dimensions, creates the context combinations, computes the qualified eligibility list of the qualified offers, and caches that list for each combination. This information is then used by the getOffers batch job to transform it into the structure used by the getOffers API when a combination of context is passed. The batch jobs are broken into three parts, each having its own set of roles and responsibilities: - Context combination generator: This batch job generates and caches the context combinations. The job queries the cached version info list for the catalog containing information about all the offer versions occurring between the selected start and end date. Using that information, the job gets all the cacheable context dimensions and their values. The job then generates the context combinations and caches them. ![Context combination generator](https://developer.salesforce.com/docs/media/dc_contextcombogen_batchjob.png) - Eligibility generator: This batch job takes the combination set generated by the context combination generator batch and version info list for that catalog (master list of all offer versions), calculates the offer eligibility list, and caches it against that combination. The qualifying rule set assignment for an offer (product or promotion) version is a fixed reference, so it becomes a version-specific reference. Time slicing for the catalog-level batch jobs depends on all the offer versions associated with the catalog. Therefore, a particular product version can be spawned across multiple time slices with no change in its qualifying criteria with respect to a time slice. As such, creating an eligibility master list of all offer versions that are eligible for a given context combination is beneficial for performance because the eligibility of an offer version is only calculated once. ![Eligibility generator](https://developer.salesforce.com/docs/media/dc_eligibilitygen_batchjob.png) - Time sliced eligibility list generator: This batch job caches the context eligibility list of catalog offers per time slice. For each time slice, the job gets the dataProfileResultItem and eligibility master list. The catalog profile result items present in the master eligibility list are marked as qualified and that eligibility list is cached with the effectivity of the time slice. ![Time sliced eligibility list generator](https://developer.salesforce.com/docs/media/dc_timeslice_batchjob.png) ## GetOffers Batch Job This batch job transforms the context eligibility generated data into the format read by the getOffers API. The eligibility list for a context combination created by the context eligibility generator batch is a list ordered by ID. The getOffers batch job generates the paginated list of eligible offers. Each page contains the list of offers according to its page size and offset and is ordered by a column (ID by default). Since getOffers batch job is a catalog-level batch job, its method of operation is per time slice. The batch job gets the context eligibility result items generated for each time slice in a separate batch process, paginates the resulting items into pages of a given page size, creates all the pages, generates a cache key for each record page, and caches the results. ![GetOffers Batch Job](https://developer.salesforce.com/docs/media/dc_getoffers_batchjob.png) ## Rule Set Batch Job This batch job gets all the rule sets associated with the offers under that catalog, gets the rule conditions, and caches the rule expressions that are used during the context eligibility calculations of the cacheable dimension combinations. This batch job operates on the versionInfo list that contains all the offers (productIds, promotionIds and promotionItemIds) that occur between the selected start and end date for a particular catalog. The job gets the qualification type rule sets and performs operations. ![Rule Set Batch Job](https://developer.salesforce.com/docs/media/dc_ruleset_batchjob.png) # Catalog Profile API The Catalog Profile API uses the catalogCode, which is a unique code that identifies a catalog, to generate its data profile and cache it. You define a catalogCode when you create a sales catalog. The data profile of a catalog consists of various details combined into a single object. The data profile contains such information as: - List of offer IDs related to the catalog. - Rule sets attached to offers. - Metrics: - Number of promotions in the catalog. - Number of products in the catalog. - Number of parent-child items in the catalog. ## URI /services/apexrest/{namespace}/v3/admin/catalogs/{catalogCode}/catalogprofile ## HTTP Method GET ## URI Parameters If you specify just one of these two parameters, it will follow the behavior described in the following table and accept your defined time for the parameter you specified. If you are using one or both parameters, you must specify them with the same values for all of the Populate Cache APIs in this sequence. | Parameter | Example | Default | Optional/Required | Notes | | ------------------ | ------------------- | ------------------------------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | effectiveStartTime | 2001-07-04T12:08:56 | Current date and time | Optional | effectiveStartTime is the time that you want your cached catalog entries to be effective. It should be in the UTC date-time format. Your effectiveStartTime must occur after the current time for which you are executing the Populate Cache APIs or you will receive an error message. | | expirationTime | 2001-07-04T12:08:56 | effectiveStartTime + TimeToLive | Optional | expirationTime is the time that you want your cached catalog entries to expire. It should also be in the UTC date-time format. Your expirationTime must occur after your effectiveStartTime or you receive an error message. TimeToLive is a custom setting created in CPQ Configuration Setup. It has a default value of 30 days. | Here is an example of how to pass the URI parameters: ```nolang GET /services/apexrest/vlocity_cmt/v3/admin/catalogs/AS-Test-Catalog/catalogprofile?effectiveStartTime=2021-07-04T12:08:56&expirationTime=2021-08-04T12:08:56 ``` ## Remote API This is an example of how you invoke the API using Apex: ```nolang String methodName; Map input = new Map(); Map output = new Map(); Map options = new Map(); // Setting remote parameters methodName = 'getCatalogProfile'; input.put('apiName','CMCatalogProfile'); // required input.put('catalogCode', 'TestCatalog'); // required input.put('effectiveStartTime', null); // optional input.put('expirationTime', null); // optional input.put('methodName',methodName); // required input.put('requestURL', '/v3/admin/catalogs/TestCatalog/catalogprofile'); // required //remote action invocation vlocity_cmt.CpqAppHandler appHandler = new vlocity_cmt.CpqAppHandler(); appHandler.invokeMethod(methodName, input, output, options); ``` ## Parallel Invocation This API can be run in parallel for multiple catalogs. For example, if you have 100 catalogs (Catalog1, Catalog2..Catalog 100), you can run the API for all 100 catalogs in 100 parallel threads. ```nolang THREAD1 - GET /services/apexrest/{namespace}/v3/admin/catalogs/catalog1/catalogprofile THREAD2 - GET /services/apexrest/{namespace}/v3/admin/catalogs/catalog2/catalogprofile ...... THREAD100 - GET /services/apexrest/{namespace}/v3/admin/catalogs/catalog100/catalogprofile ``` ## HTTP Headers | Header | Description | | ------------ | ---------------- | | Content-Type | application/json | ## Response Body This example shows the JSON of catalog data profile containing the offers and metadata information: ``` { "profileType": "catalog", "code": "test", "data": { "sortedCatalogEligibilityObjectListMap": [ "01t5w00000FbI08AAF" ], "catalogProductRelationDetails": { "Promotion": [], "Product": [ "01t5w00000FbI08AAF" ] }, "catalogCodeToRuleAssignments": {}, "metrics": { "pcisCount": 0, "promosCount": 0, "prodsCount": 1 } } } ``` ## HTTP Response Codes | Code | Description | | ---- | --------------------- | | 200 | OK | | 500 | Internal Server Error | # Category Hierarchy Output A complete category hierarchy with the path from root to leaf and the depth. ## JSON example ```json { "categoryId": "0ZGRM0000000Xyz1AA", "depth": 2, "path": [ { "id": "0ZGRM0000000Root1AA", "name": "All Products", "parentCategoryId": null, "level": 1 }, { "id": "0ZGRM0000000Xyz1AA", "name": "Beverages", "parentCategoryId": "0ZGRM0000000Root1AA", "level": 2 } ] } ``` ## Properties | Property Name | Type | Description | Filter Group and Version | Available Version | | ------------- | ------------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------ | ----------------- | | `categoryId` | String | The ID of the leaf category. | Small, 68.0 | 68.0 | | `depth` | Integer | The hierarchy depth, where 1 is the root, 2 is a child, and so on. | Small, 68.0 | 68.0 | | `path` | [Category Path Node Output](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/responses/category-path-node-output.md)[] | The complete path from the root category to this category. | Small, 68.0 | 68.0 | # Category Path Node Output A single node in the category hierarchy path, representing one level from root to leaf. ## JSON example ```json { "id": "0ZGRM0000000Xyz1AA", "name": "Beverages", "parentCategoryId": "0ZGRM0000000Root1AA", "level": 2 } ``` ## Properties | Property Name | Type | Description | Filter Group and Version | Available Version | | ------------------ | ------- | ---------------------------------------------------- | ------------------------ | ----------------- | | `id` | String | The category ID. | Small, 68.0 | 68.0 | | `level` | Integer | The hierarchy level, 1-indexed, where 1 is the root. | Small, 68.0 | 68.0 | | `name` | String | The category name. | Small, 68.0 | 68.0 | | `parentCategoryId` | String | The parent category ID. Null for the root category. | Small, 68.0 | 68.0 | # Changes to API Responses After you enable Standard Digital Commerce and send API calls, some fields are added and others removed from the responses. ## Removed Fields This table lists the fields that are removed from API responses after you enable Standard Digital Commerce. These fields were previously included in the node of each record (LineItem). | Field | Description | | -------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `Id` | This is the `orderItemId` field. Since Standard Digital Commerce doesn't create pseudo-orders, this field is no longer included in the response. | | `IsActive` | You can only add active products to the basket. Therefore, this field isn't required as it always returns true. | | `ListPrice` |  - | | `OrderId` | This is the `orderId` field. Since Standard Digital Commerce doesn't create pseudo-orders, this field is no longer included in the response. | | `Pricebook2Id` |  - | | `SellingPeriod` |  - | | `hasChildren` | Basket responses always return the full hierarchy. Therefore, this boolean field isn't required. | | `orderActive` | This is an order-related field. Since Standard Digital Commerce doesn't create pseudo-orders, this field is no longer included in the response. | | `vlocity_clmperf__BillingAccountId__c` | This is an order-related field. Since Standard Digital Commerce doesn't create pseudo-orders, this field is no longer included in the response. | | `vlocity_clmperf__CpqMessageData__c` | Validation errors are present in the messages node of the item. This is a duplicate field that was present in orderItem. Since Standard Digital Commerce doesn't create pseudo-orders, this field isn't returned. | | `vlocity_clmperf__CurrencyPaymentMode__c` | This field is useful when you create orders. It isn't returned from basket responses. | | `vlocity_clmperf__FirstVersionOrderItemId__c` | This is an order Item-related field. Since Standard Digital Commerce doesn't create pseudo-orders, this field isn't returned. | | `vlocity_clmperf__FulfilmentStatus__c` | This field was populated by ODIN when an order was submitted. It isn't returned from basket responses. | | `vlocity_clmperf__IsChangesAllowed__c` | This field was useful when an order was submitted. It isn't returned from basket responses. | | `vlocity_clmperf__ItemName__c` |   - | | `vlocity_clmperf__OneTimeManualDiscount__c` | Since Standard Digital Commerce doesn't support manual discounts, this field isn't returned. | | `vlocity_clmperf__OrderGroupId__c` | This is an order-related field. Since Standard Digital Commerce doesn't create pseudo-orders, this field isn't returned. | | `vlocity_clmperf__ProductGroupKey__c` | This field is now called `GlobalGroupKey`. | | `vlocity_clmperf__ProductHierarchyGroupKeyPath__c` |   - | | `vlocity_clmperf__ProvisioningStatus__c` | This field was useful when an order was submitted. It isn't returned from basket responses. | | `vlocity_clmperf__RecurringDiscountPrice__c` | Since Standard Digital Commerce doesn't support discounts, this field isn't returned. | | `vlocity_clmperf__RecurringManualDiscount__c` | Since Standard Digital Commerce doesn't support manual discounts, this field isn't returned. | | `vlocity_clmperf__RecurringPrice__c` |   - | | `vlocity_clmperf__ServiceAccountId__c` | This is an account-related field. Since Standard Digital Commerce doesn't create pseudo-accounts, this field isn't returned. | | `vlocity_clmperf__SubAction__c` | This field was useful when an order was submitted and then a supplemental order was created. It isn't returned from basket responses. | | `vlocity_clmperf__SupersededOrderItemId__c` | This is an order item-related field. Since Standard Digital Commerce doesn't create pseudo-orders, this field isn't returned. | | `vlocity_clmperf__SupplementalAction__c` | This field was useful when an order was submitted and then a supplemental order was created. It isn't returned from basket responses. | ## Added Fields These fields are added to API responses after you enable Standard Digital Commerce: - `vlocity_clmperf__EffectiveQuantity__c` - `vlocity_clmperf__GlobalGroupKey__c` = `vlocity_clmperf__ProductGroupKey__c` - `vlocity_clmperf__SequenceNumber__c` # Check Feature Compatibility Following table lists features which are compatible with standard digital commerce APIs. If you're using features that are not supported, we recommend that you do not enable the standard digital commerce APIs. | Feature / Capability | Compatibity with Standard Digital Commerce API | | ----------------------------------------------------- | ---------------------------------------------- | | Cost And Margin | Compatible | | Attribute Bindings | Compatible | | Attribute Based Pricing | Compatible | | Usage Based Pricing | Compatible | | Multiple language Catalog Support | Compatible | | Time Plan and Policy | Compatible | | Offer Specification | Compatible | | Product Versioning | Compatible | | The `fields` parameter | Not Supported | | V1 Attribute model | Not Supported | | Multiple Currency | Not Supported | | Loyalty | Not Supported | | Context Mapping Initialisation Type - `Type In` | Not Supported | | Context Mapping Initialisation Type - `Scope Sobject` | Not Supported | **note:** - To enable the Product Versioning feature, customers must contact their Account Executives (AEs). Starting with the Winter'26 release, any new customer attempting to enable this feature will receive an error message instructing them to contact their AE. - The Custom Expression mode in RuleSet is not supported when standard digital commerce APIs are enabled. - Base Pricing Adjustments are not supported with Standard DC APIs. # Check Feature Compatibility Following table lists features which are compatible with standard cart APIs. If you're using features that are not supported, we recommend that you do not enable the standard cart APIs. | Feature / Capability | Compatibility with Standard Cart API | | ------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | | Asset-Based Ordering | Compatible | | Manual Pricing Adjustments Changes in the Cart | Compatible | | Promotions in the Cart | Compatible | | Price Adjustments and Overrides | Compatible | | Attribute-Based Pricing | Compatible | | Multi-Site Quote and Order Capture | Compatible | | Context Rules and Advanced Rules Frameworks | Compatible | | Create Qualification Rule Sets | Compatible | | Advanced Rules (Entity Filters, Evaluations) | Compatible | | Offer Specification | Compatible | | Product Versioning | Compatible | | Discounts in Industries CPQ | Compatible | | Change of Plans in Industries CPQ | Compatible for single-asset change of plan. Bulk Change of Plan is not compatible. | | Bulk Change and Bulk Update | Not compatible. These operations fail when Standard Cart APIs are enabled. | | Usage Pricing for Industries CPQ | Compatible | | Functions for Context Rules | Compatible. See [Working Example](https://developer.salesforce.com/docs/industries/cme/guide/use-functions-context-rules.md) | | [Product Relationships](https://help.salesforce.com/s/articleView?id=ind.comms_product_relationships_overview.htm&type=5) | Compatible. See [Working Example](https://developer.salesforce.com/docs/industries/cme/guide/relies_on_capability.md) | | Salesforce Pricing with CME | Compatible | | Transformation of Multiplay Offers | Compatible with limitations. `replaceOffers` does not support complex multi-play transformations. See [Known Limitations](https://developer.salesforce.com/docs/industries/cme/guide/standard-cart-known-limitations.md). | | Multi-Edit Cart Items | Compatible | | Incremental Caching | Compatible | **note:** - To enable the Product Versioning feature, customers must contact their Account Executives (AEs). Starting with the Winter'26 release, any new customer attempting to enable this feature will receive an error message instructing them to contact their AE. ## Usage Considerations Review the following considerations before using the standard cart APIs. - Entity filters on the orders, assets, orderlineitems, Product, PriceBookentry, and ProductChildItem objects are supported. All advanced rules are supported. - Entity filters and advanced rules may not work as expected if the formula field is modified in the transaction. To rerun the advanced rules once the formula field is updated, execute getCartsItems API call with validate = true. - In the addToCart API, the `includeAttachment` input parameter is not supported. Standard Cart APIs and LWC Cart (FlexCard-based and Enhanced) do not return or display product attachments on cart line items. Hybrid Cart continues to support attachments. If you require attachments, stay on Hybrid Cart or, for FlexCard Cart only, build a custom component that queries `ContentDocumentLink` records. - For better performance when you use this API to add a child bundle with a parent as a virtual line item, pass `rootLineItemId` in the `items` object. Following is an example payload. ``` { "methodName": "postCartsItems", "items": [ { "quantity": {Quantity of child product to add}, "parentId": {Parent cart item Id}, "rootLineItemId": {Pass in case of child add of virtual parent for better performance} "parentHierarchyPath": {Hierarchy path of parent}, "itemId": {comma seperated pricebook entry ids of child products to add}, "parentRecord": { "records": [ {Parent item record object} ] } } ], "cartId": {cart_ID}, "price": true, "validate": true, "includeAttachment": true, "pagesize": 10, "lastRecordId": null, "hierarchy": -1, "query": null } ``` - The `nameResult` node is not be present in response (like attributeCategories, productAttributes) for all the standard cart APIs. The data nodes are directly present. - The structure of response for all the standard cart APIs, when called using Apex Remote Service (CpqAppHandler), is as follows: ``` { "CpqNext1b": true, "result": response (String) } ``` - Set `price` to false in getCartsItems if you don't need to run a pricing engine for the API call. This can improve performance. - For priceCart API, setting `limitScopeToPassedItem` no longer required to be separately passed, just pass items in the `items` parameters. - The replaceOffers API does not support complex transformations. For example, Multi-play offers. Change of Plans is otherwise compatible for single-asset operations. See [Known Limitations](https://developer.salesforce.com/docs/industries/cme/guide/standard-cart-known-limitations.md). - Bulk Change and Bulk Update, including bulk disconnect of assets, are not compatible with Standard Cart APIs. Do not enable Standard Cart APIs if you use these features. This is separate from [Multi-Edit Cart Items](https://developer.salesforce.com/docs/industries/cme/guide/standard_cart/std_comms-multi-edit.md), which remains compatible. - Using Field Settings to add custom fields to the cart response is supported only for `getCarts` and GetCartsItems. For other Standard Cart APIs, pass any custom field with the `fields` parameter of the request URL or body. If you need many fields, add them in a PreInvoke hook instead of Field Settings. - The ProductSelector interface is not supported with Standard Cart APIs. Use the `sortBy` parameter on `getCartsProducts`. - The following API parameters have Standard Cart API support starting in 258. Behavior can still differ from Classic: - `noResponseNeeded` is supported for Add, Update, and Delete Standard Cart APIs. Multi-item add defaults to `noResponseNeeded=true` and does not return the `records` node unless you pass `false`. - `maintainAssetPrice` is supported from 258. - Starting in the Winter'27 release, the Classic `cloneItems` API supports `noResponseNeeded`. When `true`, the API does not return the `records` node. For a full list of Classic-only APIs and remaining behavior differences, see [Known Limitations](https://developer.salesforce.com/docs/industries/cme/guide/standard-cart-known-limitations.md). #### AssetToOrder - There are two invocations that can be used upon calling AssetToOrder API. Upon calling OmniFDOWrapper, the classic flow is invoked. The standard flow is invoked upon calling REST API. - The following CPQConfiguration settings are not currently supported for AssetToOrder. While we offer the functionality, there is no specific configuration available to control the API behavior for these settings: - UsingPromotions - DeltaPrice - IsCachingEnabledForAssetToOrder # Check Out Operations with Digital Commerce You use the Check Out Operations to complete the purchase. # Check Status of the Cart Return a summary of the cart status including pricing, account, multi-site, and additional action information. - Pricing information, such as total one-time charges and total recurring charges - Account information associated with the cart - If the cart includes a multi-site order and available sites - Links to further actions, such as checkout ```nolang GET /v2/cpq/carts/{cart_ID}/items/checkout ``` 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 ```nolang getCarts ``` ## REST Handler ```nolang CpqCreateCartActionV2 ``` ## Apex Remote Service ```nolang Class: vlocity_cmt.CpqAppHandler method: global Object invokeMethod(String methodName, Map inputs, Map output, Map options) ``` ## Apex Remote Input Map ```nolang String methodName: checkout Map inputs: SAME AS SAMPLE REQUEST Body ``` ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | ---------------------------------------------------------------------- | | Resource URL | `/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/items/checkout` | ## Example Request Body The checkOrderStatus parameter indicates whether a set of status fields should be checked prior to allowing an order to be checked out. If checkOrderStatus is set to true (the default): ```nolang { "methodName": "checkout", "cartId": "8012800000004GFAAY", "ContextId": "8012800000004GFAAY", "objectTypeToIdsToClone": "OrderItem:8021N000008NG5t", "validateSubmittedXLI": false, "checkOrderStatus": true, "provisioningStatus": "Active" } ``` - Any order that is active cannot be submitted. - If any of the following is true, the order is determined to be active: - Status has a value of Activated - OrderStatus_c has any of the following values: - In Progress - Cancelled - Cancel Requested - Complete - SupersededOrderId_c is not null If checkOrderStatus is set to false, the order can be processed even if the order is active. The validateSubmittedXLI parameter controls the pre-submit validation for the checkout API. If true, it will validate whether the user has submitted complete bundles and if all the line items have the field FulfilmentStatus\_\_c value set to `Activated`. If either or both of those conditions are not met, the transaction will fail. ## Example Responses The following example shows a response to a successful submit. ```nolang { "totalSize": 1, "messages": [ { "code": "SUBMIT-1008", "severity": "INFO", "message": "Order 8012M000007mAQIQA2 was successfully assetized and activated" } ], "records": [ { "messages": [ ], "displaySequence": -1, "id": "0012M00002GchG1QAJ", "objectType": "Account", "clonedObjectIds": [ "02i2M00000Q8FZNQA3", "02i2M00000Q8FZOQA3" ] } ] } ``` The following example shows a response to a failed submit if validate is true and some or all the line items are not activated. ```nolang { "totalSize": 0, "messages": [ { "code": "214", "severity": "ERROR", "message": "The following line items are not activated: 8021N00000BS6TFQA1,8021N00000BS6VPQA1,8021N00000BS6VQQA1,8021N00000BS6TGQA1,8021N00000BS6THQA1,8021N00000BS6TKQA1,8021N00000BS6TLQA1,8021N00000BS6TMQA1,8021N00000BS6TNQA1" } ] } ``` The following example shows a response to a failed submit if validate is true, some bundles are incomplete, and some or all line items are not activated. ```nolang { "totalSize": 0, "messages": [ { "code": "214", "severity": "ERROR", "message": "The following line items are not activated 8021N00000BS6VQQA1 | Please submit the full bundle for the following line item(s) 8021N00000BS6VQQA1" } ] } ``` ## Message Codes | Code | Description | | ----------- | -------------------------------------------------------------------------------------------------------------- | | SUBMIT-1001 | Order submission is accepted by OM. | | SUBMIT-1002 | Order submission is provisionally accepted. | | SUBMIT-1003 | Order submission was rejected for PONR. | | SUBMIT-1004 | Order submission was rejected because queue is full. | | SUBMIT-1005 | Order submission is done without a required parameter. This will be used only during integration. | | SUBMIT-1006 | Order Management responded with an unknown response code. | | SUBMIT-1007 | Order Management responded with "rejected" and without a reason code. | | SUBMIT-1008 | Auto-assetization is successful, which happens if OdinAPIAutoAssetizeHandler is configured for OdinAPIHandler. | | SUBMIT-1009 | Order submission ran into an exception that may not be reproducible. | # Check Status of the Cart Return a summary of the cart status including pricing, account, multi-site, and additional action information. - Pricing information, such as total one-time charges and total recurring charges - Account information associated with the cart - If the cart includes a multi-site order and available sites - Links to further actions, such as checkout ```nolang GET /v2/cpq/carts/{cart_ID}/items/checkout ``` 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 ```nolang getCarts ``` ## REST Handler ```nolang CpqCreateCartActionV2 ``` ## Apex Remote Service ```nolang Class: vlocity_cmt.CpqAppHandler method: global Object invokeMethod(String methodName, Map inputs, Map output, Map options) ``` ## Apex Remote Input Map ```nolang String methodName: checkout Map inputs: SAME AS SAMPLE REQUEST Body ``` ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | ---------------------------------------------------------------------- | | Resource URL | `/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/items/checkout` | ## Example Request Body The checkOrderStatus parameter indicates whether a set of status fields should be checked prior to allowing an order to be checked out. If checkOrderStatus is set to true (the default): ```nolang { "methodName": "checkout", "cartId": "8012800000004GFAAY", "ContextId": "8012800000004GFAAY", "objectTypeToIdsToClone": "OrderItem:8021N000008NG5t", "validateSubmittedXLI": false, "checkOrderStatus": true, "provisioningStatus": "Active" } ``` - Any order that is active cannot be submitted. - If any of the following is true, the order is determined to be active: - Status has a value of Activated - OrderStatus_c has any of the following values: - In Progress - Cancelled - Cancel Requested - Complete - SupersededOrderId_c is not null If checkOrderStatus is set to false, the order can be processed even if the order is active. The validateSubmittedXLI parameter controls the pre-submit validation for the checkout API. If true, it will validate whether the user has submitted complete bundles and if all the line items have the field FulfilmentStatus\_\_c value set to `Activated`. If either or both of those conditions are not met, the transaction will fail. ## Example Responses The following example shows a response to a successful submit. ```nolang { "totalSize": 1, "messages": [ { "code": "SUBMIT-1008", "severity": "INFO", "message": "Order 8012M000007mAQIQA2 was successfully assetized and activated" } ], "records": [ { "messages": [ ], "displaySequence": -1, "id": "0012M00002GchG1QAJ", "objectType": "Account", "clonedObjectIds": [ "02i2M00000Q8FZNQA3", "02i2M00000Q8FZOQA3" ] } ] } ``` The following example shows a response to a failed submit if validate is true and some or all the line items are not activated. ```nolang { "totalSize": 0, "messages": [ { "code": "214", "severity": "ERROR", "message": "The following line items are not activated: 8021N00000BS6TFQA1,8021N00000BS6VPQA1,8021N00000BS6VQQA1,8021N00000BS6TGQA1,8021N00000BS6THQA1,8021N00000BS6TKQA1,8021N00000BS6TLQA1,8021N00000BS6TMQA1,8021N00000BS6TNQA1" } ] } ``` The following example shows a response to a failed submit if validate is true, some bundles are incomplete, and some or all line items are not activated. ```nolang { "totalSize": 0, "messages": [ { "code": "214", "severity": "ERROR", "message": "The following line items are not activated 8021N00000BS6VQQA1 | Please submit the full bundle for the following line item(s) 8021N00000BS6VQQA1" } ] } ``` ## Message Codes | Code | Description | | ----------- | -------------------------------------------------------------------------------------------------------------- | | SUBMIT-1001 | Order submission is accepted by OM. | | SUBMIT-1002 | Order submission is provisionally accepted. | | SUBMIT-1003 | Order submission was rejected for PONR. | | SUBMIT-1004 | Order submission was rejected because queue is full. | | SUBMIT-1005 | Order submission is done without a required parameter. This will be used only during integration. | | SUBMIT-1006 | Order Management responded with an unknown response code. | | SUBMIT-1007 | Order Management responded with "rejected" and without a reason code. | | SUBMIT-1008 | Auto-assetization is successful, which happens if OdinAPIAutoAssetizeHandler is configured for OdinAPIHandler. | | SUBMIT-1009 | Order submission ran into an exception that may not be reproducible. | # Checkout Items in a Cart ## Overview The Checkout API finalizes a CPQ cart by performing all mandatory validations, pricing recalculations, asset‑generation steps and transaction commits required to create a ready‑to‑bill Order.
It is the logical culmination of the add → configure → price → validate → checkout pattern common to digital‑commerce and assisted‑selling flows. Based on the header object, submit the object to create the quote, order, or assets. - If the header object is Opportunity, submit the opportunity to create a quote. - If the header object is Quote, submit the quote to create an order. - If the header object is Order, submit the order to create assets. These APIs replace the following methods in [OmniCPQServiceWrapper](https://developer.salesforce.com/docs/industries/cme/comms-cpq-apis-to-replace-omnicpqservicewrapper.md): - Submit Opportunity replaces OmniCPQServceWrapper `submitOpportunity`. - Submit Order replaces OmniCPQServiceWrapper `submitOrder`. - Submit Quote replaces OmniCPQServiceWrapper `submitQuote`. ## Odin Bifurcation The call path depends on the OdinAPIHandler interface chosen at runtime: - OdinAPIAutoAssetizeHandler – routes directly to Java core classes (CheckoutAction, CheckoutServiceImpl) for high‑volume assetisation use‑cases. - Any other implementation – executes entirely in Apex inside the managed package, allowing org‑specific extensions before/after core logic. ``` POST /v2/cpq/carts/{cart_Id}/items/checkout ``` For more information, see [OmniCPQServiceWrapper](https://help.salesforce.com/s/articleView?id=ind.v_dev_t_omnicpqservicewrapper_661885.htm). 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. ## Rest Handler ``` APICheckoutItemsCartsCPQV2 ``` ## Rest Method ``` checkoutItems ``` ## Remote Service ``` CpqAppHandler ``` ## Remote Method ``` checkout ``` ## Apex Remote Input Map ``` Map inputMap = new Map{ 'cartId' => '{CART_ID}' }; Map outputMap = new Map(); Map optionsMap = new Map(); CpqAppHandler handler = new CpqAppHandler(); handler.invokeMethod('checkout', inputMap, outputMap, optionsMap); ``` ContextId is required for the Checkout Items in Cart remote action, which is used in the [Guided Selling OmniScript](https://help.salesforce.com/s/articleView?id=ind.comms_guided_selling_omniscript_using_cpq_apis.htm). ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | ---------------------------------------------------------------------- | | Resource URL | `/services/apexrest/{namespace}/v2/cpq/carts/{cart_Id}/items/checkout` | ## Example Request ``` POST /v2/cpq/carts/{cart_Id}/items/checkout { "validate": true, "assetizeFullBundlePerRoot": false, "validateSubmittedXLI": false } ``` ## Example Responses ``` { "totalSize": 1, "messages": [ { "code": "SUBMIT-1008", "severity": "INFO", "message": "Order 801xx000003H0JTAA0 was assetized and activated." } ], "records": [ { "messages": [ ], "displaySequence": -1, "clonedObjectIds": "["02ixx0000004N2AAAU"]", "id": "001xx000003H0HrAAK", "objectType": "Account" } ] } ``` **note:** 'objectType' conveys the type of the object that was created by the Checkout process.
For Eg: If Checkout is performed from an Opportunity, the objectType will be Quote. # Checkout Items in Cart Based on the header object, submit the object to create the quote, order, or assets. - If the header object is Opportunity, submit the opportunity to create a quote. - If the header object is Quote, submit the quote to create an order. - If the header object is Order, submit the order to create assets. ```nolang POST /v2/cpq/carts/{cart_ID}/items/checkout ``` These APIs replace the following methods in [OmniCPQServiceWrapper](https://developer.salesforce.com/docs/industries/cme/guide/comms-cpq-apis-to-replace-omnicpqservicewrapper.md): - Submit Opportunity replaces OmniCPQServceWrapper `submitOpportunity`. - Submit Order replaces OmniCPQServiceWrapper `submitOrder`. - Submit Quote replaces OmniCPQServiceWrapper `submitQuote`. For more information, see [OmniCPQServiceWrapper](https://help.salesforce.com/s/articleView?id=ind.v_dev_t_omnicpqservicewrapper_661885.htm). 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 ```nolang checkout ``` ## REST Handler ```nolang APICheckoutItemsCartsCPQV2 ``` ## Apex Remote Service ```nolang CpqAppHandler ``` ## Apex Remote Input Map ContextId is required for the Checkout Items in Cart remote action, which is used in the [Guided Selling OmniScript](https://help.salesforce.com/s/articleView?id=ind.comms_guided_selling_omniscript_using_cpq_apis.htm). ```nolang { methodName:"checkout" cartId:801360000008eNU ContextId:801360000008eNU } ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | -------------------------------------------------------------------- | | Resource URL | `/services/apexrest/namespace/v2/cpq/carts/{cart_ID}/items/checkout` | ## Example Request ```nolang POST /v2/cpq/carts/{cart_ID}/items/checkout ``` ## Example Responses **note:** Submit Opportunity ```nolang { "totalSize":1, "messages":[], "records": [ { "messages":[], "displaySequence":-1, "id":"0Q01I000000TvNmSAK", "objectType":"Quote" } ] } ``` **note:** Submit Order ```nolang "records": [ { "messages": [], "displaySequence": -1, "id": "00146000004DeR9AAK", "objectType": "Account" } ] ``` **note:** Submit Quote ```nolang { "totalSize":1, "messages":[], "records": [ { "messages":[], "displaySequence":-1, "id":"8011I000000KZW3QAO", "objectType":"Order" } ] } ``` # Clone Line Items in Cart Clone the line items within the current cart. ```nolang POST /v2/cpq/carts/{cart_ID}/items/clone ``` **NOTE:** Starting in the Winter'27 release, this API supports `noResponseNeeded`. Set `noResponseNeeded` to `true` in the request body when the client does not need the cloned line-item payload. The API completes the clone and returns a lightweight success response instead of the full `records` node. This avoids resource-limit failures on large or multi-level clone operations. No additional configuration is required. When `noResponseNeeded` is omitted or `false`, the API continues to return the full clone response. ## Remote Method ```nolang cloneItems ``` ## REST Handler ```nolang CpqCloneCartItemActionV2 ``` ## Apex Remote Service ```nolang CpqAppHandler ``` ## Apex Remote Input Map ```nolang { "methodName": "cloneItems", "cartId": "801360000008eNU", "items":[ {"itemId":"01t36000000pfcKAAQ"}] } ``` To skip assembling the cloned line-item payload, include `"noResponseNeeded": true` in the request body. See [Clone with noResponseNeeded=true](#clone-with-noresponseneededtrue). ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | ------------------------------------------------------------------- | | Resource URL | `/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/items/clone` | ## Example Request ```nolang POST { "items": [ { "itemId": "item_ID" } ] } ``` ## Example Result ```nolang { "totalSize" => 1, "messages" => [{ "severity" => "INFO", "messageId" => nil, "message" => "Clone Successful.", "code" => "153", "bundleId" => nil, "actions" => {} }], "actions" => { "itempricesupdated" => { "rest" => { "params" => {}, "method" => "GET", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwDJQAY/price" }, "remote" => { "params" => { "cartId" => "8016A000000bwDJQAY", "methodName" => "getCartLineItemPrices" } }, "client" => { "params" => {} } } }, "records" => [{ "messages" => [], "actions" => { "addtocart" => { "rest" => { "params" => { "items" => [{ "quantity" => 1, "parentId" => "8026A000000cCaQQAU", "itemId" => "01u6A00000135XeQAI" }], "cartId" => "8016A000000bwDJQAY", "price" => true, "validate" => true, "includeAttachment" => false, "pagesize" => 20, "lastRecordId" => nil, "query" => nil }, "method" => "POST", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwDJQAY/items" }, "remote" => { "params" => { "methodName" => "postCartsItems", "items" => [{ "quantity" => 1, "parentId" => "8026A000000cCaQQAU", "itemId" => "01u6A00000135XeQAI" }], "cartId" => "8016A000000bwDJQAY", "price" => true, "validate" => true, "includeAttachment" => false, "pagesize" => 20, "lastRecordId" => nil, "query" => nil } }, "client" => { "params" => {} } }, "updateitems" => { "rest" => { "params" => { "items" => [{ "itemId" => "8026A000000cCaQQAU" }], "filters" => nil, "fields" => nil, "cartId" => "8016A000000bwDJQAY", "price" => true, "validate" => true, "includeAttachment" => false, "pagesize" => 20, "lastRecordId" => nil, "query" => nil }, "method" => "PUT", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwDJQAY/items" }, "remote" => { "params" => { "methodName" => "putCartsItems", "items" => [{ "itemId" => "8026A000000cCaQQAU" }], "filters" => nil, "fields" => nil, "cartId" => "8016A000000bwDJQAY", "price" => true, "validate" => true, "includeAttachment" => false, "pagesize" => 20, "lastRecordId" => nil, "query" => nil } }, "client" => { "params" => {} } }, "deleteitem" => { "rest" => { "params" => {}, "method" => "DELETE", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwDJQAY/items/8026A000000cCaQQAU?pagesize=20&includeAttachment=false&validate=true&price=true&cartId=8016A000000bwDJQAY&id=8026A000000cCaQQAU" }, "remote" => { "params" => { "methodName" => "deleteCartsItems", "id" => "8026A000000cCaQQAU", "filters" => nil, "fields" => nil, "cartId" => "8016A000000bwDJQAY", "price" => true, "validate" => true, "includeAttachment" => false, "pagesize" => 20, "lastRecordId" => nil, "query" => nil } }, "client" => { "params" => {} } }, "cloneitem" => { "rest" => { "params" => { "items" => [{ "itemId" => "8026A000000cCaQQAU" }], "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY" }, "method" => "POST", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwDJQAY/items/clone" }, "remote" => { "params" => { "methodName" => "cloneItems", "items" => [{ "itemId" => "8026A000000cCaQQAU" }], "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY" } }, "client" => { "params" => {} } }, "modifyattributes" => { "rest" => { "params" => { "items" => [{ "itemId" => "8026A000000cCaQQAU" }], "filters" => nil, "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY" }, "method" => "PUT", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwDJQAY/items/8026A000000cCaQQAU/itemAttributes" }, "remote" => { "params" => { "methodName" => "putItemAttributes", "items" => [{ "itemId" => "8026A000000cCaQQAU" }], "filters" => nil, "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY" } }, "client" => { "params" => {} } } }, "displaySequence" => -1, "Id" => { "value" => "8026A000000cCaQQAU", "previousValue" => nil, "originalValue" => nil, "messages" => [], "label" => "Order Product ID", "hidden" => false, "fieldName" => "Id", "editable" => false, "dataType" => "ID", "actions" => {} }, "Pricebook2Id" => "01s6A0000037JCtQAM", "Product2Id" => "01t6A000000fd0AQAQ", "ProductCode" => "IRKPL", "UnitPrice" => { "value" => 0.0, "previousValue" => nil, "originalValue" => nil, "messages" => [], "label" => "Unit Price", "hidden" => true, "fieldName" => "UnitPrice", "editable" => false, "dataType" => "CURRENCY", "actions" => {} }, "Name" => "IRKPL", "vlocity_cmt__RecurringPrice__c" => 0.0, "IsActive" => true, "Product2" => { "attributes" => { "type" => "Product2", "url" => "/services/data/v40.0/sobjects/Product2/01t6A000000fd0AQAQ" }, "Name" => "IRKPL", "vlocity_cmt__IsConfigurable__c" => false, "vlocity_cmt__Type__c" => "None", "vlocity_cmt__SubType__c" => "None", "RecordTypeId" => "0126A000000gwBfQAI", "Id" => "01t6A000000fd0AQAQ", "vlocity_cmt__JSONAttribute__c" => nil }, "productId" => "01t6A000000fd0AQAQ", "defaultQuantity" => 1.0, "minQuantity" => 0.0, "maxQuantity" => 99999.0, "groupMinQuantity" => 0, "groupMaxQuantity" => 99999, "sequenceNumber" => 1.0, "productChildItemDefinition" => { "attributes" => { "type" => "vlocity_cmt__ProductChildItem__c", "url" => "/services/data/v40.0/sobjects/vlocity_cmt__ProductChildItem__c/a2a6A000000wm6XQAQ" }, "vlocity_cmt__MinQuantity__c" => 0, "vlocity_cmt__SeqNumber__c" => 1.0, "Name" => "Root PCI", "Id" => "a2a6A000000wm6XQAQ", "vlocity_cmt__Quantity__c" => 1, "vlocity_cmt__MaximumChildItemQuantity__c" => 99999, "vlocity_cmt__MaxQuantity__c" => 99999, "vlocity_cmt__ParentProductId__r" => { "attributes" => { "type" => "Product2", "url" => "/services/data/v40.0/sobjects/Product2/01t6A000000fd0AQAQ" }, "Name" => "IRKPL", "Id" => "01t6A000000fd0AQAQ", "RecordTypeId" => "0126A000000gwBfQAI" }, "vlocity_cmt__MinimumChildItemQuantity__c" => 0, "vlocity_cmt__CollapseHierarchy__c" => false, "vlocity_cmt__IsOverride__c" => false, "vlocity_cmt__IsVirtualItem__c" => false, "vlocity_cmt__ChildLineNumber__c" => "1", "vlocity_cmt__IsRootProductChildItem__c" => true, "vlocity_cmt__ParentProductId__c" => "01t6A000000fd0AQAQ" }, "productHierarchyPath" => "01t6A000000fd0AQAQ", "name" => "IRKPL", "isVirtualItem" => false, "provisioningStatus" => "New", "hasChildren" => false, "itemType" => "lineItem", "PricebookEntryId" => { "value" => "01u6A00000135XeQAI", "previousValue" => nil, "originalValue" => nil, "messages" => [], "label" => "Price Book Entry ID", "hidden" => false, "fieldName" => "PricebookEntryId", "editable" => false, "dataType" => "REFERENCE", "actions" => {} }, "Quantity" => { "value" => 1.0, "previousValue" => nil, "originalValue" => nil, "messages" => [], "label" => "Quantity", "hidden" => false, "fieldName" => "Quantity", "editable" => true, "dataType" => "DOUBLE", "actions" => {} }, "vlocity_cmt__OneTimeTotal__c" => { "value" => 10.0, "previousValue" => nil, "originalValue" => nil, "messages" => [], "label" => "One Time Total", "hidden" => false, "fieldName" => "vlocity_cmt__OneTimeTotal__c", "editable" => false, "dataType" => "CURRENCY", "actions" => { "adjustmentcodes" => { "rest" => { "params" => {}, "method" => "GET", "link" => "/services/apexrest/vlocity_cmt/v2/listsofvalues?listkeys=AdjustmentCodes&cartId=8016A000000bwDJQAY&id=8026A000000cCaQQAU&fields=vlocity_cmt__OneTimeTotal__c&PricingVariableCode=OT_STD_PRC_TOTAL" }, "remote" => { "params" => { "methodName" => "getListsOfValues", "PricingVariableCode" => "OT_STD_PRC_TOTAL", "fields" => "vlocity_cmt__OneTimeTotal__c", "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY", "listkeys" => "AdjustmentCodes" } }, "client" => { "records" => [], "params" => {} } }, "applyadjustment" => { "rest" => { "params" => { "adjustments" => [{ "PricingVariableCode" => "OT_STD_PRC_TOTAL", "AdjustmentCode" => "", "AdjustmentValue" => 0, "AdjustmentMethod" => "Percent", "DetailType" => "ADJUSTMENT", "Field" => "vlocity_cmt__OneTimeTotal__c" }], "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY" }, "method" => "POST", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwDJQAY/items/8026A000000cCaQQAU/pricing" }, "remote" => { "params" => { "methodName" => "applyAdjustment", "adjustments" => [{ "PricingVariableCode" => "OT_STD_PRC_TOTAL", "AdjustmentCode" => "", "AdjustmentValue" => 0, "AdjustmentMethod" => "Percent", "DetailType" => "ADJUSTMENT", "Field" => "vlocity_cmt__OneTimeTotal__c" }], "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY" } }, "client" => { "records" => [], "params" => {} } }, "pricedetail" => { "rest" => { "params" => {}, "method" => "GET", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwDJQAY/items/8026A000000cCaQQAU/pricing?cartId=8016A000000bwDJQAY&id=8026A000000cCaQQAU&fields=vlocity_cmt__OneTimeTotal__c" }, "remote" => { "params" => { "methodName" => "getPriceDetail", "fields" => "vlocity_cmt__OneTimeTotal__c", "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY" } }, "client" => { "records" => [], "params" => {} } } } }, "vlocity_cmt__RecurringTotal__c" => { "value" => 0.0, "previousValue" => nil, "originalValue" => nil, "messages" => [], "label" => "Recurring Total", "hidden" => false, "fieldName" => "vlocity_cmt__RecurringTotal__c", "editable" => false, "dataType" => "CURRENCY", "actions" => { "adjustmentcodes" => { "rest" => { "params" => {}, "method" => "GET", "link" => "/services/apexrest/vlocity_cmt/v2/listsofvalues?listkeys=AdjustmentCodes&cartId=8016A000000bwDJQAY&id=8026A000000cCaQQAU&fields=vlocity_cmt__RecurringTotal__c&PricingVariableCode=REC_MNTH_STD_PRC_TOTAL" }, "remote" => { "params" => { "methodName" => "getListsOfValues", "PricingVariableCode" => "REC_MNTH_STD_PRC_TOTAL", "fields" => "vlocity_cmt__RecurringTotal__c", "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY", "listkeys" => "AdjustmentCodes" } }, "client" => { "records" => [], "params" => {} } }, "applyadjustment" => { "rest" => { "params" => { "adjustments" => [{ "PricingVariableCode" => "REC_MNTH_STD_PRC_TOTAL", "AdjustmentCode" => "", "AdjustmentValue" => 0, "AdjustmentMethod" => "Percent", "DetailType" => "ADJUSTMENT", "Field" => "vlocity_cmt__RecurringTotal__c" }], "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY" }, "method" => "POST", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwDJQAY/items/8026A000000cCaQQAU/pricing" }, "remote" => { "params" => { "methodName" => "applyAdjustment", "adjustments" => [{ "PricingVariableCode" => "REC_MNTH_STD_PRC_TOTAL", "AdjustmentCode" => "", "AdjustmentValue" => 0, "AdjustmentMethod" => "Percent", "DetailType" => "ADJUSTMENT", "Field" => "vlocity_cmt__RecurringTotal__c" }], "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY" } }, "client" => { "records" => [], "params" => {} } }, "pricedetail" => { "rest" => { "params" => {}, "method" => "GET", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwDJQAY/items/8026A000000cCaQQAU/pricing?cartId=8016A000000bwDJQAY&id=8026A000000cCaQQAU&fields=vlocity_cmt__RecurringTotal__c" }, "remote" => { "params" => { "methodName" => "getPriceDetail", "fields" => "vlocity_cmt__RecurringTotal__c", "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY" } }, "client" => { "records" => [], "params" => {} } } } }, ``` **note:** This example result has been truncated. ### Clone with noResponseNeeded=true ```nolang POST /services/apexrest/vlocity_cmt/v2/cpq/carts/{cart_ID}/items/clone { "methodName": "cloneItems", "cartId": "{cart_ID}", "items": [{ "itemId": "{item_ID}" }], "noResponseNeeded": true, "price": true, "validate": true } ``` ```nolang { "totalSize": 0, "messages": [ { "code": "153", "severity": "INFO", "message": "Clone Successful." } ], "actions": { "itempricesupdated": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwDJQAY/price" }, "remote": { "params": { "cartId": "8016A000000bwDJQAY", "methodName": "getCartLineItemPrices" } }, "client": { "params": {} } } } } ``` # cloneMasterCart Method Clones an existing master quote or order. It copies all groups and their members. It doesn’t copy Sub Quote/Order. ## Class ## Input Parameters | Parameter | Required | Description | | ------------- | -------- | ---------------------------------------------------------------------------------------------- | | parentId | | Opportunity ID. | | masterQuoteId | | Master quote or order ID (the ID of the record that need to be cloned). | | name | | Name of the cloned master quote or order. Name shouldn’t be duplicated within the opportunity. | ## Output Parameters | Parameter | Description | | ------------ | ------------------------------------------ | | masterCartId | Master quote or order ID of cloned record. | | message | In case of any error. | ## Example Input Data ``` {"parentId":"0064x000002RPeOAAW","masterQuoteId":"0Q04x000000gUjNCAU","name":"Clone - M-2","cartType":"Quote"} ``` ## Example Output Data ``` {"masterCartId":"0Q04x000000gZbWCAU","error":"OK"} ``` # CME (Managed Package) Associated Objects This section provides a list of objects associated with the CME managed package, along with their standard fields. # Communications, Media, and Energy Application Constraints You can configure your Communications, Media, and Energy (CME) applications to remain within the operating limits or constraints of each application. Adhering to the corresponding application constraints ensures optimal performance of the CME platform. **important:** The limits outlined in this topic are not hard limits. Salesforce tests Industries CPQ with larger bundle sizes to ensure the service can handle unexpected spikes smoothly. However, factors such as your product model, the number of pricing, compatibility, and configuration rules, promotions, system load, performance, and other issues may prevent reaching these limits. The limits provided are intended as a reference when modeling products and are not a guarantee that these limits will be achievable in all situations. ## Calculation Procedures and Business Rule Engine A Calculation Procedure is a series of calculations performed on matrix lookups and user-defined variables and constants. A calculation matrix is a table that looks up information using multiple input dimensions and returns the corresponding output value. The Business Rules Engine simplifies determining eligibility or qualification and lets you automate complex decision-making to find solutions faster. The key components of Business Rules Engine are expression sets and lookup tables. Decision matrices and decision tables together constitute lookup tables. **note:** Calculation Procedures and Calculation Matrices are not supported in Omnistudio Standard Runtime. ### Matrix Row Size Limits For optimum system performance use up to 500k records for the matrix rows for Calculation Procedures and Business Rule Engine. But, Business Rule Engine can support up to 1000k records. It is recommended to use Business Rule Engine as it provides better performance and scalability compared to Calculation Procedures. You can migrate Calculation Procedures and Calculation Matrices to the Business Rules Engine. For more information, see [Calculation Matrix and Procedure Migration to Business Rules Engine](https://help.salesforce.com/s/articleView?id=sf.migrating_calc_matrix_calc_procd.htm&type=5). ## Cart and Standard APIs Limits (Without ABP) ### Cart APIs For optimum performance, ensure that total bundle size is less than 60. A bundle size is determined by a combination of the number of line items, the depth of items, and the number of attributes per line item. Here's table that provides an example configurations of the bundle. - Number of bundle: 1 - Depth: 3 child items - Total number of rules and total number of attributes are equally dustributed between OLIs. API Call: Add Item to Cart | Bundle Size
( Number of OLI)
| Total Number of Rules
- Product configuration Rule | Total Number of Rules
- Advance Rule | Total Number of Attributes
- General | Total Number of Attributes
- Picklist | | -------------------------------------------------------------- | ------------------------------------------------------ | ---------------------------------------- | ---------------------------------------- | ----------------------------------------- | | 40 | 120 | 280 | 480 | 320 | | 80 | 0 | 0 | 640 | 0 | | 91 | 15 | 5 | 450 | 0 | ### Standard Cart APIs Here's table that provides an example configurations of the bundle. - Number of bundle: 1 - Depth: 3 child items - Rule: Product configuration rule 1 per line item. - For optimum performance - The number of attributes per bundle for smaller bundle must be less than 30. - Picklist ratio (no. of picklists/no. of attributes) ideally must be less than 40%. - Maximum depth (max values in a picklist) ideally must be less than 10. API Call: Add Item to Cart | Bundle Type | Number
of
OLI | #General Attribute Per Product/OLI | #Picklist Per Product/OLI | | ------------------------------ | ------------------- | ---------------------------------- | ------------------------- | | Small Bundle
(5 to 10 LI) | 5 | 30 | 20 | | | | 0 | 50 | | | | 45 | 30 | | | 10 | 30 | 20 | | | | 0 | 50 | | | | 45 | 30 | | Medium Bundle
(15 to 20 LI) | 15 | 30 | 20 | | | | 0 | 50 | | | 20 | 15 | 10 | | | | 15 | 15 | | | | 30 | 20 | | Large Bundle
(40 to 80) | 40 | 10 | 10 | | | | 15 | 10 | | | | 20 | 10 | | | 80-100 | 5 | 5 | | | | 10 | 10 | ## Standard Cart API Limits Industries CPQ's Cart-based APIs enable users of client applications to explore and purchase products and services. To understand the limits of specific Industries CPQ's Cart-based APIs consider the following example data shape configurations. - Bundle: 20 line items - Depth: 3 child items (6 bundles x 3 child items each) - Attribute: 10 (5 General + 5 Picklist) - Rule: 1 product configuration rule per line item For the data shape mentioned above, following table lists the upper end of the limit of line items supported for the respective transaction. | Transaction Name | Maximum Lineitems Supported | | ------------------------------------------------ | --------------------------- | | Get List of Products | ~5K Product in 1 Price List | | Get Cart Items | 160 | | Add Items to Cart | 650 | | Asset to Order (assetToOrder) | 525 | | Get Cart Summary | 650 | | Run Pricing for Items to Cart | 650 | | Submit Order / Checkout Items in Cart | 470 | | Delete Cart Items(deleteCartItems) | 120 | | Delete Cart Items(deleteCartItems)- Multi Delete | 230 | The Cart APIs and The Standard Cart APIs sections above illustrate examples of acceptable bundle sizes within the guardrails for the out-of-the-box Cart APIs and Standard Cart APIs. However, if you are looking to develop custom journeys using Industries CPQ's Cart-based APIs, it is crucial to identify all the APIs you will be using and consider the lowest supported values from the table above. For instance, while the `Add Items to Cart` API supports up to 160 line items, the `Get Cart Items` function supports only 160 line items. Therefore, you should design your approach based on the lower value to ensure compatibility and performance. ## Price List Entries Classic CPQ APIs restrict SOQL queries on the PriceListEntry\_\_c object to fetch a maximum of 10,000 records. If there are over 10,000 PriceListEntry\_\_c records in a PriceList, querying/filtering is permitted solely on the Product2 related fields. | CPQ API | Sample Input Request | PLE Records | | ---------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- | | getCartsProducts with no extra input parameters | /services/apexrest/{NAMESPACE}/v2/cpq/carts/{CART_ID}/products | First 10,000 records | | getCartsProducts with the filters parameter on Product2 related fields | /services/apexrest/{NAMESPACE}/v2/cpq/carts/{CART_ID}/products?filters=Product2.ProductCode:Code1_Code2_Code3 | First 10,000 records matching the filters parameter | | getCartsProducts with the query and searchBy parameters on Product2 related fields | /services/apexrest/{NAMESPACE}/v2/cpq/carts/{CART_ID}/products?searchBy=Product2.ProductCode&query=Code1 | First 10,000 records matching the query parameters | ## Standard Digital Commerce API Limits It is recommended to have less than 50K Catalog Product Relationship for running the compiled jobs. For more information on CME application constraints, see [Salesforce Industries CME Application Constraints](https://help.salesforce.com/s/articleView?id=ind.comms_application_constraints.htm&type=5). # Configuration Required for Digital Commerce For the Digital Commerce APIs to function properly, you must configure the basic elements in this section, which include EPC, cache, and the connected app. 1. EPC Configuration and Catalog Configuration: You must set up a product catalog and ensure that it is set up correctly for the Digital Commerce APIs. For example, products should have Product Code populated, and price list entries should exist for all products that are attached to the catalog. See [Digital Commerce API Usage Considerations](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-digital-commerce-api-usage-considerations.md) for more information. 2. Cache Configuration: The Digital Commerce API cache stores catalog data for quicker retrieval of information from API calls. Digital Commerce cache management provides the ability to update or recreate the cache, for either on-platform or off-platform solution architectures. To configure the Digital Commerce API cache: 1. Run the Maintenance jobs as required: - Clear Managed Platform Cache - Product Hierarchy Maintenance - Refresh Platform Cache (Full) See [Digital Commerce Cache Management](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-cache-management.md) for more information. 2. Go to **Vlocity CMT Administration > Populate API Cache,** click **Start** and run the Cacheable API Jobs. **tip:** If your project does not use the Get Contains Offers API (which searches for all parent products and offers having the requested product as a child), then running related batch jobs may be skipped to save time and data storage. **note:** A Cache Management feature was introduced in the Winter ’20 release; any prior release requires manual deletion of cached records before job execution. To manually delete cached records, open the Developer Console and select and paste the following command:**Debug > Open Execute Anonymous Window** ```nolang delete [select Id from vlocity_cmt__CachedAPIResponse__c]; ``` 3. Configure the Connected App: To call the Digital Commerce APIs from Postman, you must first deploy a connected app in your org. The connected app handles security (OAuth in this case) and permits access to org data from external APIs. If your API calls return authorization errors, ensure the IP restrictions of the app are set correctly (Full Access). To configure the connected app: 1. In your org, go to **App Setup > Create > Apps**, then under **Connected Apps**, click **New**. 2. Fill in a **Connected App Name, API Name**, and **Contact email**, then click **Save**. 3. Under **API (Enable OAuth Settings)** select **Enable OAuth Settings**. 4. Under **Selected OAuth scope**, specify **Full Access**. 5. Under **Callback URL**, enter the following: ```nolang https://www.getpostman.com/oauth2/callback ``` Your screen should resemble the following illustration: ![Connected App Name - Postman](https://developer.salesforce.com/docs/media/postman_connectedapp.png) 6. Click **Save**. The following message displays: ```nolang Allow from 2-10 minutes for your changes to take effect on the server before using the connected app. ``` 7. When the app has been deployed, copy the **Consumer Key** and **Secret** into the environment configuration in Postman. 4. Download and Configure the Postman Environment: Update the environment configuration with your details. Follow the steps below to download a Postman configuration file that contains the necessary variables for you to run the APIs: 1. Download the environment file [here](https://volt.my.salesforce.com/sfc/p/o0000000IKm8/a/3m0000005umu/ylHiaMX54l5.SlvjJDhAN1qXnfKgjva5RXvIL2CJufY). 2. Start Postman and select the Manage Environments icon in the upper-right corner of the Postman screen. 3. Click **Import** and select the environment file you downloaded in step 4.1. 4. Configure your environment with the following values: Postman environment settings

Key

Value

URL

https://login.salesforce.com or https://test.salesforce.com depending on the type of the org used.

baseUrl

Your org name with at the end /services/apexrest/vlocity_cmt

For example:

https://demo.my.salesforce.com/services/apexrest/vlocity_cmt

username

Your org username

password

Your org password. Avoid using the "&" character in the password; Postman does not process it correctly.

clientId

The Connected app client ID.

clientSecret

The Connected app Secret.

5. Download and Install the Postman Collection: The file is a Postman collection that contains variables and configuration settings to make calling the Digital Commerce APIs quickly and easily. 1. Download the Postman collection file [here](https://volt.my.salesforce.com/sfc/p/o0000000IKm8/a/3m0000005umv/X8mm38e.7nCeHE52342fSYgZVFnI9ANWfr0Q2iJJjd8). 2. Start Postman (if necessary) and click **Import**. 3. Drag and drop the Postman collection you downloaded in step 5.1. 6. Configure Amazon Web Services (AWS) (Optional): Use the information in this section if you are using an AWS off-platform solution. AWS configuration is simple; just populate the template with the **baseUrl** and **InitAccessToken** (Salesforce Customer Support will provide these items upon provisioning an instance for your customer). Make sure that **/dc** is at the end of the URL. All API requests are designed to work with both AWS and SFDC; simply change the environment in the dropdown and issue the API call. ![AWS off-platform Environment Name](https://developer.salesforce.com/docs/media/postman_aws.png) # Configure and Basket Operations Industries Digital Commerce allows logged-in (known) users to use context eligibility rules for product configuration and basket creation. For Configure and Basket operations, context eligibility rules are supported to determine Pricing for known users only. When you configure a product offer, you can apply a promotion or a price adjustment. However, the adjustment amount identified when applying a promotion should be based on a condition.  The condition is defined as a context eligibility rule. When you apply a price adjustment or promotion, you can associate it with a context rule. For example, in a bundle, you can have a child product where you can override the product pricing, including the child item price, and apply context eligibility rules. The condition is that the discount only applies if the following context rule applies: Account = SLA_GOLD. If the context rule for SLA_GOLD exists, then the pricing adjustment applies (as part of a bundle, the child item may be less expensive than if sold separately). A typical conversion funnel in e-commerce illustrates the route your customers take from first becoming aware of your brand, to configuring a product, to creating a cart with the product, to making a purchase. ![eCommerce conversion funnel shows the route your customers take from first becoming aware of your brand to making a purchase](https://developer.salesforce.com/docs/media/dc_ecommfunnel_cfg_and_basket.png) # Configure Remote Site Setting To update the cache when you are using an off-platform solution, you need to configure a remote site setting. 1. From Setup, in the **Quick Find** box, enter `Remote Site`. 2. Click Remote Site Settings. 3. Click New Remote Site. 4. Add the following remote site details: - **Name**: `DCGCacheMigration` - **Remote Site URL**: The URL for the external system. - **Active**: True 5. Click Save. For example: ![Configure Remote Site Setting](https://developer.salesforce.com/docs/media/migrate_cache_remote_site.png) Configure, Price, Quote (CPQ) REST APIs # Configure, Price, Quote (CPQ) REST APIs **Partial reference:** 1 operation(s) were omitted because their source references could not be resolved. Industries Configure, Price, Quote Web APIs (CPQ APIs) enable client application users to shop for and order products and services. The CPQ APIs provide a layer of abstraction between the client app developers and the CPQ developers who are configuring and customizing the underlying CPQ logic. * V2 of the CPQ APIs simplifies the APIs for mobile and external app development. The v2 APIs are the default APIs used by Industries applications. Base URL for the apis described is 'xx##.salesforce.com/services/apexrest/vlocity\_cmt/v2'. * To refer and access CPQ APIs swagger file (DEPRECATED), click [here](https://resources.docs.salesforce.com/rel1/doc/en-us/static/misc/cpqapi.yaml.zip) to download. You can use an editor like editor.swagger.io to view the swagger based API doc. **Version:** Summer 2024 ## Servers * `https://{MyDomainLoginUrl}.salesforce.com/services/apexrest/vlocity_cmt/v2` Protocols: https. ## Operations ### POST Create Cart `POST /carts` Operation ID: `CreateCart`. Tags: Cart. Creates an opportunity, order, or quote based on the subaction specified in the request body. Subaction also defines method of creation. NOTE: The inputFields is not supported for AssetToOrder (subaction as assetToOrder). Subactions supported include. **createOrder** - Create an empty order from the specified inputs. **createQuote** - Create an empty quote from the specified inputs. **createOppty** - Create an empty opportunity from the specified inputs. **assetToOrder** - Create a change order initially populated from the specified assets. **assetToQuote** - Create a quote for changes initially populated from the specified assets. **assetChangeSite** - Create a change order to request moving the specified assets from one service location to another. \*\* Rest Handler - CpqCreateCartActionV2. Method Invoked - postCartItems.\*\* #### Request body (required) Different request bodies must be used for each of the different subactions. #### createOrder Request Example ```json { "subaction":"createOrder", "inputFields":[ { "effectivedate":"2017-12-25" }, { "status":"Draft" }, { "Name":"New customer order" }, { "AccountId":"0016A0000053kHN" }, { "Pricebook2Id":"01s6A000002Y7wz" }, { "pricebookName":"GeneralPricebook" }, { "pricelistName":"GeneralPricelist" }, { "vlocity_cmt__OriginatingChannel__c":"Retail" } ], "fields":"Id,Name,EffectiveDate,AccountId,Account.Name,vlocity_cmt__EffectiveRecurringTotal__c,vlocity_cmt__EffectiveOneTimeTotal__c,vlocity_cmt__EffectiveOrderTotal__c,TotalAmount,vlocity_cmt__OriginatingChannel__c,OrderNumber,OrderReferenceNumber,Pricebook2Id,pricebookName,pricelistName" } ``` #### createQuote Request Example ```json { "subaction":"createQuote", "inputFields":[ { "AccountId":"0016A0000053kHN" }, { "OpportunityId":"0066A000002aVklQAE" }, { "status":"Draft" }, { "Name":"New customer quote" }, { "Pricebook2Id":"01s6A000002Y7wz" }, { "pricebookName":"GeneralPricebook" }, { "pricelistName":"GeneralPricelist" }, { "vlocity_cmt__OriginatingChannel__c":"Retail" } ], "fields":"Id,QuoteNumber,Name,OpportunityId,Status,AccountId,Account.Name,vlocity_cmt__EffectiveRecurringTotal__c,vlocity_cmt__EffectiveOneTimeTotal__c,vlocity_cmt__EffectiveQuoteTotal__c,GrandTotal,vlocity_cmt__OriginatingChannel__c,pricebookName,pricelistName" } ``` #### createOppty Request Example ```json { "subaction":"createOppty", "inputFields":[ { "AccountId":"0016A0000053kHN" }, { "StageName":"Prospecting" }, { "Name":"New customer opportunity" }, { "Type":"New Customer" }, { "CloseDate":"2017-12-25" }, { "vlocity_cmt__NumberOfContractedMonths__c":24 }, { "Pricebook2Id":"01s6A000002Y7wz" }, { "pricebookName":"GeneralPricebook" }, { "pricelistName":"GeneralPricelist" }, { "vlocity_cmt__OriginatingChannel__c":"Dealer" } ], "fields":"Id,Name,AccountId,Account.Name,vlocity_cmt__EffectiveRecurringTotal__c,vlocity_cmt__EffectiveOneTimeTotal__c,vlocity_cmt__EffectiveOpportunityTotal__c,Amount,vlocity_cmt__OriginatingChannel__c,pricebookName,pricelistName" } ``` #### assetToOrder Request Example ```json { "subaction":"assetToOrder", "id":"01t36000000pfcKAAQ,02i6A000000YEXN", "accountId":"0016A0000072D3y", "requestDate":"2017-12-01" } ``` For assetToOrder, if future-dated order is not available, the requestDate should be greater than or equal to current date. If a future dated order(s) is/are available for that asset, the requestDate should be greater than or equal to current date and should be greater than or equal to the date on all the future dated orders of the asset. For assetToOrder, the field id can be a list of all assets or just the root asset. The child assets will be retrived from the root asset. #### assetToQuote Request Example ```json { "subaction":"assetToQuote", "listTypeAsset":"Service", "assetIdList":[ "02i5g000000tDi8" ], "accountId":"0015g000002vauG", "quoteId":"0065g000002fIKa", "opportunityId":null, "validate":false, "price":false } ``` For assetToQuote, the parametrs "quoteId","oportunityId","validate", and "price" are optional parameters. If the user passes quoteId, then opportunityId will be ignored. If the user passes opportunityId, but not quoteId, then the API will create a new Quote for that opportunity and move assets to the created quote. If the user passes neither quoteId not opportunityId, then the API will create a new opportunity record and a new quote for that opportunity. It will then move assets to the created quote. Default values of "validate" and "price" is true. User can pass false and turn off pricing and validation. #### assetChangeSite Request Example ````json { "OrderId":"8014x000000Y8ZzAAK" "moveOutDate":"2021-03-12", "assetIdList": ["02i4x000000YzIb"], "moveInAccountId":"0014x00000GSjX5", "moveOutAccountId":"0014x00000Ds89r", "subaction":"assetChangeSite" } ``` For assetChangeSite, the parameter "OrderId" is an optional parameter. If user doesn't pass the OrderId, then new Order will be created in the parent Account of moveIn Account. If no parent Account exists, then order will be created in the move Out account. The format of "moveOutDate" parameter should be YYYY-MM-DD. The API expects Ids of all assets in a bundle to be passed-in in "assetIdList" parameter. If only some of the Ids of an Asset bundle is passed, then only the passed-in asset Ids will be considered for "Move Order" creation. It will result in incorrect "move order" behaviour. ```` Media type: `application/json`. Schema: `CreateOrderBody`. #### Responses * **200** OK - API request processed. Look for messages in the response to determine if it succeeded or failed. Media type: `application/json`. Schema: `CreateCartResult`. * **400** Bad Request - Invalid subaction or Invalid Parameters ### GET Get Assets List `GET /cpq/assets` Operation ID: `GetAssetsList`. Tags: Assets. Returns a list of assets Rest Handler - V2GetAssetsService Method Invoked - execute #### Parameters * `fields` (query, array of string, collection format: csv) List of fields to return in the response, separated by commas. _Example_ ``` Id,Name ``` * `pagesize` (query, integer) Number of records to be returned. _Example_ ``` 10 ``` * `filters` (query, string) Filter field values. _Example_ ``` vlocity_cmt__AppliesTo__c:Account_Contract ``` * `offsetSize` (query, integer) Offset from which to start reading products, for pagination. _Example_ ``` 2 ``` * `sortBy` (query, string) Used to sort based on field(s). _Example_ ``` Name_DESC ``` * `searchBy` (query, string) Used for text searching. _Example_ ``` searchBy:hello ``` * `query` (query, string) Term used to search on result records. _Example_ ``` bundle ``` #### Responses * **200** OK - API request processed. Look for messages in the response to determine if it succeeded or failed. #### Get Cart Items Response Example ```json { "totalSize": 1, "actions": { "nexttranslation": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/cmt_v102/v2/cpq/assets?pagesize=1&offsetSize=1¤tPage=2" }, "remote": { "params": {} }, "client": { "params": {} } } }, "records": [{ "displaySequence": -1, "Id": { "value": "02i4x0000001MNCAA2", "previousValue": null, "originalValue": null, "messages": [], "label": "Asset ID", "hidden": true, "fieldName": "Id", "editable": false, "dataType": "ID", "alternateValues": null, "actions": {} }, "Quantity": { "value": 1.00, "previousValue": null, "originalValue": null, "messages": [], "label": "Quantity", "hidden": true, "fieldName": "Quantity", "editable": false, "dataType": "DOUBLE", "alternateValues": null, "actions": {} }, "AccountId": { "value": "0014x00000AdQpyAAF", "previousValue": null, "originalValue": null, "messages": [], "label": "Account ID", "hidden": false, "fieldName": "AccountId", "editable": false, "dataType": "REFERENCE", "alternateValues": null, "actions": {} }, "vlocity_cmt__AssetReferenceId__c": { "value": "fe373aa5-d753-c7cf-aab6-b7aeaba324f0", "previousValue": null, "originalValue": null, "messages": [], "label": "Asset Reference Id", "hidden": true, "fieldName": "vlocity_cmt__AssetReferenceId__c", "editable": false, "dataType": "STRING", "alternateValues": null, "actions": {} }, "vlocity_cmt__OneTimeTotal__c": { "value": 246.00, "previousValue": null, "originalValue": null, "messages": [], "label": "One Time Total", "hidden": true, "fieldName": "vlocity_cmt__OneTimeTotal__c", "editable": false, "dataType": "CURRENCY", "alternateValues": null, "actions": {} }, "vlocity_cmt__LineNumber__c": { "value": "0001", "previousValue": null, "originalValue": null, "messages": [], "label": "Line Number", "hidden": true, "fieldName": "vlocity_cmt__LineNumber__c", "editable": false, "dataType": "STRING", "alternateValues": null, "actions": {} }, "vlocity_cmt__RootItemId__c": { "value": "02i4x0000001MNCAA2", "previousValue": null, "originalValue": null, "messages": [], "label": "RootItemId", "hidden": true, "fieldName": "vlocity_cmt__RootItemId__c", "editable": false, "dataType": "STRING", "alternateValues": null, "actions": {} }, "vlocity_cmt__OneTimeCharge__c": { "value": 82.00, "previousValue": null, "originalValue": null, "messages": [], "label": "One Time Charge", "hidden": true, "fieldName": "vlocity_cmt__OneTimeCharge__c", "editable": false, "dataType": "CURRENCY", "alternateValues": null, "actions": {} }, "vlocity_cmt__SequenceNumber__c": { "value": 1, "previousValue": null, "originalValue": null, "messages": [], "label": "Sequence Number", "hidden": true, "fieldName": "vlocity_cmt__SequenceNumber__c", "editable": false, "dataType": "DOUBLE", "alternateValues": null, "actions": {} }, "Name": "P-10154", "childAssets": { "totalSize": 0, "records": [{ "displaySequence": -1, "Id": { "value": "02i4x0000001MNDAA2", "previousValue": null, "originalValue": null, "messages": [], "label": "Asset ID", "hidden": true, "fieldName": "Id", "editable": false, "dataType": "ID", "alternateValues": null, "actions": {} }, "Quantity": { "value": 1.00, "previousValue": null, "originalValue": null, "messages": [], "label": "Quantity", "hidden": true, "fieldName": "Quantity", "editable": false, "dataType": "DOUBLE", "alternateValues": null, "actions": {} }, "AccountId": { "value": "0014x00000AdQpyAAF", "previousValue": null, "originalValue": null, "messages": [], "label": "Account ID", "hidden": false, "fieldName": "AccountId", "editable": false, "dataType": "REFERENCE", "alternateValues": null, "actions": {} }, "vlocity_cmt__AssetReferenceId__c": { "value": "7be2d313-c6db-648c-d100-ec54d09975d9", "previousValue": null, "originalValue": null, "messages": [], "label": "Asset Reference Id", "hidden": true, "fieldName": "vlocity_cmt__AssetReferenceId__c", "editable": false, "dataType": "STRING", "alternateValues": null, "actions": {} }, "vlocity_cmt__OneTimeTotal__c": { "value": 164.00, "previousValue": null, "originalValue": null, "messages": [], "label": "One Time Total", "hidden": true, "fieldName": "vlocity_cmt__OneTimeTotal__c", "editable": false, "dataType": "CURRENCY", "alternateValues": null, "actions": {} }, "vlocity_cmt__LineNumber__c": { "value": "0001.0001", "previousValue": null, "originalValue": null, "messages": [], "label": "Line Number", "hidden": true, "fieldName": "vlocity_cmt__LineNumber__c", "editable": false, "dataType": "STRING", "alternateValues": null, "actions": {} }, "vlocity_cmt__RootItemId__c": { "value": "02i4x0000001MNCAA2", "previousValue": null, "originalValue": null, "messages": [], "label": "RootItemId", "hidden": true, "fieldName": "vlocity_cmt__RootItemId__c", "editable": false, "dataType": "STRING", "alternateValues": null, "actions": {} }, "vlocity_cmt__ParentItemId__c": { "value": "02i4x0000001MNCAA2", "previousValue": null, "originalValue": null, "messages": [], "label": "ParentItemId", "hidden": true, "fieldName": "vlocity_cmt__ParentItemId__c", "editable": false, "dataType": "STRING", "alternateValues": null, "actions": {} }, "vlocity_cmt__OneTimeCharge__c": { "value": 82.00, "previousValue": null, "originalValue": null, "messages": [], "label": "One Time Charge", "hidden": true, "fieldName": "vlocity_cmt__OneTimeCharge__c", "editable": false, "dataType": "CURRENCY", "alternateValues": null, "actions": {} }, "vlocity_cmt__SequenceNumber__c": { "value": 0, "previousValue": null, "originalValue": null, "messages": [], "label": "Sequence Number", "hidden": true, "fieldName": "vlocity_cmt__SequenceNumber__c", "editable": false, "dataType": "DOUBLE", "alternateValues": null, "actions": {} }, "Name": "V1-10154", "childAssets": { "totalSize": 0, "records": [{ "displaySequence": -1, "Id": { "value": "02i4x0000001MNEAA2", "previousValue": null, "originalValue": null, "messages": [], "label": "Asset ID", "hidden": true, "fieldName": "Id", "editable": false, "dataType": "ID", "alternateValues": null, "actions": {} }, "Quantity": { "value": 1.00, "previousValue": null, "originalValue": null, "messages": [], "label": "Quantity", "hidden": true, "fieldName": "Quantity", "editable": false, "dataType": "DOUBLE", "alternateValues": null, "actions": {} }, "AccountId": { "value": "0014x00000AdQpyAAF", "previousValue": null, "originalValue": null, "messages": [], "label": "Account ID", "hidden": false, "fieldName": "AccountId", "editable": false, "dataType": "REFERENCE", "alternateValues": null, "actions": {} }, "vlocity_cmt__AssetReferenceId__c": { "value": "b1dd9ab7-0e46-de7c-4d54-a2ebc3e14802", "previousValue": null, "originalValue": null, "messages": [], "label": "Asset Reference Id", "hidden": true, "fieldName": "vlocity_cmt__AssetReferenceId__c", "editable": false, "dataType": "STRING", "alternateValues": null, "actions": {} }, "vlocity_cmt__OneTimeTotal__c": { "value": 82.00, "previousValue": null, "originalValue": null, "messages": [], "label": "One Time Total", "hidden": true, "fieldName": "vlocity_cmt__OneTimeTotal__c", "editable": false, "dataType": "CURRENCY", "alternateValues": null, "actions": {} }, "vlocity_cmt__LineNumber__c": { "value": "0001.0001.0001", "previousValue": null, "originalValue": null, "messages": [], "label": "Line Number", "hidden": true, "fieldName": "vlocity_cmt__LineNumber__c", "editable": false, "dataType": "STRING", "alternateValues": null, "actions": {} }, "vlocity_cmt__RootItemId__c": { "value": "02i4x0000001MNCAA2", "previousValue": null, "originalValue": null, "messages": [], "label": "RootItemId", "hidden": true, "fieldName": "vlocity_cmt__RootItemId__c", "editable": false, "dataType": "STRING", "alternateValues": null, "actions": {} }, "vlocity_cmt__ParentItemId__c": { "value": "02i4x0000001MNDAA2", "previousValue": null, "originalValue": null, "messages": [], "label": "ParentItemId", "hidden": true, "fieldName": "vlocity_cmt__ParentItemId__c", "editable": false, "dataType": "STRING", "alternateValues": null, "actions": {} }, "vlocity_cmt__OneTimeCharge__c": { "value": 82.00, "previousValue": null, "originalValue": null, "messages": [], "label": "One Time Charge", "hidden": true, "fieldName": "vlocity_cmt__OneTimeCharge__c", "editable": false, "dataType": "CURRENCY", "alternateValues": null, "actions": {} }, "vlocity_cmt__SequenceNumber__c": { "value": 1, "previousValue": null, "originalValue": null, "messages": [], "label": "Sequence Number", "hidden": true, "fieldName": "vlocity_cmt__SequenceNumber__c", "editable": false, "dataType": "DOUBLE", "alternateValues": null, "actions": {} }, "Name": "C1-10154" } ] } } ] } } ] } ``` ### GET Get Cart Summary `GET /cpq/carts/{cartid}` Operation ID: `Get Cart Summary`. Tags: Cart. Returns a summary representation of the cart including: + Pricing information, such as total one-time charge and total recurring charge + Account information associated with this cart + If this cart includes a multisite order, available sites + Links to further actions, such as _check out_ Rest Handler - CpqCreateCartActionV2 Method Invoked - getCarts #### Parameters * `cartid` (path, string, required) Cart ID (Salesforce ID). Opportunity, Quote or Order ID. _Example_ ``` 801360000000oQ9 ``` * `validate` (query, boolean) Indicates whether validation rules are run for the current API request (true) or not (false). Default: `true`. _Example_ ``` true ``` * `price` (query, boolean) Indicates whether to run the pricing engine (true) or not (false). Default: `true`. _Example_ ``` true ``` * `headerFieldSet` (query, string) Name of a Salesforce Field Set defined for the given cart object (Opportunity, Quote, Order) which identifies the fields to return in the response. Omitting this parameter will return all fields from the cart object except the following fields: IsDeleted, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp, LastActivityDate, CleanStatus. _Example_ ``` fieldSetFeature ``` * `translation` (query, boolean) to get translated labels, default is true (CMT 101) _Example_ ``` true ``` #### Responses * **200** OK - API request processed. Look for messages in the response to determine if it succeeded or failed. Media type: `application/json`. Schema: `CartResult`. ### PUT Update Cart Summary `PUT /cpq/carts/{cartid}` Operation ID: `UpdateCartSummary`. Tags: Cart. Update the cart summary. Rest Handler - APICartsCpqV2. Method Invoked - updateCarts #### Parameters * `cartid` (path, string, required) Cart ID (Salesforce ID). Opportunity, Quote or Order ID. _Example_ ``` 801360000000oQ9 ``` #### Request body (required) Request Body with input fields. #### Update Cart Request Example ```json { "inputFields":[ { "Pricebook2Id":"01s6A000002Y7wz" }, ], "fields":"Id,Name" } ``` Media type: `application/json`. Schema: `UpdateCartBody`. #### Responses * **200** OK - API request processed. Look for messages in the response to determine if it succeeded or failed. ### GET Get Filterable Attributes `GET /cpq/carts/{cartid}/attributes` Operation ID: `GetFilterableAttributes`. Tags: Cart. Return the filterable attributes that are applicable for this cart, including Product attributes. The Product attribute values that the customer can choose to filter Products Rest Handler - APICartsAttributesCpqV2 Method Invoked - getCartsAttributes #### Parameters * `cartid` (path, string, required) Cart ID (Salesforce ID). Opportunity, Quote or Order ID. _Example_ ``` 801360000000oQ9 ``` #### Responses * **200** Return the filterable attributes that are applicable for this cart Media type: `application/json`. Schema: `CartAttributeDetail`. ### POST Runs validation and pricing for the items in the cart. `POST /cpq/carts/{cartid}/validate` Operation ID: `validate-POST`. Tags: Cart. Runs validation and pricing for the items in the cart. #### Parameters * `cartid` (path, string, required) Cart ID (Salesforce ID). Opportunity, Quote or Order ID. _Example_ ``` 801360000000oQ9 ``` * `price` (query, boolean) Indicates whether to run the pricing engine (true) or not (false). Default: `true`. _Example_ ``` true ``` * `validate` (query, boolean) Indicates whether validation rules are run for the current API request (true) or not (false). Default: `true`. _Example_ ``` true ``` #### Request body Request Body with cartId - required #### Validate Cart Request Example ```json { "cartId":"8011N00000157LkQAI", "methodName":"runCartValidation", "price":true, "validate":true } ``` Media type: `application/json`. Schema: `ValidateCartBody`. #### Responses * **200** OK - API request processed. Look for messages in the response to determine if it succeeded or failed. Rest Handler - validate Method Invoked - runCartValidation Media type: `application/json`. Schema: `ValidateCartResponse`. ### GET Get Cart Items `GET /cpq/carts/{cartid}/items` Operation ID: `Get Cart Items`. Tags: Cart. Get a representation of the items in a specified cart. Rest Handler - APIItemsCartsCpqV2 Method Invoked - getCartsItems #### Parameters * `cartid` (path, string, required) Cart ID (Salesforce ID). Opportunity, Quote or Order ID. _Example_ ``` 801360000000oQ9 ``` * `query` (query, string) Search text _Example_ ``` iphone+6s ``` * `id` (query, string) List of comma separated itemIds to return only the corresponding cart Items _Example_ ``` 01u41000001QPtsAAG ``` * `lastRecordId` (query, string) The last record ID from the previous search result, if available. _Example_ ``` 01uf4000001q1W3AAI ``` * `pagesize` (query, integer) Number of records to be returned. _Example_ ``` 10 ``` * `hierarchy` (query, integer) Specifies product hierarchy. _Example_ ``` 2 ``` * `includeAttachment` (query, boolean) Indicates whether product attachments are returned (true) or not (false). _Example_ ``` true ``` * `fields` (query, array of string, collection format: csv) List of fields to return in the response, separated by commas. _Example_ ``` Id,Name ``` * `filter` (query, string) Filter field values. _Example_ ``` vlocity_cmt__ServiceAccountId__c:991360000008eNU_991360000008eNY ``` * `price` (query, boolean) Indicates whether to run the pricing engine (true) or not (false). Default: `true`. _Example_ ``` true ``` * `validate` (query, boolean) Indicates whether validation rules are run for the current API request (true) or not (false). Default: `true`. _Example_ ``` true ``` #### Responses * **200** OK - API request processed. Look for messages in the response to determine if it succeeded or failed. #### Get Cart Items Response Example ```json { "totalSize": 1, "messages": [], "records": [{ "messages": [], "actions": { "addtocart": { "rest": { "params": { "includeAttachment": false, "pagesize": 5, "lastRecordId": null, "hierarchy": 0, "query": null, "itemId": "01u41000001QPtsAAG" }] }, "method": "POST", "link": "/services/apexrest/vlocity_cmt__/v2/cpq/carts/80141000000Cg8HAAS/items" }, "remote": { "params": { "price": true, "validate": true, "includeAttachment": false, "pagesize": 10 "lastRecordId": null, "hierarchy": 0, "query": null, "items": [{ "parentId": "80241000000HalcAAC", "quantity": 1, "itemId": "01u41000001QPtsAAG" }], "cartId": "80141000000Cg8HAAS", "methodName": "postCartsItems" } }, "client": { "params": {} } }, "updateitems": { "rest": { "params": { "fields": null, "price": true, "validate": true, "filters": null, "hierarchy": 0, "includeAttachment": false, "pagesize": 5, "lastRecordId": null, "query": null, "items": [{ "itemId": "80241000000HalcAAC" }] }, "method": "PUT", "link": "/services/apexrest/vlocity_cmt__/v2/cpq/carts/80141000000Cg8HAAS/items" }, "remote": { "params": { "fields": null, "price": true, "validate": true, "filters": null, "hierarchy": 0, "includeAttachment": false, "pagesize": 5, "lastRecordId": null, "query": null, "items": [{ "itemId": "80241000000HalcAAC" }], "cartId": "80141000000Cg8HAAS", "methodName": "putCartsItems" } }, "client": { "params": {} } }, "displaySequence": -1, "Id": { "value": "80241000000HalcAAC", "messages": [], "label": "Order Product ID", "hidden": false, "fieldName": "Id", "editable": false, "dataType": "ID", "actions": {} }, "Pricebook2Id": "01s41000005dPYQAA2", "Product2Id": "01t41000000sYaSAAU", "UnitPrice": { "value": 1.00, "messages": [], "label": "Unit Price", "hidden": false, "fieldName": "UnitPrice", "editable": true, "dataType": "CURRENCY", "actions": {} }, "Name": "GC 2", "IsActive": true, "Product2": { "attributes": { "type": "Product2", "url": "/services/data/v38.0/sobjects/Product2/01t41000000sYaSAAU" }, "Id": "01t41000000sYaSAAU", "Name": "GC 2", "vlocity_cmt__IsConfigurable__c": false, "vlocity_cmt__Type__c": "None", "vlocity_cmt__SubType__c": "None", "RecordTypeId": "012410000006OWUAA2", "vlocity_cmt__JSONAttribute__c": null }, "productId": "01t41000000sYaSAAU", "defaultQuantity": 1.0, "minQuantity": 0.0, "maxQuantity": 99999.0, "groupMinQuantity": 0, "groupMaxQuantity": 99999, "sequenceNumber": 1.00, "productChildItemDefinition": { "attributes": { "type": "vlocity_cmt__ProductChildItem__c", "url": "/services/data/v38.0/sobjects/vlocity_cmt__ProductChildItem__c/a2541000000G0AGAA0" }, "Id": "a2541000000G0AGAA0", "Name": "Root PCI", "vlocity_cmt__IsVirtualItem__c": false, "vlocity_cmt__Quantity__c": 1, "vlocity_cmt__MaxQuantity__c": 99999, "vlocity_cmt__MinQuantity__c": 0, "vlocity_cmt__MaximumChildItemQuantity__c": 99999, "vlocity_cmt__MinimumChildItemQuantity__c": 0, "vlocity_cmt__IsOverride__c": false, "vlocity_cmt__ParentProductId__c": "01t41000000sYaSAAU", "vlocity_cmt__ChildLineNumber__c": "1", "vlocity_cmt__SeqNumber__c": 1.00, "vlocity_cmt__CollapseHierarchy__c": false, "vlocity_cmt__IsRootProductChildItem__c": true, "vlocity_cmt__ParentProductId__r": { "attributes": { "type": "Product2", "url": "/services/data/v38.0/sobjects/Product2/01t41000000sYaSAAU" }, "Id": "01t41000000sYaSAAU", "Name": "GC 2" } }, "productHierarchyPath":"01t41000000sYaSAAU", "name": "GC 2", "isVirtualItem": false, "itemType": "lineItem", "PricebookEntryId": { "value": "01u41000001QPtsAAG", "messages": [], "label": "Price Book Entry ID", "hidden": false, "fieldName": "PricebookEntryId", "editable": false, "dataType": "REFERENCE", "actions": {} }, "Quantity": { "value": 1.00, "messages": [], "label": "Quantity", "hidden": false, "fieldName": "Quantity", "editable": true, "dataType": "DOUBLE", "actions": {} }, "vlocity_cmt__OneTimeTotal__c": { "value": 1.00, "messages": [], "label": "One Time Total", "hidden": false, "fieldName": "vlocity_cmt__OneTimeTotal__c", "editable": false, "dataType": "CURRENCY", "actions": {} }, "vlocity_cmt__SupplementalAction__c": { "value": "Amend" "messages": [], "label": "Supplemental Action", "hidden": false, "fieldName": "vlocity_cmt__SupplementalAction__c", "editable": true, "dataType": "REFERENCE", "actions": {} }, "vlocity_cmt__RecurringTotal__c": { "value": 0.00, "messages": [], "label": "Recurring Total", "hidden": false, "fieldName": "vlocity_cmt__RecurringTotal__c", "editable": false, "dataType": "CURRENCY", "actions": {} }, "vlocity_cmt__OneTimeCharge__c": { "value": 1.00, "messages": [], "label": "One Time Charge", "hidden": false, "fieldName": "vlocity_cmt__OneTimeCharge__c", "editable": false, "dataType": "CURRENCY", "actions": {} }, "vlocity_cmt__OneTimeCalculatedPrice__c": { "value": 1.00, "messages": [], "label": "One Time Calculated Price", "hidden": false, "fieldName": "vlocity_cmt__OneTimeCalculatedPrice__c", "editable": true, "dataType": "CURRENCY", "actions": {} }, "vlocity_cmt__OneTimeManualDiscount__c": { "value": 0.00, "messages": [], "label": "One Time Manual Discount", "hidden": false, "fieldName": "vlocity_cmt__OneTimeManualDiscount__c", "editable": true, "dataType": "PERCENT", "actions": {} }, "vlocity_cmt__RecurringCharge__c": { "value": 0.00, "messages": [], "label": "Recurring Charge", "hidden": false, "fieldName": "vlocity_cmt__RecurringCharge__c", "editable": false, "dataType": "CURRENCY", "actions": {} }, "vlocity_cmt__RecurringCalculatedPrice__c": { "value": 0.00, "messages": [], "label": "Recurring Calculated Price", "hidden": false, "fieldName": "vlocity_cmt__RecurringCalculatedPrice__c", "editable": true, "dataType": "CURRENCY", "actions": {} }, "vlocity_cmt__RecurringManualDiscount__c": { "value": 0.00, "messages": [], "label": "Recurring Manual Discount", "hidden": false, "fieldName": "vlocity_cmt__RecurringManualDiscount__c", "editable": true, "dataType": "PERCENT", "actions": {} }, "PricebookEntry": { "attributes": { "type": "PricebookEntry", "url": "/services/data/v38.0/sobjects/PricebookEntry/01u41000001QPtsAAG" }, "Id": "01u41000001QPtsAAG", "Product2Id": "01t41000000sYaSAAU", "Pricebook2Id": "01s41000005dPYQAA2", "Product2": { "attributes": { "type": "Product2", "url": "/services/data/v38.0/sobjects/Product2/01t41000000sYaSAAU" }, "Id": "01t41000000sYaSAAU", "Name": "GC 2", "vlocity_cmt__Type__c": "None", "vlocity_cmt__IsConfigurable__c": false } }, "vlocity_cmt__ServiceAccountId__r": { "attributes": { "type": "Account", "url": "/services/data/v38.0/sobjects/Account/00141000007uyWYAAY" }, "Id": "00141000007uyWYAAY", "Name": "telus test" }, "vlocity_cmt__BillingAccountId__r": { "attributes": { "type": "Account", "url": "/services/data/v38.0/sobjects/Account/00141000007uyWYAAY" }, "Id": "00141000007uyWYAAY", "Name": "telus test" }, "vlocity_cmt__InCartQuantityMap__c": { "value": null, "messages": [], "label": "InCartQuantityMap", "hidden": false, "fieldName": "vlocity_cmt__InCartQuantityMap__c", "editable": true, "dataType": "TEXTAREA", "actions": {} }, "vlocity_cmt__JSONAttribute__c": { "value": null, "messages": [], "label": "JSONAttribute", "hidden": false, "fieldName": "vlocity_cmt__JSONAttribute__c" "editable": true, "dataType": "TEXTAREA", "actions": {} } }] } ``` ``` ### PUT Update Item(s) in a Cart `PUT /cpq/carts/{cartid}/items` Operation ID: `Update Items in a Cart`. Tags: Cart. Update one or more items in a specified cart. Rest Handler - APIItemsCartsCpqV2 Method Invoked - putCartsItems #### Parameters * `cartid` (path, string, required) Cart ID (Salesforce ID). Opportunity, Quote or Order ID. _Example_ ``` 801360000000oQ9 ``` #### Request body Request Body with input fields #### Update Items in Cart Request Example ```json { "items": { "records": [ { "attributeCategories": { "totalSize": 0, "records": [ { "displaySequence": 7879, "Code__c": "CATEGORY_CODE-78231", "id": "a0K1I000002VwDEUA0", "productAttributes": { "totalSize": 0, "records": [ { "code": "CODE-70207", "dataType": "number", "inputType": "number", "required": false, "readonly": false, "disabled": false, "filterable": true, "attributeId": "a0L1I00000107vJUAQ", "label": "ATTRIBUTE-54063", "displaySequence": -1, "userValues": "9", "min": 0, "max": 0, "values": [ { "readonly": false, "disabled": false } ] } ] }, "Name": "ATTRIBUTE_CATEGORY-41131" } ] }, "PricebookEntry": { "Product2Id": "01t1I000001Q9PIQA0", "Pricebook2Id": "01s1I000006oNmAQAU", "Id": "01u1I000001sNdiQAE", "Product2": { "Name": "PRODUCT-68097", "Id": "01t1I000001Q9PIQA0", "vlocity_cmt__Type__c": "None", "vlocity_cmt__IsConfigurable__c": "false" } } } ] } } ``` Media type: `application/json`. Schema: `ValidateCartResponse`. #### Responses * **200** OK - API request processed. Look for messages in the response to determine if it succeeded or failed. #### Update Cart Items response ```json { "totalSize": 1, "messages": [ { "code": "161", "severity": "INFO", "message": "Attributes modified successfully." } ], "records": [ { "messages": [ ], "displaySequence": -1, "PricebookEntry": { "Product2Id": "01t1I000001Q9PIQA0", "Pricebook2Id": "01s1I000006oNmAQAU", "Id": "01u1I000001sNdiQAE", "Product2": { "vlocity_cmt__IsConfigurable__c": "false", "vlocity_cmt__Type__c": "None", "Id": "01t1I000001Q9PIQA0", "Name": "PRODUCT-68097" } }, "attributeCategories": { "totalSize": 1, "messages": [ ], "records": [ { "messages": [ ], "displaySequence": 7879, "Code__c": "CATEGORY_CODE-78231", "Name": "ATTRIBUTE_CATEGORY-41131", "id": "a0K1I000002VwDEUA0", "productAttributes": { "totalSize": 3, "messages": [ ], "records": [ { "messages": [ ], "code": "CODE-77007", "dataType": "number", "inputType": "number", "required": true, "readonly": false, "disabled": false, "filterable": true, "attributeId": "a0L1I00000107vOUAQ", "label": "ATTRIBUTE-29707", "displaySequence": -1, "hasRules": true, "hidden": false, "values": [ { "readonly": false, "disabled": false } ], "userValues": null }, { "messages": [ ], "code": "CODE-70207", "dataType": "number", "inputType": "number", "required": false, "readonly": false, "disabled": false, "filterable": true, "attributeId": "a0L1I00000107vJUAQ", "label": "ATTRIBUTE-54063", "displaySequence": -1, "hasRules": true, "hidden": false, "values": [ { "readonly": false, "disabled": false, "value": 9 } ], "userValues": 9 }, { "messages": [ ], "code": "CODE-40063", "dataType": "number", "inputType": "number", "required": false, "readonly": false, "disabled": false, "filterable": true, "attributeId": "a0L1I00000107vTUAQ", "label": "ATTRIBUTE-77042", "displaySequence": -1, "hasRules": true, "hidden": false, "values": [ { "readonly": false, "disabled": false } ], "userValues": null } ] } } ] } } ] } ``` ### POST Add Item(s) to a Cart `POST /cpq/carts/{cartid}/items` Operation ID: `Add Items to a Cart`. Tags: Cart. Add one or more items to a specified cart. * Rest Handler * APIItemsCartsCpqV2 Method Invoked - postCartsItems * Spring 2020 enhancements (see examples below) * Additional support for Multi Add/delete of Root & child items * **noResponseNeeded** (set to **true**) will return just success or failure #### Parameters * `cartid` (path, string, required) Cart ID (Salesforce ID). Opportunity, Quote or Order ID. _Example_ ``` 801360000000oQ9 ``` * `itemId` (path, string, required) Line Item ID under the cart. _Example_ ``` 80236000009E2InAAK ``` * `price` (query, boolean) Indicates whether to run the pricing engine (true) or not (false). Default: `true`. _Example_ ``` true ``` * `validate` (query, boolean) Indicates whether validation rules are run for the current API request (true) or not (false). Default: `true`. _Example_ ``` true ``` * `hierarchy` (query, integer) Specifies product hierarchy. _Example_ ``` 2 ``` * `pagesize` (query, integer) Number of records to be returned. _Example_ ``` 10 ``` * `includeAttachment` (query, boolean) Indicates whether product attachments are returned (true) or not (false). _Example_ ``` true ``` * `expandAll` (query, boolean) Specifies level of hierarchy for assets. _Example_ ``` false ``` * `fields` (query, array of string, collection format: csv) List of fields to return in the response, separated by commas. _Example_ ``` Id,Name ``` #### Request body Request Body with input fields #### Add Items to a Cart Request Example ```json { "items": [{ "itemId": "01uf4000000gmRTAAY", "parentId": "802f4000000PZ1VAAW", "parentRecord": { "records": [{ "messages": [ ], "displaySequence": -1, "Id": { "messages": [ ], "label": "Order Product ID", "hidden": false, "fieldName": "Id", "editable": false, "dataType": "ID", "value": "802f4000000PZ1VAAW" }, "UnitPrice": { "messages": [ ], "label": "Unit Price", "hidden": true, "fieldName": "UnitPrice", "editable": false, "dataType": "CURRENCY", "value": 358.95 }, "productId": "01tf4000000Kd0uAAC", "defaultQuantity": 1, "minQuantity": 0, "maxQuantity": 99999, "groupMinQuantity": 0, "groupMaxQuantity": 99999, "sequenceNumber": 1, "productHierarchyPath": "01tf4000000Kd0uAAC", "itemType": "lineItem", "childProducts": { "records": [{ "Name": { "label": "Product Name", "value": "PRODUCT-77151" }, "UnitPrice": { "label": "List Price", "value": 0.0 }, "vlocity_cmt__RecurringPrice__c": { "label": "Recurring Price", "value": 0.0 }, "Product2Id": { "label": "Product ID", "value": "01tf4000000Kd0zAAC" }, "Pricebook2Id": { "label": "Price Book ID", "value": "01sf4000003LYn3AAG" }, "Id": { "label": "Price Book Entry ID", "value": "01uf4000000gmRTAAY" }, "defaultQuantity": 0, "productId": "01tf4000000Kd0zAAC", "Product2": { "Name": "PRODUCT-77151", "RecordTypeId": "012f40000004zEOAAY", "vlocity_cmt__IsConfigurable__c": false, "vlocity_cmt__SubType__c": "None", "vlocity_cmt__Type__c": "None" }, "messages": [ ], "actions": { "addtocart": { "rest": { "params": { "price": true, "validate": true, "includeAttachment": false, "pagesize": 20, "hierarchy": -1, "items": [{ "parentId": "802f4000000PZ1VAAW", "quantity": 0, "itemId": "01uf4000000gmRTAAY" }], "cartId": "801f4000000ChZjAAK" }, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/801f4000000ChZjAAK/items" }, "remote": { "params": { "price": true, "validate": true, "includeAttachment": false, "pagesize": 20, "hierarchy": -1, "items": [{ "parentId": "802f4000000PZ1VAAW", "quantity": 0, "itemId": "01uf4000000gmRTAAY" }], "cartId": "801f4000000ChZjAAK", "methodName": "postCartsItems" } }, "client": { "params": { "pagesize": 0, "hierarchy": 0 } } } } }] }, "vlocity_cmt__RecurringPrice__c": 527.96, "name": "PRODUCT-39982", "provisioningStatus": "New", "Product2Id": "01tf4000000Kd0uAAC", "PricebookEntryId": { "messages": [ ], "label": "Price Book Entry ID", "hidden": false, "fieldName": "PricebookEntryId", "editable": false, "dataType": "REFERENCE", "value": "01uf4000000gmRJAAY" }, "Quantity": { "messages": [ ], "label": "Quantity", "hidden": false, "fieldName": "Quantity", "editable": true, "dataType": "DOUBLE", "value": 1 }, "vlocity_cmt__OneTimeTotal__c": { "messages": [ ], "label": "One Time Total", "hidden": false, "fieldName": "vlocity_cmt__OneTimeTotal__c", "editable": false, "dataType": "CURRENCY", "value": 358.95 }, "vlocity_cmt__RecurringTotal__c": { "messages": [ ], "label": "Recurring Total", "hidden": false, "fieldName": "vlocity_cmt__RecurringTotal__c", "editable": false, "dataType": "CURRENCY", "value": 527.96 }, "vlocity_cmt__OneTimeCharge__c": { "messages": [ ], "label": "One Time Charge", "hidden": true, "fieldName": "vlocity_cmt__OneTimeCharge__c", "editable": false, "dataType": "CURRENCY", "value": 358.95 }, "vlocity_cmt__RecurringCharge__c": { "messages": [ ], "label": "Recurring Charge", "hidden": true, "fieldName": "vlocity_cmt__RecurringCharge__c", "editable": false, "dataType": "CURRENCY", "value": 527.96 }, "vlocity_cmt__RecurringManualDiscount__c": { "messages": [ ], "label": "Recurring Manual Discount", "hidden": false, "fieldName": "vlocity_cmt__RecurringManualDiscount__c", "editable": true, "dataType": "PERCENT", "value": 0.0 }, "vlocity_cmt__OneTimeManualDiscount__c": { "messages": [ ], "label": "One Time Manual Discount", "hidden": false, "fieldName": "vlocity_cmt__OneTimeManualDiscount__c", "editable": true, "dataType": "PERCENT", "value": 0.0 }, "PricebookEntry": { "Product2Id": "01tf4000000Kd0uAAC", "Pricebook2Id": "01sf4000003LYn3AAG", "Id": "01uf4000000gmRJAAY", "Product2": { "Name": "PRODUCT-39982", "Id": "01tf4000000Kd0uAAC", "vlocity_cmt__Type__c": "None", "vlocity_cmt__IsConfigurable__c": "false" } }, "Product2": { "Name": "PRODUCT-39982", "RecordTypeId": "012f40000004zEOAAY", "vlocity_cmt__IsConfigurable__c": false, "vlocity_cmt__SubType__c": "None", "vlocity_cmt__Type__c": "None" }, "vlocity_cmt__ItemName__c": { "messages": [ ], "label": "Item Name", "hidden": false, "fieldName": "vlocity_cmt__ItemName__c", "editable": true, "dataType": "STRING" }, "actions": { "addtocart": { "rest": { "params": { "price": true, "validate": true, "includeAttachment": false, "pagesize": 20, "hierarchy": -1, "items": [{ "parentId": "802f4000000PZ1VAAW", "quantity": 1, "itemId": "01uf4000000gmRJAAY" }], "cartId": "801f4000000ChZjAAK" }, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/801f4000000ChZjAAK/items" }, "remote": { "params": { "price": true, "validate": true, "includeAttachment": false, "pagesize": 20, "hierarchy": -1, "items": [{ "parentId": "802f4000000PZ1VAAW", "quantity": 1, "itemId": "01uf4000000gmRJAAY" }], "cartId": "801f4000000ChZjAAK", "methodName": "postCartsItems" } }, "client": { "params": { "pagesize": 0, "hierarchy": 0 } } }, }, }], }, }] "hierarchy": 0, "pagesize": 0, "levelBasedApproach": false } ``` #### Multi ROOT Item Add Example Comma separated string should be passed as _itemId_ to support MultiAdd enhancement eg ```json { "items": [ { "itemId": "01uf400000HY8YuAAL,01uf400000HY8YkAAL" } ] } ``` #### Multi ROOT Item add example with NoResponse parameter * Comma separated string should be passed as **itemId** to support MultiAdd enhancement * **noResponseNeeded** set to **true** ```json { "noResponseNeeded": true, "items": [ { "itemId": "01uf400000HY8YuAAL,01uf400000HY8YkAAL" } ] } ``` #### Sample response with noResponseNeeded parameter ```json { "totalSize": 0, "messages": [ { "code": "150", "severity": "INFO", "message": "Successfully added." } ], "actions": { "itempricesupdated": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/h_cpq_daily/v2/cpq/carts/801f4000006lI3pAAE/price?price=false" }, "remote": { "params": { "price": false, "cartId": "801f4000006lI3pAAE", "methodName": "getCartLineItemPrices" } }, "client": { "params": {} } } } } ``` #### Multi CHILD Item Add Example Comma separated string should be passed as _itemId_ to support MultiAdd enhancement ```json { "items": [ { "parentId": "802f400000YzH8WAAV", "parentHierarchyPath": "01tf4000004ULpJAAW<01tf4000004ULpOAAW<01tf4000004ULpYAAW<01tf4000004ULpiAAG", "itemId": "01uf400000HY8YGAA1,01uf400000HY8YuAAL,01uf400000HY8YkAAL", "parentRecord": { "records": [ { "Id": "01tf4000004ULpiAAG", "productId": "01tf4000004ULpiAAG", "productHierarchyPath": "01tf4000004ULpJAAW<01tf4000004ULpOAAW<01tf4000004ULpYAAW<01tf4000004ULpiAAG", "itemType": "productGroup", "parentLineItemId": "802f400000YzH8WAAV" } ] } } ] } ``` #### Multi CHILD Item Add Example with NoResponse parameter * Comma separated string should be passed as **itemId** to support MultiAdd enhancement * **noResponseNeeded** set to **true** ```json { "noResponseNeeded": true, "items": [ { "parentId": "802f400000YzH8WAAV", "parentHierarchyPath": "01tf4000004ULpJAAW<01tf4000004ULpOAAW<01tf4000004ULpYAAW<01tf4000004ULpiAAG", "itemId": "01uf400000HY8YGAA1,01uf400000HY8YuAAL,01uf400000HY8YkAAL", "parentRecord": { "records": [ { "Id": "01tf4000004ULpiAAG", "productId": "01tf4000004ULpiAAG", "productHierarchyPath": "01tf4000004ULpJAAW<01tf4000004ULpOAAW<01tf4000004ULpYAAW<01tf4000004ULpiAAG", "itemType": "productGroup", "parentLineItemId": "802f400000YzH8WAAV" } ] } } ] } ``` Media type: `application/json`. Schema: `ValidateCartResponse`. #### Responses * **200** OK - API request processed. Look for messages in the response to determine if it succeeded or failed. ### GET Get Applied or Available Promotions for a Cart `GET /cpq/carts/{cartid}/promotions` Operation ID: `Get Applied Promotions`. Tags: Cart. Promotions give a cart beneficial pricing or other benefits. A given cart for a given customer will only have certain promotions available to be applied to the cart. A cart can also already have one or more promotions applied. This GET operation will retrieve any promotions applied or available to the given cart. In different circumstances, qualification, penalty and evaluation rules are applied to promotions and the usage of the rules depends on the parameters set. **Sub Action** - By default (when _subaction=..._ is omitted from the request) this operation returns the list of promotions that are available to be applied to the given cart. Add the _subaction=getPromotionsAppliedToCart_ query parameter to instead request the list of promotions that are currently applied to the cart. * **subaction=getPromotionsAppliedToCart** - Return promotions currently applied to the cart. If an evaluation ruleset is applied then this method returns the qualified promotions based on the data provided in the ruelEvalautionInput parameter. * **subaction parameter omitted** - Return promotions that are available to be applied to the cart **include** - By default the qualifications for each promotion are not returned in the response because they take time to calculate. Add the _include=qualifications_ query parameter to request a list of required qualifications for each promotion and which are satisfied or not satisfied. If the _include=_ parameter is omitted, the _category_ fields and _qualifications_ arrays will not be returned in the response. Rest Handler - APIPromotionsCartsCpqV2 Method Invoked - getCartsPromotions #### Parameters * `cartid` (path, string, required) Cart ID (Salesforce ID). Opportunity, Quote or Order ID. _Example_ ``` 801360000000oQ9 ``` * `subaction` (query, string) An optional subaction that switches what data is returned from the request. Allowed values: `getPromotionsAppliedToCart`. * `include` (query, string) Optional components to include in the response. Currently only _qualifications_. Allowed values: `qualifications`. * `includePenalties` (query, boolean) whether to return the penalties for the promotions in the result or not _Example_ ``` true ``` * `ruleType` (query, string) Indicates which type of context rule to run. This should be used when we have includes param as qualifications or evaluation _Example_ ``` evaluation ``` * `ruleEvaluationInput` (query, string) The input to be used in the evaluation of context rules and it allows you to provide temporary values at run-time to determine if acustomer is eligible for a promotion without changing the actual values stored in Salesforce. Also, the format for the input should describe the sObject, the field and the temporary value that should be evaluated in JSON notation _Example_ ``` { "Order": { "OriginatingChannel__c": "Web" } } ``` * `filters` (query, string) Filter field values. _Example_ ``` vlocity_cmt__AppliesTo__c:Account_Contract ``` * `category` (query, string) Category to which the product belongs. _Example_ ``` Qualified, Disqualified ``` * `fields` (query, array of string, collection format: csv) List of fields to return in the response, separated by commas. _Example_ ``` Id,Name ``` * `pagesize` (query, integer) Number of records to be returned. _Example_ ``` 10 ``` * `commitmentDateFilter` (query, string) Filters active applied promotions based on this date. _Example_ ``` 2017-04-05T07:00:00.000Z ``` * `appliedPromoStatusFilter` (query, string) Filter to specific the kind of applied promotions to be retrieved. _Example_ ``` Active ``` #### Responses * **200** | Response #### Get Applied Promotions for Cart Response ```json "totalSize": 1, "messages": [], "records": [{ "messages": [], "actions": { "deleteappliedpromoitems": { "rest": { "params": {}, "method": "DELETE", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/801f40000008UlxAAE/promotions?id=a2Lf4000000TvFmEAK" }, "remote": { "params": { "id": "a2Lf4000000TvFmEAK", "cartId": "801f40000008UlxAAE", "methodName": "deleteAppliedPromoItems" } }, "client": { "params": {} } }, "getpromodetails": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/801f40000008UlxAAE/promotions?id=a2Lf4000000TvFmEAK&subaction=getPromotionsAppliedToCart&includePenalties=true" }, "remote": { "params": { "includePenalties": true, "subaction": "getPromotionsAppliedToCart", "id": "a2Lf4000000TvFmEAK", "cartId": "801f40000008UlxAAE", "methodName": "getPromotionsAppliedToCart" } }, "client": { "params": {} } } }, "displaySequence": -1, "Id": { "value": "a2Lf4000000TvFmEAK", "previousValue": null, "originalValue": null, "messages": [], "label": "Record ID", "hidden": true, "fieldName": "Id", "editable": false, "dataType": "ID", "actions": {} }, "vlocity_cmt__BillingAccountId__c": { "value": "001f40000093uqMAAQ", "previousValue": null, "originalValue": null, "messages": [], "label": "Account", "hidden": true, "fieldName": "vlocity_cmt__BillingAccountId__c", "editable": true, "dataType": "REFERENCE", "actions": {} }, "vlocity_cmt__Action__c": { "value": "Change", "previousValue": null, "originalValue": null, "messages": [], "label": "Action", "hidden": true, "fieldName": "vlocity_cmt__Action__c", "editable": true, "dataType": "PICKLIST", "actions": {} }, "vlocity_cmt__PromotionId__c": { "value": "a2ff4000000cHPMAA2", "previousValue": null, "originalValue": null, "messages": [], "label": "Promotion", "hidden": true, "fieldName": "vlocity_cmt__PromotionId__c", "editable": true, "dataType": "REFERENCE", "actions": {} }, "vlocity_cmt__Sequence__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Sequence", "hidden": true, "fieldName": "vlocity_cmt__Sequence__c", "editable": true, "dataType": "DOUBLE", "actions": {} }, "vlocity_cmt__FulfilmentStatus__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Fulfilment Status", "hidden": true, "fieldName": "vlocity_cmt__FulfilmentStatus__c", "editable": true, "dataType": "PICKLIST", "actions": {} }, "vlocity_cmt__ReasonForCancellation__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Reason for Cancellation", "hidden": true, "fieldName": "vlocity_cmt__ReasonForCancellation__c", "editable": true, "dataType": "STRING", "actions": {} }, "vlocity_cmt__RequestDate__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Request Date", "hidden": true, "fieldName": "vlocity_cmt__RequestDate__c", "editable": true, "dataType": "DATETIME", "actions": {} }, "vlocity_cmt__SubAction__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Sub Action", "hidden": true, "fieldName": "vlocity_cmt__SubAction__c", "editable": true, "dataType": "PICKLIST", "actions": {} }, "vlocity_cmt__CommitmentStartDate__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Commitment Start Date", "hidden": true, "fieldName": "vlocity_cmt__CommitmentStartDate__c", "editable": true, "dataType": "DATETIME", "actions": {} }, "vlocity_cmt__CommitmentEndDate__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Commitment End Date", "hidden": true, "fieldName": "vlocity_cmt__CommitmentEndDate__c", "editable": true, "dataType": "DATETIME", "actions": {} }, "vlocity_cmt__PricingStartDate__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Benefit Start Date", "hidden": true, "fieldName": "vlocity_cmt__PricingStartDate__c", "editable": true, "dataType": "DATETIME", "actions": {} }, "vlocity_cmt__PricingEndDate__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Benefit End Date", "hidden": true, "fieldName": "vlocity_cmt__PricingEndDate__c", "editable": true, "dataType": "DATETIME", "actions": {} }, "vlocity_cmt__AppliesTo__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Applies To", "hidden": true, "fieldName": "vlocity_cmt__AppliesTo__c", "editable": true, "dataType": "PICKLIST", "actions": {} }, "Name": "BundleJul19Promo", "Description": "BundleJul19Promo", "OrderRequestDate": "2017-11-13" }] } ``` ``` ### POST Add Promotion to a Cart `POST /cpq/carts/{cartid}/promotions` Operation ID: `Add Promotion to a Cart`. Tags: Cart. Add promotion to a specified cart. Rest Handler - APIPromotionsCartsCpqV2 Method Invoked - postCartsPromoItems #### Parameters * `cartid` (path, string, required) Cart ID (Salesforce ID). Opportunity, Quote or Order ID. _Example_ ``` 801360000000oQ9 ``` #### Request body Request Body with input fields #### Add Promotion to a Cart Request Example ```json { "items": [ { "itemId":"a30460000001vbgAAA" } ], "price": false, "validate": false, } ``` Media type: `application/json`. Schema: `PostPromoCartResponse`. #### Responses * **200** OK - API request processed. Look for messages in the response to determine if it succeeded or failed. ### DELETE Delete of Promotion Items in Cart. `DELETE /cpq/carts/{cartid}/promotions` Operation ID: `Delete Promotion Items`. Tags: Cart. This API delete applied promotions items from cart Rest Handler - APIPromotionsCartsCpqV2 Method Invoked - deletePromotionItems #### Parameters * `cartid` (path, string, required) Cart ID (Salesforce ID). Opportunity, Quote or Order ID. _Example_ ``` 801360000000oQ9 ``` * `id` (query, string) Applied promotion item Id _Example_ ``` a2Lf40000008nL5EAI ``` #### Request body Request Body with input fields #### Delete Promotion Items in Cart Request Example ```json { "id": "a2Lf40000008nL5EAI", "cartId": "801f40000012NEIAA2", "methodName": "deleteAppliedPromoItems", "price": true, "validate": true } ``` Media type: `application/json`. Schema: `ValidateCartResponse`. #### Responses * **200** #### Response for Delete Promotion Items ```json { "totalSize": 0, "messages": [{ "severity": "INFO", "messageId": null, "message": "Successfully deleted.", "code": "152", "bundleId": null, "actions": {} }], "actions": { "itemdeleted": { "rest": { "params": {}, "method": null, "link": null }, "remote": { "params": {} }, "client": { "params": { "items": [{ "message": "add TestProd-12 bundle has been deleted from the cart.", "Id": "a2Lf40000008nL5EAI" }] } } } } } ``` ### GET Get Applied Promotions for a Customer Account `GET /accounts/{accountid}/promotions` Operation ID: `Get Applied Promotions`. Tags: Customer. Customers can have one or more active promotions applied which give them beneficial pricing or other benefits. This GET operation will retrieve any promotions applied to the given customer's assets, contracts or the account itself. **includes** - By default the qualifications for each applied promotion are not returned in the response because they take time to calculate. Add the _includes=qualifications_ query parameter to request a list of required qualifications and which are satisfied or not satisfied. If the _includes=_ parameter is omitted, the _category_ field and _qualifications_ array will not be returned in the response. **Filters** - By default all of the applied promotions are returned in the response. The _filters_ parameter allows returning a subset. Rest Handler - APIAppliedPromotionsAccountsV2 Method Invoked - getAppliedPromotionsByAccount #### Parameters * `accountid` (path, string, required) Customer Account ID (Salesforce ID). _Example_ ``` 001f4000007hynC ``` * `includes` (query, string) Optional components to include in the response. Currently only _qualifications_. Allowed values: `qualifications`. * `filters` (query, string) Filter field values. _Example_ ``` vlocity_cmt__AppliesTo__c:Account_Contract ``` * `category` (query, string) Category to which the product belongs. _Example_ ``` Qualified, Disqualified ``` * `fields` (query, array of string, collection format: csv) List of fields to return in the response, separated by commas. _Example_ ``` Id,Name ``` * `pagesize` (query, integer) Number of records to be returned. _Example_ ``` 10 ``` * `commitmentDateFilter` (query, string) Filters active applied promotions based on this date. _Example_ ``` 2017-04-05T07:00:00.000Z ``` * `appliedPromoStatusFilter` (query, string) Filter to specific the kind of applied promotions to be retrieved. _Example_ ``` Active ``` * `ruleType` (query, string) Indicates which type of context rule to run. This should be used when we have includes param as qualifications or evaluation _Example_ ``` evaluation ``` * `ruleEvaluationInput` (query, string) The input to be used in the evaluation of context rules _Example_ ``` { "Order": { "OriginatingChannel__c": "Web" } } ``` #### Responses * **200** #### Response for Account Applied Promotions ```json { "totalSize": 1, "messages": [], "records": [{ "messages": [], "displaySequence": -1, "Id": { "value": "a1if4000000Z1wTAAS", "previousValue": null, "originalValue": null, "messages": [], "label": "Record ID", "hidden": true, "fieldName": "Id", "editable": false, "dataType": "ID", "actions": {} }, "vlocity_cmt__BillingAccountId__c": { "value": "001f40000093uqMAAQ", "previousValue": null, "originalValue": null, "messages": [], "label": "Account", "hidden": true, "fieldName": "vlocity_cmt__BillingAccountId__c", "editable": false, "dataType": "REFERENCE", "actions": {} }, "vlocity_cmt__PromotionId__c": { "value": "a2ff4000000cHPMAA2", "previousValue": null, "originalValue": null, "messages": [], "label": "Promotion", "hidden": true, "fieldName": "vlocity_cmt__PromotionId__c", "editable": true, "dataType": "REFERENCE", "actions": {} }, "vlocity_cmt__Sequence__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Sequence", "hidden": true, "fieldName": "vlocity_cmt__Sequence__c", "editable": true, "dataType": "DOUBLE", "actions": {} }, "vlocity_cmt__CancellationDate__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Cancellation Date", "hidden": true, "fieldName": "vlocity_cmt__CancellationDate__c", "editable": true, "dataType": "DATETIME", "actions": {} }, "vlocity_cmt__CommitmentStartDate__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Commitment Start Date", "hidden": true, "fieldName": "vlocity_cmt__CommitmentStartDate__c", "editable": true, "dataType": "DATETIME", "actions": {} }, "vlocity_cmt__AppliesTo__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Applies To", "hidden": true, "fieldName": "vlocity_cmt__AppliesTo__c", "editable": true, "dataType": "PICKLIST", "actions": {} }, "vlocity_cmt__CancellationStatus__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Cancellation Status", "hidden": true, "fieldName": "vlocity_cmt__CancellationStatus__c", "editable": true, "dataType": "PICKLIST", "actions": {} }, "vlocity_cmt__ReasonForCancellation__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Reason for Cancellation", "hidden": true, "fieldName": "vlocity_cmt__ReasonForCancellation__c", "editable": true, "dataType": "STRING", "actions": {} }, "vlocity_cmt__CommitmentEndDate__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Commitment End Date", "hidden": true, "fieldName": "vlocity_cmt__CommitmentEndDate__c", "editable": true, "dataType": "DATETIME", "actions": {} }, "vlocity_cmt__PricingStartDate__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Benefit Start Date", "hidden": true, "fieldName": "vlocity_cmt__PricingStartDate__c", "editable": true, "dataType": "DATETIME", "actions": {} }, "vlocity_cmt__PricingEndDate__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Benefit End Date", "hidden": true, "fieldName": "vlocity_cmt__PricingEndDate__c", "editable": true, "dataType": "DATETIME", "actions": {} }, "Name": "BundleJul19Promo", "Description": "BundleJul19Promo" }] } ``` ### GET Get List of Products `GET /cpq/carts/{cartid}/products` Operation ID: `Get List of Products`. Tags: Cart. Get list of products available to be added to the cart based on the given criteria. Rest Handler - APIProductsCartsCpqV2 Method Invoked - getCartsProducts #### Parameters * `cartid` (path, string, required) Cart ID (Salesforce ID). Opportunity, Quote or Order ID. _Example_ ``` 801360000000oQ9 ``` * `maxProdListHierarchy` (query, integer) List of products returened in hierarchy. _Example_ ``` 5 ``` * `lastRecordId` (query, string) The last record ID from the previous search result, if available. _Example_ ``` 01uf4000001q1W3AAI ``` * `includeAttachment` (query, boolean) Indicates whether product attachments are returned (true) or not (false). _Example_ ``` true ``` * `filters` (query, string) Filter field values. _Example_ ``` vlocity_cmt__AppliesTo__c:Account_Contract ``` * `offsetSize` (query, integer) Offset from which to start reading products, for pagination. _Example_ ``` 2 ``` * `fields` (query, array of string, collection format: csv) List of fields to return in the response, separated by commas. _Example_ ``` Id,Name ``` * `pagesize` (query, integer) Number of records to be returned. _Example_ ``` 10 ``` * `attributes` (query, string) Attribute filters. For example, for the attribute memory (attributecode=attr1) with selected values 16gb and 32gb and attribute color (attr2) with red selected, the format will be as shown in the example. _Example_ ``` attr1:attr116gb_32gb,attr2:red ``` * `includeAttributes` (query, boolean) Specifies whether to return a list of attributes and their values for the product. _Example_ ``` true ``` * `query` (query, string) Search text _Example_ ``` iphone+6s ``` #### Responses * **200** #### Response for Get List of Products ```json { "totalSize": 5, "messages": [], "actions": { "nextproducts": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlcoity_cmt/v2/cpq/carts/80141000000Cg8HAAS/products?hierarchy=0&lastRecordId=01u41000001QPtsAAG&pagesize=5&includeAttachment=false" }, "remote": { "params": { "includeAttachment": false, "pagesize": 5, "lastRecordId": "01u41000001QPtsAAG", "hierarchy": 0, "cartId": "80141000000Cg8HAAS", "methodName": "getCartsProducts" } }, "client": { "params": {} } } }, "records": [{ "messages": [], "actions": { "addtocart": { "rest": { "params": { "price": true, "validate": true, "includeAttachment": false, "pagesize": 5, "lastRecordId": null, "hierarchy": 0, "query": null, "items": [{ "quantity": 1, "itemId": "01u41000001QPs0AAG" }] }, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80141000000Cg8HAAS/items" }, "remote": { "params": { "price": true, "validate": true, "includeAttachment": false, "pagesize": 5, "lastRecordId": null, "hierarchy": 0, "query": null, "items": [{ "quantity": 1, "itemId": "01u41000001QPs0AAG" }], "cartId": "80141000000Cg8HAAS", "methodName": "postCartsItems" } }, "client": { "params": {} } } }, "displaySequence": -1, "Id": { "label": "Price Book Entry ID", "value": "01u41000001QPs0AAG" }, "Pricebook2Id": { "label": "Price Book ID", "value": "01s41000005dPYQAA2" }, "Product2Id": { "label": "Product ID", "value": "01t41000000sYZQAA2" }, "UnitPrice": { "label": "List Price", "value": 1.00 }, "Name": { "label": "Product Name", "value": "Root 1" }, "IsActive": { "label": "Active", "value": true }, "Product2": { "attributes": { "type": "Product2", "url": "/services/data/v38.0/sobjects/Product2/01t41000000sYZQAA2" }, "Id": "01t41000000sYZQAA2", "Name": "Root 1", "vlocity_cmt__IsConfigurable__c": false, "vlocity_cmt__Type__c": "None", "vlocity_cmt__SubType__c": "None", "RecordTypeId": "012410000006OWUAA2" }, "productId": "01t41000000sYZQAA2", "defaultQuantity": 1.0, "minQuantity": 0.0, "maxQuantity": 99999.0, "groupMinQuantity": 0, "groupMaxQuantity": 99999, "sequenceNumber": 1.00, "productChildItemId": "a2541000000G09wAAC", "productChildItemDefinition": { "attributes": { "type": "vlocity_cmt__ProductChildItem__c", "url": "/services/data/v38.0/sobjects/vlocity_cmt__ProductChildItem__c/a2541000000G09wAAC" }, "Id": "a2541000000G09wAAC", "Name": "Root PCI", "vlocity_cmt__IsVirtualItem__c": false, "vlocity_cmt__Quantity__c": 1, "vlocity_cmt__MaxQuantity__c": 99999, "vlocity_cmt__MinQuantity__c": 0, "vlocity_cmt__MaximumChildItemQuantity__c": 99999, "vlocity_cmt__MinimumChildItemQuantity__c": 0, "vlocity_cmt__IsOverride__c": false, "vlocity_cmt__ParentProductId__c": "01t41000000sYZQAA2", "vlocity_cmt__ChildLineNumber__c": "1", "vlocity_cmt__SeqNumber__c": 1.00, "vlocity_cmt__CollapseHierarchy__c": false, "vlocity_cmt__IsRootProductChildItem__c": true, "vlocity_cmt__ParentProductId__r": { "attributes": { "type": "Product2", "url": "/services/data/v38.0/sobjects/Product2/01t41000000sYZQAA2" }, "Id": "01t41000000sYZQAA2", "Name": "Root 1" } }, "productHierarchyPath": "01t41000000sYZQAA2", "name": "Root 1", "isVirtualItem": false, "attributeValues": {}, "itemType": "childProduct" }, { "messages": [], "actions": { "addtocart": { "rest": { "params": { "price": true, "validate": true, "includeAttachment": false, "pagesize": 5, "lastRecordId": null, "hierarchy": 0, "query": null, "items": [{ "quantity": 1, "itemId": "01u41000001QPs5AAG" }] }, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80141000000Cg8HAAS/items" }, "remote": { "params": { "price": true, "validate": true, "includeAttachment": false, "pagesize": 5, "lastRecordId": null, "hierarchy": 0, "query": null, "items": [{ "quantity": 1, "itemId": "01u41000001QPs5AAG" }], "cartId": "80141000000Cg8HAAS", "methodName": "postCartsItems" } }, "client": { "params": {} } } }, "displaySequence": -1, "Id": { "label": "Price Book Entry ID", "value": "01u41000001QPs5AAG" }, "Pricebook2Id": { "label": "Price Book ID", "value": "01s41000005dPYQAA2" }, "Product2Id": { "label": "Product ID", "value": "01t41000000sYZVAA2" }, "UnitPrice": { "label": "List Price", "value": 2.00 }, "Name": { "label": "Product Name", "value": "Parent 1" }, "IsActive": { "label": "Active", "value": true }, "Product2": { "attributes": { "type": "Product2", "url": "/services/data/v38.0/sobjects/Product2/01t41000000sYZVAA2" }, "Id": "01t41000000sYZVAA2", "Name": "Parent 1", "vlocity_cmt__IsConfigurable__c": false, "vlocity_cmt__Type__c": "None", "vlocity_cmt__SubType__c": "None", "RecordTypeId": "012410000006OWUAA2" }, "productId": "01t41000000sYZVAA2", "defaultQuantity": 1.0, "minQuantity": 0.0, "maxQuantity": 99999.0, "groupMinQuantity": 0, "groupMaxQuantity": 99999, "sequenceNumber": 1.00, "productChildItemId": "a2541000000G0A1AAK", "productChildItemDefinition": { "attributes": { "type": "vlocity_cmt__ProductChildItem__c", "url": "/services/data/v38.0/sobjects/vlocity_cmt__ProductChildItem__c/a2541000000G0A1AAK" }, "Id": "a2541000000G0A1AAK", "Name": "Root PCI", "vlocity_cmt__IsVirtualItem__c": false, "vlocity_cmt__Quantity__c": 1, "vlocity_cmt__MaxQuantity__c": 99999, "vlocity_cmt__MinQuantity__c": 0, "vlocity_cmt__MaximumChildItemQuantity__c": 99999, "vlocity_cmt__MinimumChildItemQuantity__c": 0, "vlocity_cmt__IsOverride__c": false, "vlocity_cmt__ParentProductId__c": "01t41000000sYZVAA2", "vlocity_cmt__ChildLineNumber__c": "1", "vlocity_cmt__SeqNumber__c": 1.00, "vlocity_cmt__CollapseHierarchy__c": false, "vlocity_cmt__IsRootProductChildItem__c": true, "vlocity_cmt__ParentProductId__r": { "attributes": { "type": "Product2", "url": "/services/data/v38.0/sobjects/Product2/01t41000000sYZVAA2" }, "Id": "01t41000000sYZVAA2", "Name": "Parent 1" } }, "productHierarchyPath": "01t41000000sYZVAA2", "name": "Parent 1", "isVirtualItem": false, "attributeValues": {}, "itemType": "childProduct" }, { "messages": [], "actions": { "addtocart": { "rest": { "params": { "price": true, "validate": true, "includeAttachment": false, "pagesize": 5, "lastRecordId": null, "hierarchy": 0, "query": null, "items": [{ "quantity": 1, "itemId": "01u41000001QPtmAAG" }] }, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80141000000Cg8HAAS/items" }, "remote": { "params": { "price": true, "validate": true, "includeAttachment": false, "pagesize": 5, "lastRecordId": null, "hierarchy": 0, "query": null, "items": [{ "quantity": 1, "itemId": "01u41000001QPtmAAG" }], "cartId": "80141000000Cg8HAAS", "methodName": "postCartsItems" } }, "client": { "params": {} } } }, "displaySequence": -1, "Id": { "label": "Price Book Entry ID", "value": "01u41000001QPtmAAG" }, "Pricebook2Id": { "label": "Price Book ID", "value": "01s41000005dPYQAA2" }, "Product2Id": { "label": "Product ID", "value": "01t41000000sYaIAAU" }, "UnitPrice": { "label": "List Price", "value": 1.00 }, "Name": { "label": "Product Name", "value": "Child 1" }, "IsActive": { "label": "Active", "value": true }, "Product2": { "attributes": { "type": "Product2", "url": "/services/data/v38.0/sobjects/Product2/01t41000000sYaIAAU" }, "Id": "01t41000000sYaIAAU", "Name": "Child 1", "vlocity_cmt__IsConfigurable__c": false, "vlocity_cmt__Type__c": "None", "vlocity_cmt__SubType__c": "None", "RecordTypeId": "012410000006OWUAA2" }, "productId": "01t41000000sYaIAAU", "defaultQuantity": 1.0, "minQuantity": 0.0, "maxQuantity": 99999.0, "groupMinQuantity": 0, "groupMaxQuantity": 99999, "sequenceNumber": 1.00, "productChildItemId": "a2541000000G0A6AAK", "productChildItemDefinition": { "attributes": { "type": "vlocity_cmt__ProductChildItem__c", "url": "/services/data/v38.0/sobjects/vlocity_cmt__ProductChildItem__c/a2541000000G0A6AAK" }, "Id": "a2541000000G0A6AAK", "Name": "Root PCI", "vlocity_cmt__IsVirtualItem__c": false, "vlocity_cmt__Quantity__c": 1, "vlocity_cmt__MaxQuantity__c": 99999, "vlocity_cmt__MinQuantity__c": 0, "vlocity_cmt__MaximumChildItemQuantity__c": 99999, "vlocity_cmt__MinimumChildItemQuantity__c": 0, "vlocity_cmt__IsOverride__c": false, "vlocity_cmt__ParentProductId__c": "01t41000000sYaIAAU", "vlocity_cmt__ChildLineNumber__c": "1", "vlocity_cmt__SeqNumber__c": 1.00, "vlocity_cmt__CollapseHierarchy__c": false, "vlocity_cmt__IsRootProductChildItem__c": true, "vlocity_cmt__ParentProductId__r": { "attributes": { "type": "Product2", "url": "/services/data/v38.0/sobjects/Product2/01t41000000sYaIAAU" }, "Id": "01t41000000sYaIAAU", "Name": "Child 1" } }, "productHierarchyPath": "01t41000000sYaIAAU", "name": "Child 1", "isVirtualItem": false, "attributeValues": {}, "itemType": "childProduct" }, { "messages": [], "actions": { "addtocart": { "rest": { "params": { "price": true, "validate": true, "includeAttachment": false, "pagesize": 5, "lastRecordId": null, "hierarchy": 0, "query": null, "items": [{ "quantity": 1, "itemId": "01u41000001QPtrAAG" }] }, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80141000000Cg8HAAS/items" }, "remote": { "params": { "price": true, "validate": true, "includeAttachment": false, "pagesize": 5, "lastRecordId": null, "hierarchy": 0, "query": null, "items": [{ "quantity": 1, "itemId": "01u41000001QPtrAAG" }], "cartId": "80141000000Cg8HAAS", "methodName": "postCartsItems" } }, "client": { "params": {} } } }, "displaySequence": -1, "Id": { "label": "Price Book Entry ID", "value": "01u41000001QPtrAAG" }, "Pricebook2Id": { "label": "Price Book ID", "value": "01s41000005dPYQAA2" }, "Product2Id": { "label": "Product ID", "value": "01t41000000sYaNAAU" }, "UnitPrice": { "label": "List Price", "value": 1.00 }, "Name": { "label": "Product Name", "value": "GC 1" }, "IsActive": { "label": "Active", "value": true }, "Product2": { "attributes": { "type": "Product2", "url": "/services/data/v38.0/sobjects/Product2/01t41000000sYaNAAU" }, "Id": "01t41000000sYaNAAU", "Name": "GC 1", "vlocity_cmt__IsConfigurable__c": false, "vlocity_cmt__Type__c": "None", "vlocity_cmt__SubType__c": "None", "RecordTypeId": "012410000006OWUAA2" }, "productId": "01t41000000sYaNAAU", "defaultQuantity": 1.0, "minQuantity": 0.0, "maxQuantity": 99999.0, "groupMinQuantity": 0, "groupMaxQuantity": 99999, "sequenceNumber": 1.00, "productChildItemId": "a2541000000G0ABAA0", "productChildItemDefinition": { "attributes": { "type": "vlocity_cmt__ProductChildItem__c", "url": "/services/data/v38.0/sobjects/vlocity_cmt__ProductChildItem__c/a2541000000G0ABAA0" }, "Id": "a2541000000G0ABAA0", "Name": "Root PCI", "vlocity_cmt__IsVirtualItem__c": false, "vlocity_cmt__Quantity__c": 1, "vlocity_cmt__MaxQuantity__c": 99999, "vlocity_cmt__MinQuantity__c": 0, "vlocity_cmt__MaximumChildItemQuantity__c": 99999, "vlocity_cmt__MinimumChildItemQuantity__c": 0, "vlocity_cmt__IsOverride__c": false, "vlocity_cmt__ParentProductId__c": "01t41000000sYaNAAU", "vlocity_cmt__ChildLineNumber__c": "1", "vlocity_cmt__SeqNumber__c": 1.00, "vlocity_cmt__CollapseHierarchy__c": false, "vlocity_cmt__IsRootProductChildItem__c": true, "vlocity_cmt__ParentProductId__r": { "attributes": { "type": "Product2", "url": "/services/data/v38.0/sobjects/Product2/01t41000000sYaNAAU" }, "Id": "01t41000000sYaNAAU", "Name": "GC 1" } }, "productHierarchyPath": "01t41000000sYaNAAU", "name": "GC 1", "isVirtualItem": false, "attributeValues": {}, "itemType": "childProduct" }, { "messages": [], "actions": { "addtocart": { "rest": { "params": { "price": true, "validate": true, "includeAttachment": false, "pagesize": 5, "lastRecordId": null, "hierarchy": 0, "query": null, "items": [{ "quantity": 1, "itemId": "01u41000001QPtsAAG" }] }, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80141000000Cg8HAAS/items" }, "remote": { "params": { "price": true, "validate": true, "includeAttachment": false, "pagesize": 5, "lastRecordId": null, "hierarchy": 0, "query": null, "items": [{ "quantity": 1, "itemId": "01u41000001QPtsAAG" }], "cartId": "80141000000Cg8HAAS", "methodName": "postCartsItems" } }, "client": { "params": {} } } }, "displaySequence": -1, "Id": { "label": "Price Book Entry ID", "value": "01u41000001QPtsAAG" }, "Pricebook2Id": { "label": "Price Book ID", "value": "01s41000005dPYQAA2" }, "Product2Id": { "label": "Product ID", "value": "01t41000000sYaSAAU" }, "UnitPrice": { "label": "List Price", "value": 1.00 }, "Name": { "label": "Product Name", "value": "GC 2" }, "IsActive": { "label": "Active", "value": true }, "Product2": { "attributes": { "type": "Product2", "url": "/services/data/v38.0/sobjects/Product2/01t41000000sYaSAAU" }, "Id": "01t41000000sYaSAAU", "Name": "GC 2", "vlocity_cmt__IsConfigurable__c": false, "vlocity_cmt__Type__c": "None", "vlocity_cmt__SubType__c": "None", "RecordTypeId": "012410000006OWUAA2" }, "productId": "01t41000000sYaSAAU", "defaultQuantity": 1.0, "minQuantity": 0.0, "maxQuantity": 99999.0, "groupMinQuantity": 0, "groupMaxQuantity": 99999, "sequenceNumber": 1.00, "productChildItemId": "a2541000000G0AGAA0", "productChildItemDefinition": { "attributes": { "type": "vlocity_cmt__ProductChildItem__c", "url": "/services/data/v38.0/sobjects/vlocity_cmt__ProductChildItem__c/a2541000000G0AGAA0" }, "Id": "a2541000000G0AGAA0", "Name": "Root PCI", "vlocity_cmt__IsVirtualItem__c": false, "vlocity_cmt__Quantity__c": 1, "vlocity_cmt__MaxQuantity__c": 99999, "vlocity_cmt__MinQuantity__c": 0, "vlocity_cmt__MaximumChildItemQuantity__c": 99999, "vlocity_cmt__MinimumChildItemQuantity__c": 0, "vlocity_cmt__IsOverride__c": false, "vlocity_cmt__ParentProductId__c": "01t41000000sYaSAAU", "vlocity_cmt__ChildLineNumber__c": "1", "vlocity_cmt__SeqNumber__c": 1.00, "vlocity_cmt__CollapseHierarchy__c": false, "vlocity_cmt__IsRootProductChildItem__c": true, "vlocity_cmt__ParentProductId__r": { "attributes": { "type": "Product2", "url": "/services/data/v38.0/sobjects/Product2/01t41000000sYaSAAU" }, "Id": "01t41000000sYaSAAU", "Name": "GC 2" } }, "productHierarchyPath": "01t41000000sYaSAAU", "name": "GC 2", "isVirtualItem": false, "attributeValues": {}, "itemType": "childProduct" }] } ``` ### GET Get details of a product. `GET /cpq/carts/{cartid}/products/{pricebookEntryId}` Operation ID: `Get details of a product`. Tags: Cart. Get details of given pricebookentry id product available to be added to the cart based on the given criteria. Rest Handler - APIProductsCartsCpqV2 Method Invoked - getCartsProductsById #### Parameters * `cartid` (path, string, required) Cart ID (Salesforce ID). Opportunity, Quote or Order ID. _Example_ ``` 801360000000oQ9 ``` * `pricebookEntryId` (path, string, required) Price book entry ID (Salesforce ID). _Example_ ``` 01u46000002U5LKAA0 ``` * `maxProdListHierarchy` (query, integer) List of products returened in hierarchy. _Example_ ``` 5 ``` * `includeAttachment` (query, boolean) Indicates whether product attachments are returned (true) or not (false). _Example_ ``` true ``` * `filters` (query, string) Filter field values. _Example_ ``` vlocity_cmt__AppliesTo__c:Account_Contract ``` * `fields` (query, array of string, collection format: csv) List of fields to return in the response, separated by commas. _Example_ ``` Id,Name ``` * `includeAttributes` (query, boolean) Specifies whether to return a list of attributes and their values for the product. _Example_ ``` true ``` #### Responses * **200** #### Response for get details of a Product ```json { "totalSize": 1, "messages": [], "records": [{ "messages": [], "actions": { "addtocart": { "rest": { "params": { "price": true, "validate": true, "includeAttachment": false, "pagesize": 5, "lastRecordId": null, "hierarchy": 0, "query": null, "items": [{ "quantity": 1, "itemId": "01u41000001QPs0AAG" }] }, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80141000000Cg8HAAS/items" }, "remote": { "params": { "price": true, "validate": true, "includeAttachment": false, "pagesize": 5, "lastRecordId": null, "hierarchy": 0, "query": null, "items": [{ "quantity": 1, "itemId": "01u41000001QPs0AAG" }], "cartId": "80141000000Cg8HAAS", "methodName": "postCartsItems" } }, "client": { "params": {} } } }, "displaySequence": -1, "Id": { "label": "Price Book Entry ID", "value": "01u41000001QPs0AAG" }, "Pricebook2Id": { "label": "Price Book ID", "value": "01s41000005dPYQAA2" }, "Product2Id": { "label": "Product ID", "value": "01t41000000sYZQAA2" }, "UnitPrice": { "label": "List Price", "value": 1.00 }, "Name": { "label": "Product Name", "value": "Root 1" }, "IsActive": { "label": "Active", "value": true }, "Product2": { "attributes": { "type": "Product2", "url": "/services/data/v38.0/sobjects/Product2/01t41000000sYZQAA2" }, "Id": "01t41000000sYZQAA2", "Name": "Root 1", "vlocity_cmt__IsConfigurable__c": false, "vlocity_cmt__Type__c": "None", "vlocity_cmt__SubType__c": "None", "RecordTypeId": "012410000006OWUAA2" }, "productId": "01t41000000sYZQAA2", "defaultQuantity": 1.0, "minQuantity": 0.0, "maxQuantity": 99999.0, "groupMinQuantity": 0, "groupMaxQuantity": 99999, "sequenceNumber": 1.00, "productChildItemId": "a2541000000G09wAAC", "productChildItemDefinition": { "attributes": { "type": "vlocity_cmt__ProductChildItem__c", "url": "/services/data/v38.0/sobjects/vlocity_cmt__ProductChildItem__c/a2541000000G09wAAC" }, "Id": "a2541000000G09wAAC", "Name": "Root PCI", "vlocity_cmt__IsVirtualItem__c": false, "vlocity_cmt__Quantity__c": 1, "vlocity_cmt__MaxQuantity__c": 99999, "vlocity_cmt__MinQuantity__c": 0, "vlocity_cmt__MaximumChildItemQuantity__c": 99999, "vlocity_cmt__MinimumChildItemQuantity__c": 0, "vlocity_cmt__IsOverride__c": false, "vlocity_cmt__ParentProductId__c": "01t41000000sYZQAA2", "vlocity_cmt__ChildLineNumber__c": "1", "vlocity_cmt__SeqNumber__c": 1.00, "vlocity_cmt__CollapseHierarchy__c": false, "vlocity_cmt__IsRootProductChildItem__c": true, "vlocity_cmt__ParentProductId__r": { "attributes": { "type": "Product2", "url": "/services/data/v38.0/sobjects/Product2/01t41000000sYZQAA2" }, "Id": "01t41000000sYZQAA2", "Name": "Root 1" } }, "productHierarchyPath": "01t41000000sYZQAA2", "name": "Root 1", "isVirtualItem": false, "attributeValues": {}, "itemType": "childProduct" } ``` ### GET Get Available Sites `GET /cpq/carts/{cartid}/sites` Operation ID: `Get Available Sites`. Tags: Cart. Gets the available records for the billing account or service account look up field. Remote Handler-APISitesCartsCpqV2 Method Invoked - getAvailableSites #### Parameters * `fields` (query, array of string, collection format: csv) List of fields to return in the response, separated by commas. _Example_ ``` Id,Name ``` * `lookupField` (query, string, required) Field on the line item to look up _Example_ ``` vlocity_cmt__BillingAccountId__c ``` * `itemId` (path, string, required) Line Item ID under the cart. _Example_ ``` 80236000009E2InAAK ``` #### Responses * **200** #### Response for Get Available Sites ```json { "totalSize" => 2, "messages" => [], "actions" => { "newsite" => { "rest" => { "params" => { "fields" => "'Id'", "inputFields" => "[{\"value\":null,\"previousValue\":null,\"originalValue\":null,\"messages\":[],\"label\":\"Account Name\",\"hidden\":null,\"fieldName\":\"name\",\"editable\":true,\"dataType\":\"STRING\",\"actions\":{}}]", "objectType" => "Account" }, "method" => "POST", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwG8QAI/sites" }, "remote" => { "params" => { "fields" => "'Id'", "inputFields" => "[{\"value\":null,\"previousValue\":null,\"originalValue\":null,\"messages\":[],\"label\":\"Account Name\",\"hidden\":null,\"fieldName\":\"name\",\"editable\":true,\"dataType\":\"STRING\",\"actions\":{}}]", "objectType" => "Account", "cartId" => "8016A000000bwG8QAI", "methodName" => "newSite" } }, "client" => { "params" => {} } } }, "records" => [{ "messages" => [], "displaySequence" => -1, "Id" => "0016A000006baXeQAI", "Name" => "SFA1" }, { "messages" => [], "displaySequence" => -1, "Id" => "0016A000006bNfzQAE", "Name" => "SA" } ] } ``` ### POST Create a New Account for the Current Cart. `POST /cpq/carts/{cartid}/sites` Operation ID: `Create a New Account`. Tags: Cart. Create a new account. Remote Handler- APISitesCartsCpqV2 #### Parameters * `cartid` (path, string, required) Cart ID (Salesforce ID). Opportunity, Quote or Order ID. _Example_ ``` 801360000000oQ9 ``` * `fields` (query, array of string, collection format: csv) List of fields to return in the response, separated by commas. _Example_ ``` Id,Name ``` * `objectType` (query, string, required) Object type to create _Example_ ``` Account ``` * `inputFields` (query, array of string) List of fields to fill #### Request body (required) Request Body with cartId - required #### Create a new account for current site ```json { "objectType": "Account", "inputFields": [ { "value": "Test1234", "fieldName": "name" } ], "fields": "Name,vlocity_cmt__Active__c", } ``` Media type: `application/json`. Schema: `ValidateCartBody`. #### Responses * **200** OK - API request processed. Look for messages in the response to determine if it succeeded or failed. Media type: `application/json`. Schema: `SiteResult`. * **400** Bad Request - Invalid Parameter ### GET Get Asset List `GET /accounts/{accountId}/assets` Operation ID: `Get a list of assets`. Tags: Customer. Get a list of assets given acount Id and account type to be included.RestHandler- CpqAssetsContractsActionV2 Mehtod Invoked -getAssetsByAccount #### Parameters * `accountId` (path, string, required) Id of Account for Asset List _Example_ ``` 001f4000007hynC ``` * `includes` (query, string) type of account which the asset belongs to - billedAssets|serviceAssets|noContractAssets|customizedFilterAssets _Example_ ``` billedAssets ``` * `hierarchy` (query, integer (int32)) level of hierarchy for assets * `pagesize` (query, integer) Number of records to be returned _Example_ ``` 10 ``` * `effectiveAssetsDateFilter` (query, string) An optional date used to filter the effectivity dates for filtering the disconnected assets. If this parameter is not passed in, the API will use the current date and time. _Example_ ``` 2017-04-05T07:00:00.000Z ``` * `includeCatalogCodes` (query, boolean) Indicates whether to include assetToBasket action in the response. The catalog codes associated with the asset are returned in the assetToBasket action node, using which assetToBasket action can be performed. Default: `false`. _Example_ ``` false ``` #### Responses * **200** #### Response for Get Asset List for Account ```json { "totalSize": 1, "messages": [], "records": [{ "messages": [], "actions": { "assetchangesite": { "rest": { "params": {}, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/carts?subaction=assetChangeSite" }, "remote": { "params": { "assetList": ["02i1I00000058doQAA"], "moveDate": null, "toServiceLocation": null, "fromServiceLocation": null } }, "client": { "params": {} } }, "assettoquote": { "rest": { "params": {}, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/carts?subaction=assetToQuote" }, "remote": { "params": { "assetList": ["02i1I00000058doQAA"], "requestDate": null } }, "client": { "params": {} } }, "assettoorder": { "rest": { "params": {}, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/carts?subaction=assetToOrder" }, "remote": { "params": { "assetList": ["02i1I00000058doQAA"], "requestDate": null } }, "client": { "params": {} } } }, "displaySequence": -1, "Id": { "value": "02i1I00000058doQAA", "previousValue": null, "originalValue": null, "messages": [], "label": "Asset ID", "hidden": true, "fieldName": "Id", "editable": false, "dataType": "ID", "actions": {} }, "Quantity": { "value": 1.00, "previousValue": null, "originalValue": null, "messages": [], "label": "Quantity", "hidden": true, "fieldName": "Quantity", "editable": false, "dataType": "DOUBLE", "actions": {} }, "vlocity_cmt__ProvisioningStatus__c": { "value": "Active", "previousValue": null, "originalValue": null, "messages": [], "label": "Provisioning Status", "hidden": true, "fieldName": "vlocity_cmt__ProvisioningStatus__c", "editable": false, "dataType": "STRING", "actions": {} }, "vlocity_cmt__RecurringTotal__c": { "value": 10.00, "previousValue": null, "originalValue": null, "messages": [], "label": "Recurring Total", "hidden": true, "fieldName": "vlocity_cmt__RecurringTotal__c", "editable": false, "dataType": "CURRENCY", "actions": { "pricedetail": { "rest": { "params": {}, "method": "GET", link": "/services/apexrest/vlocity_cmt/v2/assets/02i1I00000058doQAA/pricing?accountId=0011I000007ms8TQAQ&priceDetailsFields=vlocity_cmt__RecurringTotal__c&effectiveAssetsDateFilter=2017-04-05T07:00:00.000Z" }, "remote": { "params": { "effectiveAssetsDateFilter": "2017-04-05T07:00:00.000Z", "priceDetailsFields": "vlocity_cmt__RecurringTotal__c", "priceDetail": true, "id": "02i1I00000058doQAA", "accountId": "0011I000007ms8TQAQ", "methodName": "getAssetPriceDetail" } }, "client": { "records": [], "params": {} } } } }, "vlocity_cmt__OneTimeTotal__c": { "value": 100.00, "previousValue": null, "originalValue": null, "messages": [], "label": "One Time Total", "hidden": true, "fieldName": "vlocity_cmt__OneTimeTotal__c", "editable": false, "dataType": "CURRENCY", "actions": { "pricedetail": { "rest": { "params": {}, "method": "GET", link": "/services/apexrest/vlocity_cmt/v2/assets/02i1I00000058doQAA/pricing?accountId=0011I000007ms8TQAQ&priceDetailsFields=vlocity_cmt__RecurringTotal__c&effectiveAssetsDateFilter=2017-04-05T07:00:00.000Z" }, "remote": { "params": { "effectiveAssetsDateFilter": "2017-04-05T07:00:00.000Z", "priceDetailsFields": "vlocity_cmt__OneTimeTotal__c", "priceDetail": true, "id": "02i1I00000058doQAA", "accountId": "0011I000007ms8TQAQ", "methodName": "getAssetPriceDetail" } }, "client": { "records": [], "params": {} } } } }, "vlocity_cmt__ContractId__c": { "value": "8001I0000000ThqQAE", "previousValue": null, "originalValue": null, "messages": [], "label": "Contract", "hidden": false, "fieldName": "vlocity_cmt__ContractId__c", "editable": false, "dataType": "REFERENCE", "actions": {} }, "vlocity_cmt__LineNumber__c": { "value": "0001", "previousValue": null, "originalValue": null, "messages": [], "label": "Line Number", "hidden": true, "fieldName": "vlocity_cmt__LineNumber__c", "editable": false, "dataType": "STRING", "actions": {} }, "vlocity_cmt__RootItemId__c": { "value": "02i1I00000058doQAA", "previousValue": null, "originalValue": null, "messages": [], "label": "RootItemId", "hidden": true, "fieldName": "vlocity_cmt__RootItemId__c", "editable": false, "dataType": "STRING", "actions": {} }, "vlocity_cmt__OneTimeCharge__c": { "value": 100.00, "previousValue": null, "originalValue": null, "messages": [], "label": "One Time Charge", "hidden": true, "fieldName": "vlocity_cmt__OneTimeCharge__c", "editable": false, "dataType": "CURRENCY", "actions": { "pricedetail": { "rest": { "params": {}, "method": "GET", link": "/services/apexrest/vlocity_cmt/v2/assets/02i1I00000058doQAA/pricing?accountId=0011I000007ms8TQAQ&priceDetailsFields=vlocity_cmt__RecurringTotal__c&effectiveAssetsDateFilter=2017-04-05T07:00:00.000Z" }, "remote": { "params": { "effectiveAssetsDateFilter": "2017-04-05T07:00:00.000Z", "priceDetailsFields": "vlocity_cmt__OneTimeCharge__c", "priceDetail": true, "id": "02i1I00000058doQAA", "accountId": "0011I000007ms8TQAQ", "methodName": "getAssetPriceDetail" } }, "client": { "records": [], "params": {} } } } }, "vlocity_cmt__OneTimeCalculatedPrice__c": { "value": 100.00, "previousValue": null, "originalValue": null, "messages": [], "label": "One Time Calculated Price", "hidden": true, "fieldName": "vlocity_cmt__OneTimeCalculatedPrice__c", "editable": false, "dataType": "CURRENCY", "actions": { "pricedetail": { "rest": { "params": {}, "method": "GET", link": "/services/apexrest/vlocity_cmt/v2/assets/02i1I00000058doQAA/pricing?accountId=0011I000007ms8TQAQ&priceDetailsFields=vlocity_cmt__RecurringTotal__c&effectiveAssetsDateFilter=2017-04-05T07:00:00.000Z" }, "remote": { "params": { "effectiveAssetsDateFilter": "2017-04-05T07:00:00.000Z", "priceDetailsFields": "vlocity_cmt__OneTimeCalculatedPrice__c", "priceDetail": true, "id": "02i1I00000058doQAA", "accountId": "0011I000007ms8TQAQ", "methodName": "getAssetPriceDetail" } }, "client": { "records": [], "params": {} } } } }, "vlocity_cmt__OneTimeManualDiscount__c": { "value": 0.00, "previousValue": null, "originalValue": null, "messages": [], "label": "One Time Manual Discount", "hidden": true, "fieldName": "vlocity_cmt__OneTimeManualDiscount__c", "editable": false, "dataType": "PERCENT", "actions": {} }, "vlocity_cmt__RecurringCharge__c": { "value": 10.00, "previousValue": null, "originalValue": null, "messages": [], "label": "Recurring Charge", "hidden": true, "fieldName": "vlocity_cmt__RecurringCharge__c", "editable": false, "dataType": "CURRENCY", "actions": { "pricedetail": { "rest": { "params": {}, "method": "GET", link": "/services/apexrest/vlocity_cmt/v2/assets/02i1I00000058doQAA/pricing?accountId=0011I000007ms8TQAQ&priceDetailsFields=vlocity_cmt__RecurringTotal__c&effectiveAssetsDateFilter=2017-04-05T07:00:00.000Z" }, "remote": { "params": { "effectiveAssetsDateFilter": "2017-04-05T07:00:00.000Z", "priceDetailsFields": "vlocity_cmt__RecurringCharge__c", "priceDetail": true, "id": "02i1I00000058doQAA", "accountId": "0011I000007ms8TQAQ", "methodName": "getAssetPriceDetail" } }, "client": { "records": [], "params": {} } } } }, "vlocity_cmt__RecurringCalculatedPrice__c": { "value": 10.00, "previousValue": null, "originalValue": null, "messages": [], "label": "Recurring Calculated Price", "hidden": true, "fieldName": "vlocity_cmt__RecurringCalculatedPrice__c", "editable": false, "dataType": "CURRENCY", "actions": { "pricedetail": { "rest": { "params": {}, "method": "GET", link": "/services/apexrest/vlocity_cmt/v2/assets/02i1I00000058doQAA/pricing?accountId=0011I000007ms8TQAQ&priceDetailsFields=vlocity_cmt__RecurringTotal__c&effectiveAssetsDateFilter=2017-04-05T07:00:00.000Z" }, "remote": { "params": { "effectiveAssetsDateFilter": "2017-04-05T07:00:00.000Z", "priceDetailsFields": "vlocity_cmt__RecurringCalculatedPrice__c", "priceDetail": true, "id": "02i1I00000058doQAA", "accountId": "0011I000007ms8TQAQ", "methodName": "getAssetPriceDetail" } }, "client": { "records": [], "params": {} } } } }, "vlocity_cmt__RecurringManualDiscount__c": { "value": 0.00, "previousValue": null, "originalValue": null, "messages": [], "label": "Recurring Manual Discount", "hidden": true, "fieldName": "vlocity_cmt__RecurringManualDiscount__c", "editable": false, "dataType": "PERCENT", "actions": {} }, "vlocity_cmt__ServiceAccountId__c": { "value": "0011I000007ms8TQAQ", "previousValue": null, "originalValue": null, "messages": [], "label": "Service Account", "hidden": false, "fieldName": "vlocity_cmt__ServiceAccountId__c", "editable": false, "dataType": "REFERENCE", "actions": {} }, "vlocity_cmt__BillingAccountId__c": { "value": "0011I000007ms8TQAQ", "previousValue": null, "originalValue": null, "messages": [], "label": "Billing Account", "hidden": false, "fieldName": "vlocity_cmt__BillingAccountId__c", "editable": false, "dataType": "REFERENCE", "actions": {} }, "vlocity_cmt__PricingLogData__c": { "value": "{\"LogData\":{\"OT_STD_PRC\":[{\"PriceListEntryId\":\"a2X1I0000009iFXUAY\",\"LogType\":\"PRICE\",\"PricingElementGlobalKey\":\"775e358f-31c4-e8de-e23d-e00bbbfedfa6\",\"StartValue\":100.00,\"SubType\":\"Standard\",\"Frequency\":null,\"ChargeTiming\":\"One-time\",\"EndValue\":100.00,\"DisplayText\":\"100$ OTSP\",\"PricingVariableCode\":\"OT_STD_PRC\",\"PricingElementId\":\"a2a1I000000Bar6QAC\",\"PromotionId\":null,\"OfferId\":null,\"PriceListId\":\"a2Y1I000000TlsrUAC\",\"BaseAdjustment\":null,\"BaseValue\":100.00,\"AdjustmentMethod\":null,\"AdjustmentValue\":0.00,\"Amount\":100.00,\"AdjustmentType\":\"None\",\"LogSequence\":0}],\"REC_MNTH_STD_PRC\":[{\"PriceListEntryId\":\"a2X1I0000009iFcUAI\",\"LogType\":\"PRICE\",\"PricingElementGlobalKey\":\"9ef41d53-1bba-017e-625a-b06ac2de2c28\",\"StartValue\":10.00,\"SubType\":\"Standard\",\"Frequency\":\"Monthly\",\"ChargeTiming\":\"Recurring\",\"EndValue\":10.00,\"DisplayText\":\"10$ RMSP\",\"PricingVariableCode\":\"REC_MNTH_STD_PRC\",\"PricingElementId\":\"a2a1I000000Bar1QAC\",\"PromotionId\":null,\"OfferId\":null,\"PriceListId\":\"a2Y1I000000TlsrUAC\",\"BaseAdjustment\":null,\"BaseValue\":10.00,\"AdjustmentMethod\":null,\"AdjustmentValue\":0.00,\"Amount\":10.00,\"AdjustmentType\":\"None\",\"LogSequence\":0}],\"OT_STD_PRC_CALC\":[{\"LogSequence\":0,\"DisplayText\":\"One Time Charge (100.00) - One Time Manual Discount (0.00%)\"}],\"OT_STD_PRC_TOTAL\":[{\"LogSequence\":0,\"DisplayText\":\"[One Time Calculated Price (100.00) + Rollup One Time Total (0.00)] x Quantity (1.00)\"}],\"REC_MNTH_STD_PRC_CALC\":[{\"LogSequence\":0,\"DisplayText\":\"Recurring Charge (10.00) - Recurring Manual Discount (0.00%)\"}],\"REC_MNTH_STD_PRC_TOTAL\":[{\"LogSequence\":0,\"DisplayText\":\"[Recurring Calculated Price (10.00) + Rollup Recurring Total (0.00)] x Quantity (1.00)\"}]},\"PricingVariableCodeFieldBinding\":{\"Quantity\":\"LINE_QUANTITY\",\"vlocity_cmt__EffectiveRecurringTotal__c\":\"EFF_REC_MNTH_STD_PRC_TOTAL\",\"vlocity_cmt__EffectiveOneTimeTotal__c\":\"EFF_OT_STD_PRC_TOTAL\",\"vlocity_cmt__OneTimeCalculatedPrice__c\":\"OT_STD_PRC_CALC\",\"vlocity_cmt__OneTimeManualDiscount__c\":\"OT_STD_PRC_DISC_PCT_MAN\",\"vlocity_cmt__OneTimeCharge__c\":\"OT_STD_PRC\",\"vlocity_cmt__RecurringTotal__c\":\"REC_MNTH_STD_PRC_TOTAL\",\"vlocity_cmt__RecurringCalculatedPrice__c\":\"REC_MNTH_STD_PRC_CALC\",\"vlocity_cmt__RecurringManualDiscount__c\":\"REC_MNTH_STD_PRC_DISC_PCT_MAN\",\"vlocity_cmt__RecurringCharge__c\":\"REC_MNTH_STD_PRC\",\"vlocity_cmt__OneTimeTotal__c\":\"OT_STD_PRC_TOTAL\",\"vlocity_cmt__EffectiveQuantity__c\":\"EFFECTIVE_QUANTITY\"},\"PriceAdjustmentPromoKeys\":[],\"PricingVariableCodeValues\":{\"LINE_QUANTITY\":1.00,\"OT_STD_PRC_DISC_PCT_MAN\":0.00,\"REC_MNTH_STD_PRC_DISC_PCT_MAN\":0.00,\"OT_STD_PRC\":100.00,\"OT_STD_PRC_CALC\":100.00,\"OT_STD_PRC_TOTAL\":100.00,\"REC_MNTH_STD_PRC\":10.00,\"REC_MNTH_STD_PRC_CALC\":10.00,\"REC_MNTH_STD_PRC_TOTAL\":10.00,\"ROLLUP_OT_STD_PRC_TOTAL\":0.00,\"ROLLUP_REC_MNTH_STD_PRC_TOTAL\":0.00,\"EFF_OT_STD_PRC_TOTAL\":100.00,\"EFF_REC_MNTH_STD_PRC_TOTAL\":10.00,\"EFFECTIVE_QUANTITY\":1.00},\"PricingVariableCodeBaseValues\":{\"OT_STD_PRC\":100.00,\"REC_MNTH_STD_PRC\":10.00},\"LogVersion\":\"1.0\",\"LastPricingTime\":\"2017-11-07T10:21:55.572Z\"}", "previousValue": null, "originalValue": null, "messages": [], "label": "Pricing Log", "hidden": true, "fieldName": "vlocity_cmt__PricingLogData__c", "editable": false, "dataType": "TEXTAREA", "actions": {} }, "vlocity_cmt__SequenceNumber__c": { "value": 1, "previousValue": null, "originalValue": null, "messages": [], "label": "Sequence Number", "hidden": true, "fieldName": "vlocity_cmt__SequenceNumber__c", "editable": false, "dataType": "DOUBLE", "actions": {} }, "vlocity_cmt__PricebookEntryId__c": { "value": "01u1I000000ZY4nQAG", "previousValue": null, "originalValue": null, "messages": [], "label": "PricebookEntryId", "hidden": true, "fieldName": "vlocity_cmt__PricebookEntryId__c", "editable": false, "dataType": "STRING", "actions": {} }, "vlocity_cmt__EffectiveQuantity__c": { "value": 1.00, "previousValue": null, "originalValue": null, "messages": [], "label": "Effective Quantity", "hidden": true, "fieldName": "vlocity_cmt__EffectiveQuantity__c", "editable": false, "dataType": "DOUBLE", "actions": {} }, "vlocity_cmt__EffectiveRecurringTotal__c": { "value": 10.00, "previousValue": null, "originalValue": null, "messages": [], "label": "Effective Recurring Total", "hidden": true, "fieldName": "vlocity_cmt__EffectiveRecurringTotal__c", "editable": false, "dataType": "CURRENCY", "actions": {} }, "vlocity_cmt__EffectiveOneTimeTotal__c": { "value": 100.00, "previousValue": null, "originalValue": null, "messages": [], "label": "Effective One Time Total", "hidden": true, "fieldName": "vlocity_cmt__EffectiveOneTimeTotal__c", "editable": false, "dataType": "CURRENCY", "actions": {} }, "Name": "TestA", "promotions": { "totalSize": 0, "messages": [] } }] } ``` ### GET Get Account Info `GET /accounts/{accountid}` Operation ID: `Get Account Information`. Tags: Customer. Get Account properties for a given acount Id. Rest Handler - CpqGetAccountsActionV2 Method Invoked - getAccounts #### Parameters * `accountid` (path, string, required) Customer Account ID (Salesforce ID). _Example_ ``` 001f4000007hynC ``` * `fields` (query, array of string, collection format: csv) List of fields to return in the response, separated by commas. _Example_ ``` Id,Name ``` #### Responses * **200** #### Get Account properties of the specified account id ```json { "totalSize": 1, "messages": [], "records": [{ "messages": [], "displaySequence": -1, "OwnerId": "0051I000000Qvb4QAC", "Name": "AR3" }] } ``` ### GET Get List of Contracts `GET /accounts/{accountid}/contracts` Operation ID: `Get List of Contracts`. Tags: Customer. Get a list of contracts given account Id. Rest Handler - CpqContractsAccountsActionV2 Method Invoked - getContracts #### Parameters * `accountid` (path, string, required) Customer Account ID (Salesforce ID). _Example_ ``` 001f4000007hynC ``` #### Responses * **200** #### Get list of contracts of the specified account id ```json { "totalSize": 1, "messages": [], "records": [{ "messages": [], "actions": { "getassetsbycontract": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/contracts/8001I0000000ThgQAE/assets" }, "remote": { "params": { "includes": "allAssets" } }, "client": { "params": {} } } }, "displaySequence": -1, "name": "00000364", "Id": { "value": "8001I0000000ThgQAE", "previousValue": null, "originalValue": null, "messages": [], "label": "Id", "hidden": false, "fieldName": "Id", "editable": false, "dataType": "ID", "actions": {} } }] } ``` ### GET Get price details of an asset. `GET /assets/{assetId}/pricing` Operation ID: `Get price details`. Tags: Customer. Get price details of an asset. Rest Handler - APIAssetsPricingV2 Method Invoked - getAssetPriceDetail #### Parameters * `assetId` (path, string, required) Asset ID. _Example_ ``` 02i46000000SyRk ``` * `accountid` (path, string, required) Customer Account ID (Salesforce ID). _Example_ ``` 001f4000007hynC ``` * `effectiveAssetsDateFilter` (query, string) Filters assets based on this date. _Example_ ``` 2017-04-05T07:00:00.000Z ``` * `pagesize` (query, integer) Number of records to be returned. _Example_ ``` 10 ``` * `hierarchy` (query, integer) Specifies product hierarchy. _Example_ ``` 2 ``` * `include` (query, string) if all assets need to return. _Example_ ``` allAssets ``` #### Responses * **200** OK - API request processed. Look for records. #### Get Asset Price Detail Response Example ```json { "totalSize": 1, "messages": [ ], "records": [ { "messages": [ ], "displaySequence": -1, "id": "02i46000000htMrAAI", "vlocity_cmt__OneTimeCharge__c": { "pricedetail": [ { "actions": { }, "DetailType": "PRICE", "Description": "Product B Base $100 Charge", "StartValue": 100.00, "EndValue": 100.00, "AdjustmentType": "None", "AdjustmentMethod": null, "AdjustmentValue": 0.00 } ] }, "vlocity_cmt__OneTimeCalculatedPrice__c": { "pricedetail": [ { "actions": { }, "DetailType": null, "Description": "One Time Charge (100.00) - One Time Manual Discount (0.00%)", "StartValue": null, "EndValue": null, "AdjustmentType": null, "AdjustmentMethod": null, "AdjustmentValue": null } ] }, "vlocity_cmt__OneTimeTotal__c": { "pricedetail": [ { "actions": { }, "DetailType": null, "Description": "[One Time Calculated Price (100.00) + Rollup One Time Total (0.00)] x Quantity (1.00)", "StartValue": null, "EndValue": null, "AdjustmentType": null, "AdjustmentMethod": null, "AdjustmentValue": null } ] }, "vlocity_cmt__RecurringCharge__c": { "pricedetail": [ { "actions": { }, "DetailType": "PRICE", "Description": "$10 MRC", "StartValue": 10.00, "EndValue": 10.00, "AdjustmentType": "None", "AdjustmentMethod": null, "AdjustmentValue": 0.00 }, { "actions": { }, "DetailType": "ADJUSTMENT", "Description": "Markup applied by Agent", "StartValue": 10.00, "EndValue": 15.0000, "AdjustmentType": "Markup", "AdjustmentMethod": "Percent", "AdjustmentValue": 50.00 } ] }, "vlocity_cmt__RecurringCalculatedPrice__c": { "pricedetail": [ { "actions": { }, "DetailType": null, "Description": "Recurring Charge (15.0000) - Recurring Manual Discount (0.00%)", "StartValue": null, "EndValue": null, "AdjustmentType": null, "AdjustmentMethod": null, "AdjustmentValue": null } ] }, "vlocity_cmt__RecurringTotal__c": { "pricedetail": [ { "actions": { }, "DetailType": null, "Description": "[Recurring Calculated Price (15.00) + Rollup Recurring Total (0.00)] x Quantity (1.00)", "StartValue": null, "EndValue": null, "AdjustmentType": null, "AdjustmentMethod": null, "AdjustmentValue": null } ] } } ] } ``` ### GET Get Asset List `GET /contracts/{contractId}/assets` Operation ID: `Get Asset List`. Tags: Contract. Get a list of assets given contract id. Rest Handler - CpqAssetsContractsActionV2 Method Invoked - getAssetsByContract #### Parameters * `contractId` (path, string, required) Id of Contract for Asset List. _Example_ ``` 800f4000000gLAA ``` * `hierarchy` (query, integer) Specifies product hierarchy. _Example_ ``` 2 ``` * `pagesize` (query, integer) Number of records to be returned. _Example_ ``` 10 ``` * `effectiveAssetsDateFilter` (query, string) An optional date used to filter the effectivity dates for filtering the disconnected assets. If this parameter is not passed in, the API will use the current date and time. _Example_ ``` 2017-04-05T07:00:00.000Z ``` #### Responses * **200** #### Get list of assets of the specified contract id ```json { totalSize: 1 messages: [] records: - messages: [] actions: assetchangesite: rest: params: {} method: POST link: /services/apexrest/vlocity_cmt/v2/carts?subaction=assetChangeSite remote: params: assetList: - 02i1I00000058doQAA moveDate: null toServiceLocation: null fromServiceLocation: null client: params: {} assettoquote: rest: params: {} method: POST link: /services/apexrest/vlocity_cmt/v2/carts?subaction=assetToQuote remote: params: assetList: - 02i1I00000058doQAA requestDate: null client: params: {} assettoorder: rest: params: {} method: POST link: /services/apexrest/vlocity_cmt/v2/carts?subaction=assetToOrder remote: params: assetList: - 02i1I00000058doQAA requestDate: null client: params: {} displaySequence: -1 Id: value: 02i1I00000058doQAA previousValue: null originalValue: null messages: [] label: Asset ID hidden: true fieldName: Id editable: false dataType: ID actions: {} Quantity: value: 1 previousValue: null originalValue: null messages: [] label: Quantity hidden: true fieldName: Quantity editable: false dataType: DOUBLE actions: {} vlocity_cmt__ProvisioningStatus__c: value: Active previousValue: null originalValue: null messages: [] label: Provisioning Status hidden: true fieldName: vlocity_cmt__ProvisioningStatus__c editable: false dataType: STRING actions: {} vlocity_cmt__RecurringTotal__c: value: 10 previousValue: null originalValue: null messages: [] label: Recurring Total hidden: true fieldName: vlocity_cmt__RecurringTotal__c editable: false dataType: CURRENCY actions: pricedetail: rest: params: {} method: GET link: '/services/apexrest/vlocity_cmt/v2/assets/02i1I00000058doQAA/pricing?accountId=0011I000007ms8TQAQ&priceDetailsFields=vlocity_cmt__RecurringTotal__c&effectiveAssetsDateFilter=2017-04-05T07:00:00.000Z' remote: params: effectiveAssetsDateFilter: '2017-04-05T07:00:00.000Z' priceDetailsFields: vlocity_cmt__RecurringTotal__c priceDetail: true id: 02i1I00000058doQAA accountId: 0011I000007ms8TQAQ methodName: getAssetPriceDetail client: records: [] params: {} vlocity_cmt__OneTimeTotal__c: value: 100 previousValue: null originalValue: null messages: [] label: One Time Total hidden: true fieldName: vlocity_cmt__OneTimeTotal__c editable: false dataType: CURRENCY actions: pricedetail: rest: params: {} method: GET link: '/services/apexrest/vlocity_cmt/v2/assets/02i1I00000058doQAA/pricing?accountId=0011I000007ms8TQAQ&priceDetailsFields=vlocity_cmt__OneTimeTotal__c&effectiveAssetsDateFilter=2017-04-05T07:00:00.000Z' remote: params: effectiveAssetsDateFilter: '2017-04-05T07:00:00.000Z' priceDetailsFields: vlocity_cmt__OneTimeTotal__c priceDetail: true id: 02i1I00000058doQAA accountId: 0011I000007ms8TQAQ methodName: getAssetPriceDetail client: records: [] params: {} vlocity_cmt__ContractId__c: value: 8001I0000000ThqQAE previousValue: null originalValue: null messages: [] label: Contract hidden: false fieldName: vlocity_cmt__ContractId__c editable: false dataType: REFERENCE actions: {} vlocity_cmt__LineNumber__c: value: '0001' previousValue: null originalValue: null messages: [] label: Line Number hidden: true fieldName: vlocity_cmt__LineNumber__c editable: false dataType: STRING actions: {} vlocity_cmt__RootItemId__c: value: 02i1I00000058doQAA previousValue: null originalValue: null messages: [] label: RootItemId hidden: true fieldName: vlocity_cmt__RootItemId__c editable: false dataType: STRING actions: {} vlocity_cmt__OneTimeCharge__c: value: 100 previousValue: null originalValue: null messages: [] label: One Time Charge hidden: true fieldName: vlocity_cmt__OneTimeCharge__c editable: false dataType: CURRENCY actions: pricedetail: rest: params: {} method: GET link: '/services/apexrest/vlocity_cmt/v2/assets/02i1I00000058doQAA/pricing?accountId=0011I000007ms8TQAQ&priceDetailsFields=vlocity_cmt__OneTimeCharge__c&effectiveAssetsDateFilter=2017-04-05T07:00:00.000Z' remote: params: effectiveAssetsDateFilter: '2017-04-05T07:00:00.000Z' priceDetailsFields: vlocity_cmt__OneTimeCharge__c priceDetail: true id: 02i1I00000058doQAA accountId: 0011I000007ms8TQAQ methodName: getAssetPriceDetail client: records: [] params: {} vlocity_cmt__OneTimeCalculatedPrice__c: value: 100 previousValue: null originalValue: null messages: [] label: One Time Calculated Price hidden: true fieldName: vlocity_cmt__OneTimeCalculatedPrice__c editable: false dataType: CURRENCY actions: pricedetail: rest: params: {} method: GET link: '/services/apexrest/vlocity_cmt/v2/assets/02i1I00000058doQAA/pricing?accountId=0011I000007ms8TQAQ&priceDetailsFields=vlocity_cmt__OneTimeCalculatedPrice__c&effectiveAssetsDateFilter=2017-04-05T07:00:00.000Z' remote: params: effectiveAssetsDateFilter: '2017-04-05T07:00:00.000Z' priceDetailsFields: vlocity_cmt__OneTimeCalculatedPrice__c priceDetail: true id: 02i1I00000058doQAA accountId: 0011I000007ms8TQAQ methodName: getAssetPriceDetail client: records: [] params: {} vlocity_cmt__OneTimeManualDiscount__c: value: 0 previousValue: null originalValue: null messages: [] label: One Time Manual Discount hidden: true fieldName: vlocity_cmt__OneTimeManualDiscount__c editable: false dataType: PERCENT actions: {} vlocity_cmt__RecurringCharge__c: value: 10 previousValue: null originalValue: null messages: [] label: Recurring Charge hidden: true fieldName: vlocity_cmt__RecurringCharge__c editable: false dataType: CURRENCY actions: pricedetail: rest: params: {} method: GET link: '/services/apexrest/vlocity_cmt/v2/assets/02i1I00000058doQAA/pricing?accountId=0011I000007ms8TQAQ&priceDetailsFields=vlocity_cmt__RecurringCharge__c&effectiveAssetsDateFilter=2017-04-05T07:00:00.000Z' remote: params: effectiveAssetsDateFilter: '2017-04-05T07:00:00.000Z' priceDetailsFields: vlocity_cmt__RecurringCharge__c priceDetail: true id: 02i1I00000058doQAA accountId: 0011I000007ms8TQAQ methodName: getAssetPriceDetail client: records: [] params: {} vlocity_cmt__RecurringCalculatedPrice__c: value: 10 previousValue: null originalValue: null messages: [] label: Recurring Calculated Price hidden: true fieldName: vlocity_cmt__RecurringCalculatedPrice__c editable: false dataType: CURRENCY actions: pricedetail: rest: params: {} method: GET link: '/services/apexrest/vlocity_cmt/v2/assets/02i1I00000058doQAA/pricing?accountId=0011I000007ms8TQAQ&priceDetailsFields=vlocity_cmt__RecurringCalculatedPrice__c&effectiveAssetsDateFilter=2017-04-05T07:00:00.000Z' remote: params: effectiveAssetsDateFilter: '2017-04-05T07:00:00.000Z' priceDetailsFields: vlocity_cmt__RecurringCalculatedPrice__c priceDetail: true id: 02i1I00000058doQAA accountId: 0011I000007ms8TQAQ methodName: getAssetPriceDetail client: records: [] params: {} vlocity_cmt__RecurringManualDiscount__c: value: 0 previousValue: null originalValue: null messages: [] label: Recurring Manual Discount hidden: true fieldName: vlocity_cmt__RecurringManualDiscount__c editable: false dataType: PERCENT actions: {} vlocity_cmt__ServiceAccountId__c: value: 0011I000007ms8TQAQ previousValue: null originalValue: null messages: [] label: Service Account hidden: false fieldName: vlocity_cmt__ServiceAccountId__c editable: false dataType: REFERENCE actions: {} vlocity_cmt__BillingAccountId__c: value: 0011I000007ms8TQAQ previousValue: null originalValue: null messages: [] label: Billing Account hidden: false fieldName: vlocity_cmt__BillingAccountId__c editable: false dataType: REFERENCE actions: {} vlocity_cmt__PricingLogData__c: value: '{"LogData":{"OT_STD_PRC":[{"PriceListEntryId":"a2X1I0000009iFXUAY","LogType":"PRICE","PricingElementGlobalKey":"775e358f-31c4-e8de-e23d-e00bbbfedfa6","StartValue":100.00,"SubType":"Standard","Frequency":null,"ChargeTiming":"One-time","EndValue":100.00,"DisplayText":"100$ OTSP","PricingVariableCode":"OT_STD_PRC","PricingElementId":"a2a1I000000Bar6QAC","PromotionId":null,"OfferId":null,"PriceListId":"a2Y1I000000TlsrUAC","BaseAdjustment":null,"BaseValue":100.00,"AdjustmentMethod":null,"AdjustmentValue":0.00,"Amount":100.00,"AdjustmentType":"None","LogSequence":0}],"REC_MNTH_STD_PRC":[{"PriceListEntryId":"a2X1I0000009iFcUAI","LogType":"PRICE","PricingElementGlobalKey":"9ef41d53-1bba-017e-625a-b06ac2de2c28","StartValue":10.00,"SubType":"Standard","Frequency":"Monthly","ChargeTiming":"Recurring","EndValue":10.00,"DisplayText":"10$ RMSP","PricingVariableCode":"REC_MNTH_STD_PRC","PricingElementId":"a2a1I000000Bar1QAC","PromotionId":null,"OfferId":null,"PriceListId":"a2Y1I000000TlsrUAC","BaseAdjustment":null,"BaseValue":10.00,"AdjustmentMethod":null,"AdjustmentValue":0.00,"Amount":10.00,"AdjustmentType":"None","LogSequence":0}],"OT_STD_PRC_CALC":[{"LogSequence":0,"DisplayText":"One Time Charge (100.00) - One Time Manual Discount (0.00%)"}],"OT_STD_PRC_TOTAL":[{"LogSequence":0,"DisplayText":"[One Time Calculated Price (100.00) + Rollup One Time Total (0.00)] x Quantity (1.00)"}],"REC_MNTH_STD_PRC_CALC":[{"LogSequence":0,"DisplayText":"Recurring Charge (10.00) - Recurring Manual Discount (0.00%)"}],"REC_MNTH_STD_PRC_TOTAL":[{"LogSequence":0,"DisplayText":"[Recurring Calculated Price (10.00) + Rollup Recurring Total (0.00)] x Quantity (1.00)"}]},"PricingVariableCodeFieldBinding":{"Quantity":"LINE_QUANTITY","vlocity_cmt__EffectiveRecurringTotal__c":"EFF_REC_MNTH_STD_PRC_TOTAL","vlocity_cmt__EffectiveOneTimeTotal__c":"EFF_OT_STD_PRC_TOTAL","vlocity_cmt__OneTimeCalculatedPrice__c":"OT_STD_PRC_CALC","vlocity_cmt__OneTimeManualDiscount__c":"OT_STD_PRC_DISC_PCT_MAN","vlocity_cmt__OneTimeCharge__c":"OT_STD_PRC","vlocity_cmt__RecurringTotal__c":"REC_MNTH_STD_PRC_TOTAL","vlocity_cmt__RecurringCalculatedPrice__c":"REC_MNTH_STD_PRC_CALC","vlocity_cmt__RecurringManualDiscount__c":"REC_MNTH_STD_PRC_DISC_PCT_MAN","vlocity_cmt__RecurringCharge__c":"REC_MNTH_STD_PRC","vlocity_cmt__OneTimeTotal__c":"OT_STD_PRC_TOTAL","vlocity_cmt__EffectiveQuantity__c":"EFFECTIVE_QUANTITY"},"PriceAdjustmentPromoKeys":[],"PricingVariableCodeValues":{"LINE_QUANTITY":1.00,"OT_STD_PRC_DISC_PCT_MAN":0.00,"REC_MNTH_STD_PRC_DISC_PCT_MAN":0.00,"OT_STD_PRC":100.00,"OT_STD_PRC_CALC":100.00,"OT_STD_PRC_TOTAL":100.00,"REC_MNTH_STD_PRC":10.00,"REC_MNTH_STD_PRC_CALC":10.00,"REC_MNTH_STD_PRC_TOTAL":10.00,"ROLLUP_OT_STD_PRC_TOTAL":0.00,"ROLLUP_REC_MNTH_STD_PRC_TOTAL":0.00,"EFF_OT_STD_PRC_TOTAL":100.00,"EFF_REC_MNTH_STD_PRC_TOTAL":10.00,"EFFECTIVE_QUANTITY":1.00},"PricingVariableCodeBaseValues":{"OT_STD_PRC":100.00,"REC_MNTH_STD_PRC":10.00},"LogVersion":"1.0","LastPricingTime":"2017-11-07T10:21:55.572Z"}' previousValue: null originalValue: null messages: [] label: Pricing Log hidden: true fieldName: vlocity_cmt__PricingLogData__c editable: false dataType: TEXTAREA actions: {} vlocity_cmt__SequenceNumber__c: value: 1 previousValue: null originalValue: null messages: [] label: Sequence Number hidden: true fieldName: vlocity_cmt__SequenceNumber__c editable: false dataType: DOUBLE actions: {} vlocity_cmt__PricebookEntryId__c: value: 01u1I000000ZY4nQAG previousValue: null originalValue: null messages: [] label: PricebookEntryId hidden: true fieldName: vlocity_cmt__PricebookEntryId__c editable: false dataType: STRING actions: {} vlocity_cmt__EffectiveQuantity__c: value: 1 previousValue: null originalValue: null messages: [] label: Effective Quantity hidden: true fieldName: vlocity_cmt__EffectiveQuantity__c editable: false dataType: DOUBLE actions: {} vlocity_cmt__EffectiveRecurringTotal__c: value: 10 previousValue: null originalValue: null messages: [] label: Effective Recurring Total hidden: true fieldName: vlocity_cmt__EffectiveRecurringTotal__c editable: false dataType: CURRENCY actions: {} vlocity_cmt__EffectiveOneTimeTotal__c: value: 100 previousValue: null originalValue: null messages: [] label: Effective One Time Total hidden: true fieldName: vlocity_cmt__EffectiveOneTimeTotal__c editable: false dataType: CURRENCY actions: {} Name: TestA promotions: totalSize: 0 messages: [] } ``` Media type: `application/json`. Schema: `Asset`. ### GET Get Pricelists Available to a Cart `GET /cpq/carts/{cartid}/pricelists` Operation ID: `Get Pricelists`. Tags: Cart. Get pricelists avaialble to a cart Id. Rest Handler CpqGetPriceListsActionV2 Method Invoked getPricelists #### Parameters * `cartid` (path, string, required) Cart ID (Salesforce ID). Opportunity, Quote or Order ID. _Example_ ``` 801360000000oQ9 ``` * `pagesize` (query, integer) Number of records to be returned. _Example_ ``` 10 ``` #### Responses * **200** #### Get price lists for the cart id ```json { "totalSize": 1, "messages": [], "records": [{ "messages": [], "actions": { "setpricelist": { "rest": { "params": { "inputFields": [{ "vlocity_cmt__PriceListId__c": "a2Y1I000000g50kUAA" }] }, "method": "POST", "link": "/services/apexrest/vlocity_cmt__/v2/cpq/carts/8011I000000XegcQAC" }, "remote": { "params": { "inputFields": [{ "vlocity_cmt__PriceListId__c": "a2Y1I000000g50kUAA" }], "cartId": "8011I000000XegcQAC", "methodName": "updateCarts" } }, "client": { "params": {} } } }, "displaySequence": -1, "Id": "a2Y1I000000g50kUAA", "Name": "Base PriceList" }] } ``` Media type: `application/json`. Schema: `PriceList`. ### GET Returns Flat List of Field Values. `GET /cpq/carts/{cartid}/price` Operation ID: `Get Carts Line Item`. Tags: Cart. Get Carts Line Item Prices Rest Handler - APIPriceCartsCpqV2 Method Invoked - #### Parameters * `cartid` (path, string, required) Cart ID (Salesforce ID). Opportunity, Quote or Order ID. _Example_ ``` 801360000000oQ9 ``` * `price` (query, boolean) Indicates whether to run the pricing engine (true) or not (false). Default: `true`. _Example_ ``` true ``` * `priceDetailsFields` (query, string) Comma separated list of fields to retrieve price values for _Example_ ``` vlocity_cmt__OneTimeCharge__c,vlocity_cmt__RecurringCharge__c ``` #### Responses * **200** cart items Media type: `application/json`. Schema: `array of result`. Array of `result`. ### POST Run pricing for given items to a Cart `POST /cpq/carts/{cartid}/price` Operation ID: `Run Price Cart`. Tags: Cart. Run pricing for one or more items to a specified cart. Rest Handler - APIPriceCartsCpqV2 Method Invoked - priceCart. #### Parameters * `cartid` (path, string, required) Cart ID (Salesforce ID). Opportunity, Quote or Order ID. _Example_ ``` 801360000000oQ9 ``` * `limitScopeToPassedItem` (query, boolean) Introduced in 234.6.2, this flag is used when UOWMode = True. It limits the scope of pricing and evaluating rules to the hierarchies of the items passed in the items parameter. Default value is false. _Example_ ``` true ``` #### Request body Request Body with cartId - required #### Price Cart Request Example ```json { "items": [ "8024600000CHsUa", "8024600000CCpco" ], "validate": true, "limitScopeToPassedItem": true } ``` Media type: `application/json`. Schema: `PriceCartBody`. #### Responses * **200** OK - API request processed. Look for messages in the response to determine if it succeeded or failed. Media type: `application/json`. Schema: `result`. ### GET Retrieves the price waterfall for a price. `GET /cpq/carts/{cartid}/items/{itemId}/pricing` Operation ID: `Get Pricing Details`. Tags: Cart. This API retrieves the pricing details for a price field based on the cart context (Opportunity, Quote, Order) specified by {cartId} parameter and the line item id {id}. This API is only supported by the PricingElementServiceImplementation. Rest Handler - APIItemsCartsPricingCpqV2 Method Invoked - getPriceDetail #### Parameters * `cartid` (path, string, required) Cart ID (Salesforce ID). Opportunity, Quote or Order ID. _Example_ ``` 801360000000oQ9 ``` * `itemId` (path, string, required) Line Item ID under the cart. _Example_ ``` 80236000009E2InAAK ``` * `fields` (query, array of string, collection format: csv) List of fields to return in the response, separated by commas. _Example_ ``` Id,Name ``` #### Responses * **200** #### Response for get price waterfall for a price ```json { "totalSize":1, "messages":[], "records":[{ "messages":[], "displaySequence":-1, "id":"80246000000gZfOAAU", "vlocity_cmt__OneTimeCharge__c": {"pricedetail": [{"actions":{}, "DetailType":"PRICE", "Description":"$50 One Time Standard Price", "StartValue":50, "EndValue":50, "AdjustmentType":"None", "AdjustmentMethod":null, "AdjustmentValue":0 }, {"actions":{}, "DetailType":"ADJUSTMENT", "Description":"5% Discount on OT Std Price due to Bundle A", "StartValue":50, "EndValue":47.5, "AdjustmentType":"Discount", "AdjustmentMethod":"Percent", "AdjustmentValue":-5 }, {"actions":{}, "DetailType":"ADJUSTMENT", "Description":"10% Discount on OT Std Price due to Promotion 'Add Bundle A'", "StartValue":47.5, "EndValue":42.5, "AdjustmentType":"Discount", "AdjustmentMethod":"Percent", "AdjustmentValue":-10 }, {"actions":{}, "DetailType":"ADJUSTMENT", "Description":"Additional 10% - Add Child 2 Promo", "StartValue":42.5, "EndValue":37.5, "AdjustmentType":"Discount", "AdjustmentMethod":"Percent", "AdjustmentValue":-10 } ] } } ]} ``` Media type: `application/json`. Schema: `array of result`. Array of `result`. ### PUT Applies an adjustment (discount, markup, or override to a price). `PUT /cpq/carts/{cartid}/items/{itemId}/pricing` Operation ID: `Apply an Adjustment`. Tags: Cart. This API is used to apply an adjustment (discount, markup, or override) to a price for a line item in the cart (Opportunity, Quote, Order) specified by {cartId} parameter and the line item id {id}. This API updates the existing adjustment record. This API is only supported by the PricingElementServiceImplementation. Rest Handler - APIItemsCartsPricingCpqV2.cls Method Invoked - applyAdjustment #### Parameters * `cartid` (path, string, required) Cart ID (Salesforce ID). Opportunity, Quote or Order ID. _Example_ ``` 801360000000oQ9 ``` * `itemId` (path, string, required) Line Item ID under the cart. _Example_ ``` 80236000009E2InAAK ``` #### Request body (required) Request Body with input fields #### Apply Adjustment Request Example ```json PUT /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000gmxY/items/80246000000gXh2/pricing { "adjustments": [ { "AdjustmentValue": -10, "AdjustmentMethod": "Absolute", "DetailType": "ADJUSTMENT", "PricingVariableCode": "OT_STD_PRC", "Field": "vlocity_cmt__OneTimeCharge__c" } ] } ``` Media type: `application/json`. Schema: `result`. #### Responses * **200** OK - API request processed. Look for messages in the response to determine if it succeeded or failed. #### Apply Adjustment response ```json { totalSize: 1 messages: [] records: - messages: [] actions: addtocart: rest: params: items: - quantity: 1 parentId: 80246000000hhNzAAI itemId: 01u46000001Z8aCAAS cartId: 80146000000h5jmAAA price: true validate: true includeAttachment: false pagesize: 20 lastRecordId: null hierarchy: -1 query: null method: POST link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items remote: params: methodName: postCartsItems items: - quantity: 1 parentId: 80246000000hhNzAAI itemId: 01u46000001Z8aCAAS cartId: 80146000000h5jmAAA price: true validate: true includeAttachment: false pagesize: 20 lastRecordId: null hierarchy: -1 query: null client: params: {} updateitems: rest: params: items: - itemId: 80246000000hhNzAAI filters: null fields: null cartId: 80146000000h5jmAAA price: true validate: true includeAttachment: false pagesize: 20 lastRecordId: null hierarchy: -1 query: null method: PUT link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items remote: params: methodName: putCartsItems items: - itemId: 80246000000hhNzAAI filters: null fields: null cartId: 80146000000h5jmAAA price: true validate: true includeAttachment: false pagesize: 20 lastRecordId: null hierarchy: -1 query: null client: params: {} deleteitem: rest: params: {} method: DELETE link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhNzAAI?hierarchy=-1&pagesize=20&includeAttachment=false&validate=true&price=true&cartId=80146000000h5jmAAA&id=80246000000hhNzAAI remote: params: methodName: deleteCartsItems id: 80246000000hhNzAAI filters: null fields: null cartId: 80146000000h5jmAAA price: true validate: true includeAttachment: false pagesize: 20 lastRecordId: null hierarchy: -1 query: null client: params: {} cloneitem: rest: params: items: - itemId: 80246000000hhNzAAI id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA method: POST link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/clone remote: params: methodName: cloneItems items: - itemId: 80246000000hhNzAAI id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA client: params: {} modifyattributes: rest: params: items: - itemId: 80246000000hhNzAAI filters: null id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA method: PUT link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhNzAAI/itemAttributes remote: params: methodName: putItemAttributes items: - itemId: 80246000000hhNzAAI filters: null id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA client: params: {} getpromodetails: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/promotions?cartId=80146000000h5jmAAA&id=80246000000hhNzAAI&promotionIds=a2F46000000kmtNEAQ&subaction=promodetails remote: params: methodName: getPromotionDetails subaction: promodetails promotionIds: a2F46000000kmtNEAQ id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA client: params: {} displaySequence: -1 Id: value: 80246000000hhNzAAI previousValue: null originalValue: null messages: [] label: Order Product ID hidden: false fieldName: Id editable: false dataType: ID actions: {} Pricebook2Id: 01s46000003EDDHAA4 Product2Id: 01t46000000Lo2mAAC ProductCode: BUNDLE_A UnitPrice: value: 0 previousValue: null originalValue: null messages: [] label: Unit Price hidden: true fieldName: UnitPrice editable: false dataType: CURRENCY actions: {} Name: Bundle A vlocity_cmt__RecurringPrice__c: 0 IsActive: true Product2: attributes: type: Product2 url: /services/data/v39.0/sobjects/Product2/01t46000000Lo2mAAC Id: 01t46000000Lo2mAAC Description: Bundle A Name: Bundle A vlocity_cmt__IsConfigurable__c: false vlocity_cmt__Type__c: None vlocity_cmt__SubType__c: None RecordTypeId: 01246000000hFtZAAU vlocity_cmt__JSONAttribute__c: null productId: 01t46000000Lo2mAAC defaultQuantity: 1 minQuantity: 0 maxQuantity: 99999 groupMinQuantity: 0 groupMaxQuantity: 99999 sequenceNumber: 1 productChildItemDefinition: attributes: type: vlocity_cmt__ProductChildItem__c url: /services/data/v39.0/sobjects/vlocity_cmt__ProductChildItem__c/a2V46000000cwyhEAA Id: a2V46000000cwyhEAA Name: Root PCI vlocity_cmt__IsVirtualItem__c: false vlocity_cmt__Quantity__c: 1 vlocity_cmt__MaxQuantity__c: 99999 vlocity_cmt__MinQuantity__c: 0 vlocity_cmt__MaximumChildItemQuantity__c: 99999 vlocity_cmt__MinimumChildItemQuantity__c: 0 vlocity_cmt__IsOverride__c: false vlocity_cmt__ParentProductId__c: 01t46000000Lo2mAAC vlocity_cmt__ChildLineNumber__c: '1' vlocity_cmt__SeqNumber__c: 1 vlocity_cmt__CollapseHierarchy__c: false vlocity_cmt__IsRootProductChildItem__c: true vlocity_cmt__ParentProductId__r: attributes: type: Product2 url: /services/data/v39.0/sobjects/Product2/01t46000000Lo2mAAC Id: 01t46000000Lo2mAAC Name: Bundle A productHierarchyPath: 01t46000000Lo2mAAC name: Bundle A isVirtualItem: false provisioningStatus: New hasChildren: true itemType: lineItem PricebookEntryId: value: 01u46000001Z8aCAAS previousValue: null originalValue: null messages: [] label: Price Book Entry ID hidden: false fieldName: PricebookEntryId editable: false dataType: REFERENCE actions: {} Quantity: value: 1 previousValue: null originalValue: null messages: [] label: Quantity hidden: false fieldName: Quantity editable: true dataType: DOUBLE actions: {} vlocity_cmt__OneTimeTotal__c: value: 132.5 previousValue: null originalValue: null messages: [] label: One Time Total hidden: false fieldName: vlocity_cmt__OneTimeTotal__c editable: false dataType: CURRENCY actions: adjustmentcodes: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/listsofvalues?listkeys=AdjustmentCodes&cartId=80146000000h5jmAAA&id=80246000000hhNzAAI&fields=vlocity_cmt__OneTimeTotal__c&PricingVariableCode=OT_STD_PRC_TOTAL remote: params: methodName: getListsOfValues PricingVariableCode: OT_STD_PRC_TOTAL fields: vlocity_cmt__OneTimeTotal__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA listkeys: AdjustmentCodes client: records: [] params: {} applyadjustment: rest: params: adjustments: - PricingVariableCode: OT_STD_PRC_TOTAL AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__OneTimeTotal__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA method: POST link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhNzAAI/pricing remote: params: methodName: applyAdjustment adjustments: - PricingVariableCode: OT_STD_PRC_TOTAL AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__OneTimeTotal__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA client: records: [] params: {} pricedetail: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhNzAAI/pricing?cartId=80146000000h5jmAAA&id=80246000000hhNzAAI&fields=vlocity_cmt__OneTimeTotal__c remote: params: methodName: getPriceDetail fields: vlocity_cmt__OneTimeTotal__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA client: records: [] params: {} vlocity_cmt__RecurringTotal__c: value: 470 previousValue: null originalValue: null messages: [] label: Recurring Total hidden: false fieldName: vlocity_cmt__RecurringTotal__c editable: false dataType: CURRENCY actions: adjustmentcodes: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/listsofvalues?listkeys=AdjustmentCodes&cartId=80146000000h5jmAAA&id=80246000000hhNzAAI&fields=vlocity_cmt__RecurringTotal__c&PricingVariableCode=REC_MNTH_STD_PRC_TOTAL remote: params: methodName: getListsOfValues PricingVariableCode: REC_MNTH_STD_PRC_TOTAL fields: vlocity_cmt__RecurringTotal__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA listkeys: AdjustmentCodes client: records: [] params: {} applyadjustment: rest: params: adjustments: - PricingVariableCode: REC_MNTH_STD_PRC_TOTAL AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__RecurringTotal__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA method: POST link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhNzAAI/pricing remote: params: methodName: applyAdjustment adjustments: - PricingVariableCode: REC_MNTH_STD_PRC_TOTAL AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__RecurringTotal__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA client: records: [] params: {} pricedetail: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhNzAAI/pricing?cartId=80146000000h5jmAAA&id=80246000000hhNzAAI&fields=vlocity_cmt__RecurringTotal__c remote: params: methodName: getPriceDetail fields: vlocity_cmt__RecurringTotal__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA client: records: [] params: {} vlocity_cmt__ProvisioningStatus__c: value: New previousValue: null originalValue: null messages: [] label: Provisioning Status hidden: true fieldName: vlocity_cmt__ProvisioningStatus__c editable: false dataType: STRING actions: {} vlocity_cmt__BillingAccountId__c: value: 0014600000kAHZKAA4 previousValue: null originalValue: null messages: [] label: Billing Account hidden: false fieldName: vlocity_cmt__BillingAccountId__c editable: true dataType: REFERENCE actions: availablesites: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/sites?cartId=80146000000h5jmAAA&id=80246000000hhNzAAI&lookupField=vlocity_cmt__BillingAccountId__c remote: params: methodName: getAvailableSites lookupField: vlocity_cmt__BillingAccountId__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA client: records: [] params: {} vlocity_cmt__ServiceAccountId__c: value: 0014600000kAHZKAA4 previousValue: null originalValue: null messages: [] label: Service Account hidden: false fieldName: vlocity_cmt__ServiceAccountId__c editable: true dataType: REFERENCE actions: availablesites: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/sites?cartId=80146000000h5jmAAA&id=80246000000hhNzAAI&lookupField=vlocity_cmt__ServiceAccountId__c remote: params: methodName: getAvailableSites lookupField: vlocity_cmt__ServiceAccountId__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA client: records: [] params: {} vlocity_cmt__ProductHierarchyPath__c: value: 01t46000000Lo2mAAC previousValue: null originalValue: null messages: [] label: Product Hierarchy Path hidden: true fieldName: vlocity_cmt__ProductHierarchyPath__c editable: false dataType: STRING actions: {} vlocity_cmt__LineNumber__c: value: '0001' previousValue: null originalValue: null messages: [] label: LineNumber hidden: true fieldName: vlocity_cmt__LineNumber__c editable: false dataType: STRING actions: {} vlocity_cmt__RootItemId__c: value: 80246000000hhNzAAI previousValue: null originalValue: null messages: [] label: RootItemId hidden: true fieldName: vlocity_cmt__RootItemId__c editable: false dataType: STRING actions: {} vlocity_cmt__InCartQuantityMap__c: value: 01t46000000Lo2wAAC: 1 previousValue: null originalValue: null messages: [] label: InCartQuantityMap hidden: true fieldName: vlocity_cmt__InCartQuantityMap__c editable: false dataType: TEXTAREA actions: {} ListPrice: value: 0 previousValue: null originalValue: null messages: [] label: List Price hidden: true fieldName: ListPrice editable: false dataType: CURRENCY actions: {} vlocity_cmt__OneTimeCharge__c: value: 100 previousValue: null originalValue: null messages: [] label: One Time Charge hidden: true fieldName: vlocity_cmt__OneTimeCharge__c editable: false dataType: CURRENCY actions: adjustmentcodes: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/listsofvalues?listkeys=AdjustmentCodes&cartId=80146000000h5jmAAA&id=80246000000hhNzAAI&fields=vlocity_cmt__OneTimeCharge__c&PricingVariableCode=OT_STD_PRC remote: params: methodName: getListsOfValues PricingVariableCode: OT_STD_PRC fields: vlocity_cmt__OneTimeCharge__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA listkeys: AdjustmentCodes client: records: [] params: {} applyadjustment: rest: params: adjustments: - PricingVariableCode: OT_STD_PRC AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__OneTimeCharge__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA method: POST link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhNzAAI/pricing remote: params: methodName: applyAdjustment adjustments: - PricingVariableCode: OT_STD_PRC AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__OneTimeCharge__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA client: records: [] params: {} pricedetail: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhNzAAI/pricing?cartId=80146000000h5jmAAA&id=80246000000hhNzAAI&fields=vlocity_cmt__OneTimeCharge__c remote: params: methodName: getPriceDetail fields: vlocity_cmt__OneTimeCharge__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA client: records: [] params: {} vlocity_cmt__OneTimeCalculatedPrice__c: value: 100 previousValue: null originalValue: null messages: [] label: One Time Calculated Price hidden: true fieldName: vlocity_cmt__OneTimeCalculatedPrice__c editable: false dataType: CURRENCY actions: adjustmentcodes: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/listsofvalues?listkeys=AdjustmentCodes&cartId=80146000000h5jmAAA&id=80246000000hhNzAAI&fields=vlocity_cmt__OneTimeCalculatedPrice__c&PricingVariableCode=OT_STD_PRC_CALC remote: params: methodName: getListsOfValues PricingVariableCode: OT_STD_PRC_CALC fields: vlocity_cmt__OneTimeCalculatedPrice__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA listkeys: AdjustmentCodes client: records: [] params: {} applyadjustment: rest: params: adjustments: - PricingVariableCode: OT_STD_PRC_CALC AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__OneTimeCalculatedPrice__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA method: POST link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhNzAAI/pricing remote: params: methodName: applyAdjustment adjustments: - PricingVariableCode: OT_STD_PRC_CALC AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__OneTimeCalculatedPrice__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA client: records: [] params: {} pricedetail: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhNzAAI/pricing?cartId=80146000000h5jmAAA&id=80246000000hhNzAAI&fields=vlocity_cmt__OneTimeCalculatedPrice__c remote: params: methodName: getPriceDetail fields: vlocity_cmt__OneTimeCalculatedPrice__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA client: records: [] params: {} vlocity_cmt__OneTimeManualDiscount__c: value: 0 previousValue: null originalValue: null messages: [] label: One Time Manual Discount hidden: false fieldName: vlocity_cmt__OneTimeManualDiscount__c editable: true dataType: PERCENT actions: {} vlocity_cmt__RecurringCharge__c: value: 20 previousValue: null originalValue: null messages: [] label: Recurring Charge hidden: true fieldName: vlocity_cmt__RecurringCharge__c editable: false dataType: CURRENCY actions: adjustmentcodes: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/listsofvalues?listkeys=AdjustmentCodes&cartId=80146000000h5jmAAA&id=80246000000hhNzAAI&fields=vlocity_cmt__RecurringCharge__c&PricingVariableCode=REC_MNTH_STD_PRC remote: params: methodName: getListsOfValues PricingVariableCode: REC_MNTH_STD_PRC fields: vlocity_cmt__RecurringCharge__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA listkeys: AdjustmentCodes client: records: [] params: {} timelists: rest: params: {} method: GET link: '/services/apexrest/vlocity_cmt/v2/listsofvalues?listkeys=TimePlans,TimePolicies' remote: params: methodName: getListsOfValues listkeys: 'TimePlans,TimePolicies' client: records: [] params: {} applyadjustment: rest: params: adjustments: - PricingVariableCode: REC_MNTH_STD_PRC AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__RecurringCharge__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA method: POST link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhNzAAI/pricing remote: params: methodName: applyAdjustment adjustments: - PricingVariableCode: REC_MNTH_STD_PRC AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__RecurringCharge__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA client: records: [] params: {} pricedetail: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhNzAAI/pricing?cartId=80146000000h5jmAAA&id=80246000000hhNzAAI&fields=vlocity_cmt__RecurringCharge__c remote: params: methodName: getPriceDetail fields: vlocity_cmt__RecurringCharge__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA client: records: [] params: {} vlocity_cmt__RecurringCalculatedPrice__c: value: 20 previousValue: null originalValue: null messages: [] label: Recurring Calculated Price hidden: true fieldName: vlocity_cmt__RecurringCalculatedPrice__c editable: false dataType: CURRENCY actions: adjustmentcodes: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/listsofvalues?listkeys=AdjustmentCodes&cartId=80146000000h5jmAAA&id=80246000000hhNzAAI&fields=vlocity_cmt__RecurringCalculatedPrice__c&PricingVariableCode=REC_MNTH_STD_PRC_CALC remote: params: methodName: getListsOfValues PricingVariableCode: REC_MNTH_STD_PRC_CALC fields: vlocity_cmt__RecurringCalculatedPrice__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA listkeys: AdjustmentCodes client: records: [] params: {} applyadjustment: rest: params: adjustments: - PricingVariableCode: REC_MNTH_STD_PRC_CALC AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__RecurringCalculatedPrice__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA method: POST link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhNzAAI/pricing remote: params: methodName: applyAdjustment adjustments: - PricingVariableCode: REC_MNTH_STD_PRC_CALC AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__RecurringCalculatedPrice__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA client: records: [] params: {} pricedetail: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhNzAAI/pricing?cartId=80146000000h5jmAAA&id=80246000000hhNzAAI&fields=vlocity_cmt__RecurringCalculatedPrice__c remote: params: methodName: getPriceDetail fields: vlocity_cmt__RecurringCalculatedPrice__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA client: records: [] params: {} vlocity_cmt__RecurringManualDiscount__c: value: 0 previousValue: null originalValue: null messages: [] label: Recurring Manual Discount hidden: false fieldName: vlocity_cmt__RecurringManualDiscount__c editable: true dataType: PERCENT actions: {} PricebookEntry: attributes: type: PricebookEntry url: /services/data/v39.0/sobjects/PricebookEntry/01u46000001Z8aCAAS Id: 01u46000001Z8aCAAS Product2Id: 01t46000000Lo2mAAC Pricebook2Id: 01s46000003EDDHAA4 Product2: attributes: type: Product2 url: /services/data/v39.0/sobjects/Product2/01t46000000Lo2mAAC Id: 01t46000000Lo2mAAC Name: Bundle A ProductCode: BUNDLE_A vlocity_cmt__Type__c: None vlocity_cmt__IsConfigurable__c: false vlocity_cmt__ServiceAccountId__r: attributes: type: Account url: /services/data/v39.0/sobjects/Account/0014600000kAHZKAA4 Id: 0014600000kAHZKAA4 Name: Test Account 16 vlocity_cmt__BillingAccountId__r: attributes: type: Account url: /services/data/v39.0/sobjects/Account/0014600000kAHZKAA4 Id: 0014600000kAHZKAA4 Name: Test Account 16 vlocity_cmt__Action__c: value: null previousValue: null originalValue: null messages: [] label: Action hidden: false fieldName: vlocity_cmt__Action__c editable: true dataType: PICKLIST actions: {} vlocity_cmt__ParentItemId__c: value: null previousValue: null originalValue: null messages: [] label: ParentItemId hidden: true fieldName: vlocity_cmt__ParentItemId__c editable: false dataType: STRING actions: {} vlocity_cmt__RecurringDiscountPrice__c: value: null previousValue: null originalValue: null messages: [] label: Recurring Discount Price hidden: true fieldName: vlocity_cmt__RecurringDiscountPrice__c editable: false dataType: CURRENCY actions: {} vlocity_cmt__CpqMessageData__c: value: null previousValue: null originalValue: null messages: [] label: Cpq Message Data hidden: true fieldName: vlocity_cmt__CpqMessageData__c editable: true dataType: TEXTAREA actions: {} vlocity_cmt__ItemName__c: value: null previousValue: null originalValue: null messages: [] label: Item Name hidden: false fieldName: vlocity_cmt__ItemName__c editable: true dataType: STRING actions: {} productCategories: totalSize: 0 messages: [] promotions: totalSize: 1 messages: [] records: - messages: [] actions: getpromodetails: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/promotions?cartId=80146000000h5jmAAA&id=80246000000hhNzAAI&promotionIds=a2F46000000kmtNEAQ&subaction=promodetails remote: params: methodName: getPromotionDetails subaction: promodetails promotionIds: a2F46000000kmtNEAQ id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA client: params: {} displaySequence: -1 Id: a2d46000000cq2pAAA Name: Add Bundle A Promo Sequence: 1 lineItems: totalSize: 0 messages: [] records: - messages: [] actions: addtocart: rest: params: items: - quantity: 1 parentId: 80246000000hhO0AAI parentHierarchyPath: 01t46000000Lo2mAAC itemId: 01u46000001Z8aHAAS cartId: 80146000000h5jmAAA price: true validate: true includeAttachment: false pagesize: 20 lastRecordId: null hierarchy: -1 query: null method: POST link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items remote: params: methodName: postCartsItems items: - quantity: 1 parentId: 80246000000hhO0AAI parentHierarchyPath: 01t46000000Lo2mAAC itemId: 01u46000001Z8aHAAS cartId: 80146000000h5jmAAA price: true validate: true includeAttachment: false pagesize: 20 lastRecordId: null hierarchy: -1 query: null client: params: {} updateitems: rest: params: items: - itemId: 80246000000hhO0AAI filters: null fields: null cartId: 80146000000h5jmAAA price: true validate: true includeAttachment: false pagesize: 20 lastRecordId: null hierarchy: -1 query: null method: PUT link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items remote: params: methodName: putCartsItems items: - itemId: 80246000000hhO0AAI filters: null fields: null cartId: 80146000000h5jmAAA price: true validate: true includeAttachment: false pagesize: 20 lastRecordId: null hierarchy: -1 query: null client: params: {} deleteitem: rest: params: {} method: DELETE link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhO0AAI?hierarchy=-1&pagesize=20&includeAttachment=false&validate=true&price=true&cartId=80146000000h5jmAAA&id=80246000000hhO0AAI remote: params: methodName: deleteCartsItems id: 80246000000hhO0AAI filters: null fields: null cartId: 80146000000h5jmAAA price: true validate: true includeAttachment: false pagesize: 20 lastRecordId: null hierarchy: -1 query: null client: params: {} cloneitem: rest: params: items: - itemId: 80246000000hhO0AAI id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA method: POST link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/clone remote: params: methodName: cloneItems items: - itemId: 80246000000hhO0AAI id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA client: params: {} modifyattributes: rest: params: items: - itemId: 80246000000hhO0AAI filters: null id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA method: PUT link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhO0AAI/itemAttributes remote: params: methodName: putItemAttributes items: - itemId: 80246000000hhO0AAI filters: null id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA client: params: {} getpromodetails: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/promotions?cartId=80146000000h5jmAAA&id=80246000000hhO0AAI&promotionIds=a2F46000000kmtNEAQ&subaction=promodetails remote: params: methodName: getPromotionDetails subaction: promodetails promotionIds: a2F46000000kmtNEAQ id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA client: params: {} displaySequence: -1 Id: value: 80246000000hhO0AAI previousValue: null originalValue: null messages: [] label: Order Product ID hidden: false fieldName: Id editable: false dataType: ID actions: {} Pricebook2Id: 01s46000003EDDHAA4 Product2Id: 01t46000000Lo2wAAC ProductCode: PROD_C UnitPrice: value: 0 previousValue: null originalValue: null messages: [] label: Unit Price hidden: true fieldName: UnitPrice editable: false dataType: CURRENCY actions: {} Name: Product C vlocity_cmt__RecurringPrice__c: 0 IsActive: true Product2: attributes: type: Product2 url: /services/data/v39.0/sobjects/Product2/01t46000000Lo2wAAC Id: 01t46000000Lo2wAAC Description: Product C Name: Product C vlocity_cmt__IsConfigurable__c: false vlocity_cmt__Type__c: None vlocity_cmt__SubType__c: None RecordTypeId: 01246000000hFtZAAU vlocity_cmt__JSONAttribute__c: null productId: 01t46000000Lo2wAAC defaultQuantity: 1 minQuantity: 0 maxQuantity: 2 groupMinQuantity: 0 groupMaxQuantity: 99999 sequenceNumber: 1 productChildItemDefinition: attributes: type: vlocity_cmt__ProductChildItem__c url: /services/data/v39.0/sobjects/vlocity_cmt__ProductChildItem__c/a2V46000000cwywEAA Id: a2V46000000cwywEAA Name: a2V46000000cwyw vlocity_cmt__ChildProductId__c: 01t46000000Lo2wAAC vlocity_cmt__IsVirtualItem__c: false vlocity_cmt__Quantity__c: 1 vlocity_cmt__MaxQuantity__c: 2 vlocity_cmt__MinQuantity__c: 0 vlocity_cmt__MaximumChildItemQuantity__c: 99999 vlocity_cmt__MinimumChildItemQuantity__c: 0 vlocity_cmt__IsOverride__c: false vlocity_cmt__ParentProductId__c: 01t46000000Lo2mAAC vlocity_cmt__ChildLineNumber__c: '1' vlocity_cmt__SeqNumber__c: 1 vlocity_cmt__CollapseHierarchy__c: false vlocity_cmt__IsRootProductChildItem__c: false vlocity_cmt__ChildProductId__r: attributes: type: Product2 url: /services/data/v39.0/sobjects/Product2/01t46000000Lo2wAAC Id: 01t46000000Lo2wAAC vlocity_cmt__ParentProductId__r: attributes: type: Product2 url: /services/data/v39.0/sobjects/Product2/01t46000000Lo2mAAC Id: 01t46000000Lo2mAAC Name: Bundle A productHierarchyPath: 01t46000000Lo2mAAC<01t46000000Lo2wAAC name: Product C isVirtualItem: false provisioningStatus: New hasChildren: false itemType: lineItem PricebookEntryId: value: 01u46000001Z8aHAAS previousValue: null originalValue: null messages: [] label: Price Book Entry ID hidden: false fieldName: PricebookEntryId editable: false dataType: REFERENCE actions: {} Quantity: value: 1 previousValue: null originalValue: null messages: [] label: Quantity hidden: false fieldName: Quantity editable: true dataType: DOUBLE actions: {} vlocity_cmt__OneTimeTotal__c: value: 32.5 previousValue: null originalValue: null messages: [] label: One Time Total hidden: false fieldName: vlocity_cmt__OneTimeTotal__c editable: false dataType: CURRENCY actions: adjustmentcodes: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/listsofvalues?listkeys=AdjustmentCodes&cartId=80146000000h5jmAAA&id=80246000000hhO0AAI&fields=vlocity_cmt__OneTimeTotal__c&PricingVariableCode=OT_STD_PRC_TOTAL remote: params: methodName: getListsOfValues PricingVariableCode: OT_STD_PRC_TOTAL fields: vlocity_cmt__OneTimeTotal__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA listkeys: AdjustmentCodes client: records: [] params: {} applyadjustment: rest: params: adjustments: - PricingVariableCode: OT_STD_PRC_TOTAL AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__OneTimeTotal__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA method: POST link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhO0AAI/pricing remote: params: methodName: applyAdjustment adjustments: - PricingVariableCode: OT_STD_PRC_TOTAL AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__OneTimeTotal__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA client: records: [] params: {} pricedetail: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhO0AAI/pricing?cartId=80146000000h5jmAAA&id=80246000000hhO0AAI&fields=vlocity_cmt__OneTimeTotal__c remote: params: methodName: getPriceDetail fields: vlocity_cmt__OneTimeTotal__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA client: records: [] params: {} vlocity_cmt__RecurringTotal__c: value: 450 previousValue: null originalValue: null messages: [] label: Recurring Total hidden: false fieldName: vlocity_cmt__RecurringTotal__c editable: false dataType: CURRENCY actions: adjustmentcodes: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/listsofvalues?listkeys=AdjustmentCodes&cartId=80146000000h5jmAAA&id=80246000000hhO0AAI&fields=vlocity_cmt__RecurringTotal__c&PricingVariableCode=REC_MNTH_STD_PRC_TOTAL remote: params: methodName: getListsOfValues PricingVariableCode: REC_MNTH_STD_PRC_TOTAL fields: vlocity_cmt__RecurringTotal__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA listkeys: AdjustmentCodes client: records: [] params: {} applyadjustment: rest: params: adjustments: - PricingVariableCode: REC_MNTH_STD_PRC_TOTAL AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__RecurringTotal__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA method: POST link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhO0AAI/pricing remote: params: methodName: applyAdjustment adjustments: - PricingVariableCode: REC_MNTH_STD_PRC_TOTAL AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__RecurringTotal__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA client: records: [] params: {} pricedetail: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhO0AAI/pricing?cartId=80146000000h5jmAAA&id=80246000000hhO0AAI&fields=vlocity_cmt__RecurringTotal__c remote: params: methodName: getPriceDetail fields: vlocity_cmt__RecurringTotal__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA client: records: [] params: {} vlocity_cmt__ProvisioningStatus__c: value: New previousValue: null originalValue: null messages: [] label: Provisioning Status hidden: true fieldName: vlocity_cmt__ProvisioningStatus__c editable: false dataType: STRING actions: {} vlocity_cmt__BillingAccountId__c: value: 0014600000kAHZKAA4 previousValue: null originalValue: null messages: [] label: Billing Account hidden: false fieldName: vlocity_cmt__BillingAccountId__c editable: true dataType: REFERENCE actions: availablesites: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/sites?cartId=80146000000h5jmAAA&id=80246000000hhO0AAI&lookupField=vlocity_cmt__BillingAccountId__c remote: params: methodName: getAvailableSites lookupField: vlocity_cmt__BillingAccountId__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA client: records: [] params: {} vlocity_cmt__ServiceAccountId__c: value: 0014600000kAHZKAA4 previousValue: null originalValue: null messages: [] label: Service Account hidden: false fieldName: vlocity_cmt__ServiceAccountId__c editable: true dataType: REFERENCE actions: availablesites: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/sites?cartId=80146000000h5jmAAA&id=80246000000hhO0AAI&lookupField=vlocity_cmt__ServiceAccountId__c remote: params: methodName: getAvailableSites lookupField: vlocity_cmt__ServiceAccountId__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA client: records: [] params: {} vlocity_cmt__ProductHierarchyPath__c: value: 01t46000000Lo2mAAC<01t46000000Lo2wAAC previousValue: null originalValue: null messages: [] label: Product Hierarchy Path hidden: true fieldName: vlocity_cmt__ProductHierarchyPath__c editable: false dataType: STRING actions: {} vlocity_cmt__ParentItemId__c: value: 80246000000hhNzAAI previousValue: null originalValue: null messages: [] label: ParentItemId hidden: true fieldName: vlocity_cmt__ParentItemId__c editable: false dataType: STRING actions: {} vlocity_cmt__LineNumber__c: value: 0001.0001 previousValue: null originalValue: null messages: [] label: LineNumber hidden: true fieldName: vlocity_cmt__LineNumber__c editable: false dataType: STRING actions: {} vlocity_cmt__RootItemId__c: value: 80246000000hhNzAAI previousValue: null originalValue: null messages: [] label: RootItemId hidden: true fieldName: vlocity_cmt__RootItemId__c editable: false dataType: STRING actions: {} ListPrice: value: 0 previousValue: null originalValue: null messages: [] label: List Price hidden: true fieldName: ListPrice editable: false dataType: CURRENCY actions: {} vlocity_cmt__OneTimeCharge__c: value: 32.5 previousValue: null originalValue: 50 messages: [] label: One Time Charge hidden: true fieldName: vlocity_cmt__OneTimeCharge__c editable: false dataType: CURRENCY actions: adjustmentcodes: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/listsofvalues?listkeys=AdjustmentCodes&cartId=80146000000h5jmAAA&id=80246000000hhO0AAI&fields=vlocity_cmt__OneTimeCharge__c&PricingVariableCode=OT_STD_PRC remote: params: methodName: getListsOfValues PricingVariableCode: OT_STD_PRC fields: vlocity_cmt__OneTimeCharge__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA listkeys: AdjustmentCodes client: records: [] params: {} applyadjustment: rest: params: adjustments: - PricingVariableCode: OT_STD_PRC AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__OneTimeCharge__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA method: POST link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhO0AAI/pricing remote: params: methodName: applyAdjustment adjustments: - PricingVariableCode: OT_STD_PRC AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__OneTimeCharge__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA client: records: [] params: {} pricedetail: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhO0AAI/pricing?cartId=80146000000h5jmAAA&id=80246000000hhO0AAI&fields=vlocity_cmt__OneTimeCharge__c remote: params: methodName: getPriceDetail fields: vlocity_cmt__OneTimeCharge__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA client: records: [] params: {} vlocity_cmt__OneTimeCalculatedPrice__c: value: 32.5 previousValue: null originalValue: null messages: [] label: One Time Calculated Price hidden: true fieldName: vlocity_cmt__OneTimeCalculatedPrice__c editable: false dataType: CURRENCY actions: adjustmentcodes: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/listsofvalues?listkeys=AdjustmentCodes&cartId=80146000000h5jmAAA&id=80246000000hhO0AAI&fields=vlocity_cmt__OneTimeCalculatedPrice__c&PricingVariableCode=OT_STD_PRC_CALC remote: params: methodName: getListsOfValues PricingVariableCode: OT_STD_PRC_CALC fields: vlocity_cmt__OneTimeCalculatedPrice__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA listkeys: AdjustmentCodes client: records: [] params: {} applyadjustment: rest: params: adjustments: - PricingVariableCode: OT_STD_PRC_CALC AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__OneTimeCalculatedPrice__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA method: POST link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhO0AAI/pricing remote: params: methodName: applyAdjustment adjustments: - PricingVariableCode: OT_STD_PRC_CALC AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__OneTimeCalculatedPrice__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA client: records: [] params: {} pricedetail: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhO0AAI/pricing?cartId=80146000000h5jmAAA&id=80246000000hhO0AAI&fields=vlocity_cmt__OneTimeCalculatedPrice__c remote: params: methodName: getPriceDetail fields: vlocity_cmt__OneTimeCalculatedPrice__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA client: records: [] params: {} vlocity_cmt__OneTimeManualDiscount__c: value: 0 previousValue: null originalValue: null messages: [] label: One Time Manual Discount hidden: false fieldName: vlocity_cmt__OneTimeManualDiscount__c editable: true dataType: PERCENT actions: {} vlocity_cmt__RecurringCharge__c: value: 450 previousValue: null originalValue: null messages: [] label: Recurring Charge hidden: true fieldName: vlocity_cmt__RecurringCharge__c editable: false dataType: CURRENCY actions: adjustmentcodes: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/listsofvalues?listkeys=AdjustmentCodes&cartId=80146000000h5jmAAA&id=80246000000hhO0AAI&fields=vlocity_cmt__RecurringCharge__c&PricingVariableCode=REC_MNTH_STD_PRC remote: params: methodName: getListsOfValues PricingVariableCode: REC_MNTH_STD_PRC fields: vlocity_cmt__RecurringCharge__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA listkeys: AdjustmentCodes client: records: [] params: {} timelists: rest: params: {} method: GET link: '/services/apexrest/vlocity_cmt/v2/listsofvalues?listkeys=TimePlans,TimePolicies' remote: params: methodName: getListsOfValues listkeys: 'TimePlans,TimePolicies' client: records: [] params: {} applyadjustment: rest: params: adjustments: - PricingVariableCode: REC_MNTH_STD_PRC AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__RecurringCharge__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA method: POST link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhO0AAI/pricing remote: params: methodName: applyAdjustment adjustments: - PricingVariableCode: REC_MNTH_STD_PRC AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__RecurringCharge__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA client: records: [] params: {} pricedetail: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhO0AAI/pricing?cartId=80146000000h5jmAAA&id=80246000000hhO0AAI&fields=vlocity_cmt__RecurringCharge__c remote: params: methodName: getPriceDetail fields: vlocity_cmt__RecurringCharge__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA client: records: [] params: {} vlocity_cmt__RecurringCalculatedPrice__c: value: 450 previousValue: null originalValue: null messages: [] label: Recurring Calculated Price hidden: true fieldName: vlocity_cmt__RecurringCalculatedPrice__c editable: false dataType: CURRENCY actions: adjustmentcodes: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/listsofvalues?listkeys=AdjustmentCodes&cartId=80146000000h5jmAAA&id=80246000000hhO0AAI&fields=vlocity_cmt__RecurringCalculatedPrice__c&PricingVariableCode=REC_MNTH_STD_PRC_CALC remote: params: methodName: getListsOfValues PricingVariableCode: REC_MNTH_STD_PRC_CALC fields: vlocity_cmt__RecurringCalculatedPrice__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA listkeys: AdjustmentCodes client: records: [] params: {} applyadjustment: rest: params: adjustments: - PricingVariableCode: REC_MNTH_STD_PRC_CALC AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__RecurringCalculatedPrice__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA method: POST link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhO0AAI/pricing remote: params: methodName: applyAdjustment adjustments: - PricingVariableCode: REC_MNTH_STD_PRC_CALC AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__RecurringCalculatedPrice__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA client: records: [] params: {} pricedetail: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhO0AAI/pricing?cartId=80146000000h5jmAAA&id=80246000000hhO0AAI&fields=vlocity_cmt__RecurringCalculatedPrice__c remote: params: methodName: getPriceDetail fields: vlocity_cmt__RecurringCalculatedPrice__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA client: records: [] params: {} vlocity_cmt__RecurringManualDiscount__c: value: 0 previousValue: null originalValue: null messages: [] label: Recurring Manual Discount hidden: false fieldName: vlocity_cmt__RecurringManualDiscount__c editable: true dataType: PERCENT actions: {} PricebookEntry: attributes: type: PricebookEntry url: /services/data/v39.0/sobjects/PricebookEntry/01u46000001Z8aHAAS Id: 01u46000001Z8aHAAS Product2Id: 01t46000000Lo2wAAC Pricebook2Id: 01s46000003EDDHAA4 Product2: attributes: type: Product2 url: /services/data/v39.0/sobjects/Product2/01t46000000Lo2wAAC Id: 01t46000000Lo2wAAC Name: Product C ProductCode: PROD_C vlocity_cmt__Type__c: None vlocity_cmt__IsConfigurable__c: false vlocity_cmt__ServiceAccountId__r: attributes: type: Account url: /services/data/v39.0/sobjects/Account/0014600000kAHZKAA4 Id: 0014600000kAHZKAA4 Name: Test Account 16 vlocity_cmt__BillingAccountId__r: attributes: type: Account url: /services/data/v39.0/sobjects/Account/0014600000kAHZKAA4 Id: 0014600000kAHZKAA4 Name: Test Account 16 vlocity_cmt__Action__c: value: null previousValue: null originalValue: null messages: [] label: Action hidden: false fieldName: vlocity_cmt__Action__c editable: true dataType: PICKLIST actions: {} vlocity_cmt__InCartQuantityMap__c: value: null previousValue: null originalValue: null messages: [] label: InCartQuantityMap hidden: true fieldName: vlocity_cmt__InCartQuantityMap__c editable: false dataType: TEXTAREA actions: {} vlocity_cmt__RecurringDiscountPrice__c: value: null previousValue: null originalValue: null messages: [] label: Recurring Discount Price hidden: true fieldName: vlocity_cmt__RecurringDiscountPrice__c editable: false dataType: CURRENCY actions: {} vlocity_cmt__CpqMessageData__c: value: null previousValue: null originalValue: null messages: [] label: Cpq Message Data hidden: true fieldName: vlocity_cmt__CpqMessageData__c editable: true dataType: TEXTAREA actions: {} vlocity_cmt__ItemName__c: value: null previousValue: null originalValue: null messages: [] label: Item Name hidden: false fieldName: vlocity_cmt__ItemName__c editable: true dataType: STRING actions: {} productCategories: totalSize: 0 messages: [] promotions: totalSize: 1 messages: [] records: - messages: [] actions: getpromodetails: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/promotions?cartId=80146000000h5jmAAA&id=80246000000hhO0AAI&promotionIds=a2F46000000kmtNEAQ&subaction=promodetails remote: params: methodName: getPromotionDetails subaction: promodetails promotionIds: a2F46000000kmtNEAQ id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA client: params: {} displaySequence: -1 Id: a2d46000000cq2pAAA Name: Add Bundle A Promo Sequence: 1 }]}}]}}]} ``` ### POST Applies an adjustment (discount, markup, or override to a price). `POST /cpq/carts/{cartid}/items/{itemId}/pricing` Operation ID: `Apply pricing for items`. Tags: Cart. This API is used to apply an adjustment (discount, markup, or override) to a price for a line item in the cart (Opportunity, Quote, Order) specified by {cartId} parameter and the line item id {id}. This API is only supported by the PricingElementServiceImplementation. Rest Handler - APIItemsCartsPricingCpqV2.cls Method Invoked - applyAdjustment #### Parameters * `cartid` (path, string, required) Cart ID (Salesforce ID). Opportunity, Quote or Order ID. _Example_ ``` 801360000000oQ9 ``` * `itemId` (path, string, required) Line Item ID under the cart. _Example_ ``` 80236000009E2InAAK ``` #### Request body (required) Request Body with input fields #### Apply Adjustment Request Example ```json POST /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000gmxY/items/80246000000gXh2/pricing { "adjustments": [ { "AdjustmentValue": -10, "AdjustmentMethod": "Absolute", "DetailType": "ADJUSTMENT", "PricingVariableCode": "OT_STD_PRC", "Field": "vlocity_cmt__OneTimeCharge__c" } ] } ``` Media type: `application/json`. Schema: `result`. #### Responses * **200** OK - API request processed. Look for messages in the response to determine if it succeeded or failed. #### Apply Adjustment response ```json { totalSize: 1 messages: [] records: - messages: [] actions: addtocart: rest: params: items: - quantity: 1 parentId: 80246000000hhNzAAI itemId: 01u46000001Z8aCAAS cartId: 80146000000h5jmAAA price: true validate: true includeAttachment: false pagesize: 20 lastRecordId: null hierarchy: -1 query: null method: POST link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items remote: params: methodName: postCartsItems items: - quantity: 1 parentId: 80246000000hhNzAAI itemId: 01u46000001Z8aCAAS cartId: 80146000000h5jmAAA price: true validate: true includeAttachment: false pagesize: 20 lastRecordId: null hierarchy: -1 query: null client: params: {} updateitems: rest: params: items: - itemId: 80246000000hhNzAAI filters: null fields: null cartId: 80146000000h5jmAAA price: true validate: true includeAttachment: false pagesize: 20 lastRecordId: null hierarchy: -1 query: null method: PUT link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items remote: params: methodName: putCartsItems items: - itemId: 80246000000hhNzAAI filters: null fields: null cartId: 80146000000h5jmAAA price: true validate: true includeAttachment: false pagesize: 20 lastRecordId: null hierarchy: -1 query: null client: params: {} deleteitem: rest: params: {} method: DELETE link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhNzAAI?hierarchy=-1&pagesize=20&includeAttachment=false&validate=true&price=true&cartId=80146000000h5jmAAA&id=80246000000hhNzAAI remote: params: methodName: deleteCartsItems id: 80246000000hhNzAAI filters: null fields: null cartId: 80146000000h5jmAAA price: true validate: true includeAttachment: false pagesize: 20 lastRecordId: null hierarchy: -1 query: null client: params: {} cloneitem: rest: params: items: - itemId: 80246000000hhNzAAI id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA method: POST link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/clone remote: params: methodName: cloneItems items: - itemId: 80246000000hhNzAAI id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA client: params: {} modifyattributes: rest: params: items: - itemId: 80246000000hhNzAAI filters: null id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA method: PUT link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhNzAAI/itemAttributes remote: params: methodName: putItemAttributes items: - itemId: 80246000000hhNzAAI filters: null id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA client: params: {} getpromodetails: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/promotions?cartId=80146000000h5jmAAA&id=80246000000hhNzAAI&promotionIds=a2F46000000kmtNEAQ&subaction=promodetails remote: params: methodName: getPromotionDetails subaction: promodetails promotionIds: a2F46000000kmtNEAQ id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA client: params: {} displaySequence: -1 Id: value: 80246000000hhNzAAI previousValue: null originalValue: null messages: [] label: Order Product ID hidden: false fieldName: Id editable: false dataType: ID actions: {} Pricebook2Id: 01s46000003EDDHAA4 Product2Id: 01t46000000Lo2mAAC ProductCode: BUNDLE_A UnitPrice: value: 0 previousValue: null originalValue: null messages: [] label: Unit Price hidden: true fieldName: UnitPrice editable: false dataType: CURRENCY actions: {} Name: Bundle A vlocity_cmt__RecurringPrice__c: 0 IsActive: true Product2: attributes: type: Product2 url: /services/data/v39.0/sobjects/Product2/01t46000000Lo2mAAC Id: 01t46000000Lo2mAAC Description: Bundle A Name: Bundle A vlocity_cmt__IsConfigurable__c: false vlocity_cmt__Type__c: None vlocity_cmt__SubType__c: None RecordTypeId: 01246000000hFtZAAU vlocity_cmt__JSONAttribute__c: null productId: 01t46000000Lo2mAAC defaultQuantity: 1 minQuantity: 0 maxQuantity: 99999 groupMinQuantity: 0 groupMaxQuantity: 99999 sequenceNumber: 1 productChildItemDefinition: attributes: type: vlocity_cmt__ProductChildItem__c url: /services/data/v39.0/sobjects/vlocity_cmt__ProductChildItem__c/a2V46000000cwyhEAA Id: a2V46000000cwyhEAA Name: Root PCI vlocity_cmt__IsVirtualItem__c: false vlocity_cmt__Quantity__c: 1 vlocity_cmt__MaxQuantity__c: 99999 vlocity_cmt__MinQuantity__c: 0 vlocity_cmt__MaximumChildItemQuantity__c: 99999 vlocity_cmt__MinimumChildItemQuantity__c: 0 vlocity_cmt__IsOverride__c: false vlocity_cmt__ParentProductId__c: 01t46000000Lo2mAAC vlocity_cmt__ChildLineNumber__c: '1' vlocity_cmt__SeqNumber__c: 1 vlocity_cmt__CollapseHierarchy__c: false vlocity_cmt__IsRootProductChildItem__c: true vlocity_cmt__ParentProductId__r: attributes: type: Product2 url: /services/data/v39.0/sobjects/Product2/01t46000000Lo2mAAC Id: 01t46000000Lo2mAAC Name: Bundle A productHierarchyPath: 01t46000000Lo2mAAC name: Bundle A isVirtualItem: false provisioningStatus: New hasChildren: true itemType: lineItem PricebookEntryId: value: 01u46000001Z8aCAAS previousValue: null originalValue: null messages: [] label: Price Book Entry ID hidden: false fieldName: PricebookEntryId editable: false dataType: REFERENCE actions: {} Quantity: value: 1 previousValue: null originalValue: null messages: [] label: Quantity hidden: false fieldName: Quantity editable: true dataType: DOUBLE actions: {} vlocity_cmt__OneTimeTotal__c: value: 132.5 previousValue: null originalValue: null messages: [] label: One Time Total hidden: false fieldName: vlocity_cmt__OneTimeTotal__c editable: false dataType: CURRENCY actions: adjustmentcodes: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/listsofvalues?listkeys=AdjustmentCodes&cartId=80146000000h5jmAAA&id=80246000000hhNzAAI&fields=vlocity_cmt__OneTimeTotal__c&PricingVariableCode=OT_STD_PRC_TOTAL remote: params: methodName: getListsOfValues PricingVariableCode: OT_STD_PRC_TOTAL fields: vlocity_cmt__OneTimeTotal__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA listkeys: AdjustmentCodes client: records: [] params: {} applyadjustment: rest: params: adjustments: - PricingVariableCode: OT_STD_PRC_TOTAL AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__OneTimeTotal__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA method: POST link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhNzAAI/pricing remote: params: methodName: applyAdjustment adjustments: - PricingVariableCode: OT_STD_PRC_TOTAL AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__OneTimeTotal__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA client: records: [] params: {} pricedetail: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhNzAAI/pricing?cartId=80146000000h5jmAAA&id=80246000000hhNzAAI&fields=vlocity_cmt__OneTimeTotal__c remote: params: methodName: getPriceDetail fields: vlocity_cmt__OneTimeTotal__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA client: records: [] params: {} vlocity_cmt__RecurringTotal__c: value: 470 previousValue: null originalValue: null messages: [] label: Recurring Total hidden: false fieldName: vlocity_cmt__RecurringTotal__c editable: false dataType: CURRENCY actions: adjustmentcodes: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/listsofvalues?listkeys=AdjustmentCodes&cartId=80146000000h5jmAAA&id=80246000000hhNzAAI&fields=vlocity_cmt__RecurringTotal__c&PricingVariableCode=REC_MNTH_STD_PRC_TOTAL remote: params: methodName: getListsOfValues PricingVariableCode: REC_MNTH_STD_PRC_TOTAL fields: vlocity_cmt__RecurringTotal__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA listkeys: AdjustmentCodes client: records: [] params: {} applyadjustment: rest: params: adjustments: - PricingVariableCode: REC_MNTH_STD_PRC_TOTAL AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__RecurringTotal__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA method: POST link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhNzAAI/pricing remote: params: methodName: applyAdjustment adjustments: - PricingVariableCode: REC_MNTH_STD_PRC_TOTAL AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__RecurringTotal__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA client: records: [] params: {} pricedetail: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhNzAAI/pricing?cartId=80146000000h5jmAAA&id=80246000000hhNzAAI&fields=vlocity_cmt__RecurringTotal__c remote: params: methodName: getPriceDetail fields: vlocity_cmt__RecurringTotal__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA client: records: [] params: {} vlocity_cmt__ProvisioningStatus__c: value: New previousValue: null originalValue: null messages: [] label: Provisioning Status hidden: true fieldName: vlocity_cmt__ProvisioningStatus__c editable: false dataType: STRING actions: {} vlocity_cmt__BillingAccountId__c: value: 0014600000kAHZKAA4 previousValue: null originalValue: null messages: [] label: Billing Account hidden: false fieldName: vlocity_cmt__BillingAccountId__c editable: true dataType: REFERENCE actions: availablesites: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/sites?cartId=80146000000h5jmAAA&id=80246000000hhNzAAI&lookupField=vlocity_cmt__BillingAccountId__c remote: params: methodName: getAvailableSites lookupField: vlocity_cmt__BillingAccountId__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA client: records: [] params: {} vlocity_cmt__ServiceAccountId__c: value: 0014600000kAHZKAA4 previousValue: null originalValue: null messages: [] label: Service Account hidden: false fieldName: vlocity_cmt__ServiceAccountId__c editable: true dataType: REFERENCE actions: availablesites: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/sites?cartId=80146000000h5jmAAA&id=80246000000hhNzAAI&lookupField=vlocity_cmt__ServiceAccountId__c remote: params: methodName: getAvailableSites lookupField: vlocity_cmt__ServiceAccountId__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA client: records: [] params: {} vlocity_cmt__ProductHierarchyPath__c: value: 01t46000000Lo2mAAC previousValue: null originalValue: null messages: [] label: Product Hierarchy Path hidden: true fieldName: vlocity_cmt__ProductHierarchyPath__c editable: false dataType: STRING actions: {} vlocity_cmt__LineNumber__c: value: '0001' previousValue: null originalValue: null messages: [] label: LineNumber hidden: true fieldName: vlocity_cmt__LineNumber__c editable: false dataType: STRING actions: {} vlocity_cmt__RootItemId__c: value: 80246000000hhNzAAI previousValue: null originalValue: null messages: [] label: RootItemId hidden: true fieldName: vlocity_cmt__RootItemId__c editable: false dataType: STRING actions: {} vlocity_cmt__InCartQuantityMap__c: value: 01t46000000Lo2wAAC: 1 previousValue: null originalValue: null messages: [] label: InCartQuantityMap hidden: true fieldName: vlocity_cmt__InCartQuantityMap__c editable: false dataType: TEXTAREA actions: {} ListPrice: value: 0 previousValue: null originalValue: null messages: [] label: List Price hidden: true fieldName: ListPrice editable: false dataType: CURRENCY actions: {} vlocity_cmt__OneTimeCharge__c: value: 100 previousValue: null originalValue: null messages: [] label: One Time Charge hidden: true fieldName: vlocity_cmt__OneTimeCharge__c editable: false dataType: CURRENCY actions: adjustmentcodes: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/listsofvalues?listkeys=AdjustmentCodes&cartId=80146000000h5jmAAA&id=80246000000hhNzAAI&fields=vlocity_cmt__OneTimeCharge__c&PricingVariableCode=OT_STD_PRC remote: params: methodName: getListsOfValues PricingVariableCode: OT_STD_PRC fields: vlocity_cmt__OneTimeCharge__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA listkeys: AdjustmentCodes client: records: [] params: {} applyadjustment: rest: params: adjustments: - PricingVariableCode: OT_STD_PRC AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__OneTimeCharge__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA method: POST link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhNzAAI/pricing remote: params: methodName: applyAdjustment adjustments: - PricingVariableCode: OT_STD_PRC AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__OneTimeCharge__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA client: records: [] params: {} pricedetail: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhNzAAI/pricing?cartId=80146000000h5jmAAA&id=80246000000hhNzAAI&fields=vlocity_cmt__OneTimeCharge__c remote: params: methodName: getPriceDetail fields: vlocity_cmt__OneTimeCharge__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA client: records: [] params: {} vlocity_cmt__OneTimeCalculatedPrice__c: value: 100 previousValue: null originalValue: null messages: [] label: One Time Calculated Price hidden: true fieldName: vlocity_cmt__OneTimeCalculatedPrice__c editable: false dataType: CURRENCY actions: adjustmentcodes: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/listsofvalues?listkeys=AdjustmentCodes&cartId=80146000000h5jmAAA&id=80246000000hhNzAAI&fields=vlocity_cmt__OneTimeCalculatedPrice__c&PricingVariableCode=OT_STD_PRC_CALC remote: params: methodName: getListsOfValues PricingVariableCode: OT_STD_PRC_CALC fields: vlocity_cmt__OneTimeCalculatedPrice__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA listkeys: AdjustmentCodes client: records: [] params: {} applyadjustment: rest: params: adjustments: - PricingVariableCode: OT_STD_PRC_CALC AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__OneTimeCalculatedPrice__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA method: POST link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhNzAAI/pricing remote: params: methodName: applyAdjustment adjustments: - PricingVariableCode: OT_STD_PRC_CALC AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__OneTimeCalculatedPrice__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA client: records: [] params: {} pricedetail: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhNzAAI/pricing?cartId=80146000000h5jmAAA&id=80246000000hhNzAAI&fields=vlocity_cmt__OneTimeCalculatedPrice__c remote: params: methodName: getPriceDetail fields: vlocity_cmt__OneTimeCalculatedPrice__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA client: records: [] params: {} vlocity_cmt__OneTimeManualDiscount__c: value: 0 previousValue: null originalValue: null messages: [] label: One Time Manual Discount hidden: false fieldName: vlocity_cmt__OneTimeManualDiscount__c editable: true dataType: PERCENT actions: {} vlocity_cmt__RecurringCharge__c: value: 20 previousValue: null originalValue: null messages: [] label: Recurring Charge hidden: true fieldName: vlocity_cmt__RecurringCharge__c editable: false dataType: CURRENCY actions: adjustmentcodes: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/listsofvalues?listkeys=AdjustmentCodes&cartId=80146000000h5jmAAA&id=80246000000hhNzAAI&fields=vlocity_cmt__RecurringCharge__c&PricingVariableCode=REC_MNTH_STD_PRC remote: params: methodName: getListsOfValues PricingVariableCode: REC_MNTH_STD_PRC fields: vlocity_cmt__RecurringCharge__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA listkeys: AdjustmentCodes client: records: [] params: {} timelists: rest: params: {} method: GET link: '/services/apexrest/vlocity_cmt/v2/listsofvalues?listkeys=TimePlans,TimePolicies' remote: params: methodName: getListsOfValues listkeys: 'TimePlans,TimePolicies' client: records: [] params: {} applyadjustment: rest: params: adjustments: - PricingVariableCode: REC_MNTH_STD_PRC AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__RecurringCharge__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA method: POST link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhNzAAI/pricing remote: params: methodName: applyAdjustment adjustments: - PricingVariableCode: REC_MNTH_STD_PRC AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__RecurringCharge__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA client: records: [] params: {} pricedetail: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhNzAAI/pricing?cartId=80146000000h5jmAAA&id=80246000000hhNzAAI&fields=vlocity_cmt__RecurringCharge__c remote: params: methodName: getPriceDetail fields: vlocity_cmt__RecurringCharge__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA client: records: [] params: {} vlocity_cmt__RecurringCalculatedPrice__c: value: 20 previousValue: null originalValue: null messages: [] label: Recurring Calculated Price hidden: true fieldName: vlocity_cmt__RecurringCalculatedPrice__c editable: false dataType: CURRENCY actions: adjustmentcodes: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/listsofvalues?listkeys=AdjustmentCodes&cartId=80146000000h5jmAAA&id=80246000000hhNzAAI&fields=vlocity_cmt__RecurringCalculatedPrice__c&PricingVariableCode=REC_MNTH_STD_PRC_CALC remote: params: methodName: getListsOfValues PricingVariableCode: REC_MNTH_STD_PRC_CALC fields: vlocity_cmt__RecurringCalculatedPrice__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA listkeys: AdjustmentCodes client: records: [] params: {} applyadjustment: rest: params: adjustments: - PricingVariableCode: REC_MNTH_STD_PRC_CALC AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__RecurringCalculatedPrice__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA method: POST link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhNzAAI/pricing remote: params: methodName: applyAdjustment adjustments: - PricingVariableCode: REC_MNTH_STD_PRC_CALC AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__RecurringCalculatedPrice__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA client: records: [] params: {} pricedetail: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhNzAAI/pricing?cartId=80146000000h5jmAAA&id=80246000000hhNzAAI&fields=vlocity_cmt__RecurringCalculatedPrice__c remote: params: methodName: getPriceDetail fields: vlocity_cmt__RecurringCalculatedPrice__c id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA client: records: [] params: {} vlocity_cmt__RecurringManualDiscount__c: value: 0 previousValue: null originalValue: null messages: [] label: Recurring Manual Discount hidden: false fieldName: vlocity_cmt__RecurringManualDiscount__c editable: true dataType: PERCENT actions: {} PricebookEntry: attributes: type: PricebookEntry url: /services/data/v39.0/sobjects/PricebookEntry/01u46000001Z8aCAAS Id: 01u46000001Z8aCAAS Product2Id: 01t46000000Lo2mAAC Pricebook2Id: 01s46000003EDDHAA4 Product2: attributes: type: Product2 url: /services/data/v39.0/sobjects/Product2/01t46000000Lo2mAAC Id: 01t46000000Lo2mAAC Name: Bundle A ProductCode: BUNDLE_A vlocity_cmt__Type__c: None vlocity_cmt__IsConfigurable__c: false vlocity_cmt__ServiceAccountId__r: attributes: type: Account url: /services/data/v39.0/sobjects/Account/0014600000kAHZKAA4 Id: 0014600000kAHZKAA4 Name: Test Account 16 vlocity_cmt__BillingAccountId__r: attributes: type: Account url: /services/data/v39.0/sobjects/Account/0014600000kAHZKAA4 Id: 0014600000kAHZKAA4 Name: Test Account 16 vlocity_cmt__Action__c: value: null previousValue: null originalValue: null messages: [] label: Action hidden: false fieldName: vlocity_cmt__Action__c editable: true dataType: PICKLIST actions: {} vlocity_cmt__ParentItemId__c: value: null previousValue: null originalValue: null messages: [] label: ParentItemId hidden: true fieldName: vlocity_cmt__ParentItemId__c editable: false dataType: STRING actions: {} vlocity_cmt__RecurringDiscountPrice__c: value: null previousValue: null originalValue: null messages: [] label: Recurring Discount Price hidden: true fieldName: vlocity_cmt__RecurringDiscountPrice__c editable: false dataType: CURRENCY actions: {} vlocity_cmt__CpqMessageData__c: value: null previousValue: null originalValue: null messages: [] label: Cpq Message Data hidden: true fieldName: vlocity_cmt__CpqMessageData__c editable: true dataType: TEXTAREA actions: {} vlocity_cmt__ItemName__c: value: null previousValue: null originalValue: null messages: [] label: Item Name hidden: false fieldName: vlocity_cmt__ItemName__c editable: true dataType: STRING actions: {} productCategories: totalSize: 0 messages: [] promotions: totalSize: 1 messages: [] records: - messages: [] actions: getpromodetails: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/promotions?cartId=80146000000h5jmAAA&id=80246000000hhNzAAI&promotionIds=a2F46000000kmtNEAQ&subaction=promodetails remote: params: methodName: getPromotionDetails subaction: promodetails promotionIds: a2F46000000kmtNEAQ id: 80246000000hhNzAAI cartId: 80146000000h5jmAAA client: params: {} displaySequence: -1 Id: a2d46000000cq2pAAA Name: Add Bundle A Promo Sequence: 1 lineItems: totalSize: 0 messages: [] records: - messages: [] actions: addtocart: rest: params: items: - quantity: 1 parentId: 80246000000hhO0AAI parentHierarchyPath: 01t46000000Lo2mAAC itemId: 01u46000001Z8aHAAS cartId: 80146000000h5jmAAA price: true validate: true includeAttachment: false pagesize: 20 lastRecordId: null hierarchy: -1 query: null method: POST link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items remote: params: methodName: postCartsItems items: - quantity: 1 parentId: 80246000000hhO0AAI parentHierarchyPath: 01t46000000Lo2mAAC itemId: 01u46000001Z8aHAAS cartId: 80146000000h5jmAAA price: true validate: true includeAttachment: false pagesize: 20 lastRecordId: null hierarchy: -1 query: null client: params: {} updateitems: rest: params: items: - itemId: 80246000000hhO0AAI filters: null fields: null cartId: 80146000000h5jmAAA price: true validate: true includeAttachment: false pagesize: 20 lastRecordId: null hierarchy: -1 query: null method: PUT link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items remote: params: methodName: putCartsItems items: - itemId: 80246000000hhO0AAI filters: null fields: null cartId: 80146000000h5jmAAA price: true validate: true includeAttachment: false pagesize: 20 lastRecordId: null hierarchy: -1 query: null client: params: {} deleteitem: rest: params: {} method: DELETE link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhO0AAI?hierarchy=-1&pagesize=20&includeAttachment=false&validate=true&price=true&cartId=80146000000h5jmAAA&id=80246000000hhO0AAI remote: params: methodName: deleteCartsItems id: 80246000000hhO0AAI filters: null fields: null cartId: 80146000000h5jmAAA price: true validate: true includeAttachment: false pagesize: 20 lastRecordId: null hierarchy: -1 query: null client: params: {} cloneitem: rest: params: items: - itemId: 80246000000hhO0AAI id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA method: POST link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/clone remote: params: methodName: cloneItems items: - itemId: 80246000000hhO0AAI id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA client: params: {} modifyattributes: rest: params: items: - itemId: 80246000000hhO0AAI filters: null id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA method: PUT link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhO0AAI/itemAttributes remote: params: methodName: putItemAttributes items: - itemId: 80246000000hhO0AAI filters: null id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA client: params: {} getpromodetails: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/promotions?cartId=80146000000h5jmAAA&id=80246000000hhO0AAI&promotionIds=a2F46000000kmtNEAQ&subaction=promodetails remote: params: methodName: getPromotionDetails subaction: promodetails promotionIds: a2F46000000kmtNEAQ id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA client: params: {} displaySequence: -1 Id: value: 80246000000hhO0AAI previousValue: null originalValue: null messages: [] label: Order Product ID hidden: false fieldName: Id editable: false dataType: ID actions: {} Pricebook2Id: 01s46000003EDDHAA4 Product2Id: 01t46000000Lo2wAAC ProductCode: PROD_C UnitPrice: value: 0 previousValue: null originalValue: null messages: [] label: Unit Price hidden: true fieldName: UnitPrice editable: false dataType: CURRENCY actions: {} Name: Product C vlocity_cmt__RecurringPrice__c: 0 IsActive: true Product2: attributes: type: Product2 url: /services/data/v39.0/sobjects/Product2/01t46000000Lo2wAAC Id: 01t46000000Lo2wAAC Description: Product C Name: Product C vlocity_cmt__IsConfigurable__c: false vlocity_cmt__Type__c: None vlocity_cmt__SubType__c: None RecordTypeId: 01246000000hFtZAAU vlocity_cmt__JSONAttribute__c: null productId: 01t46000000Lo2wAAC defaultQuantity: 1 minQuantity: 0 maxQuantity: 2 groupMinQuantity: 0 groupMaxQuantity: 99999 sequenceNumber: 1 productChildItemDefinition: attributes: type: vlocity_cmt__ProductChildItem__c url: /services/data/v39.0/sobjects/vlocity_cmt__ProductChildItem__c/a2V46000000cwywEAA Id: a2V46000000cwywEAA Name: a2V46000000cwyw vlocity_cmt__ChildProductId__c: 01t46000000Lo2wAAC vlocity_cmt__IsVirtualItem__c: false vlocity_cmt__Quantity__c: 1 vlocity_cmt__MaxQuantity__c: 2 vlocity_cmt__MinQuantity__c: 0 vlocity_cmt__MaximumChildItemQuantity__c: 99999 vlocity_cmt__MinimumChildItemQuantity__c: 0 vlocity_cmt__IsOverride__c: false vlocity_cmt__ParentProductId__c: 01t46000000Lo2mAAC vlocity_cmt__ChildLineNumber__c: '1' vlocity_cmt__SeqNumber__c: 1 vlocity_cmt__CollapseHierarchy__c: false vlocity_cmt__IsRootProductChildItem__c: false vlocity_cmt__ChildProductId__r: attributes: type: Product2 url: /services/data/v39.0/sobjects/Product2/01t46000000Lo2wAAC Id: 01t46000000Lo2wAAC vlocity_cmt__ParentProductId__r: attributes: type: Product2 url: /services/data/v39.0/sobjects/Product2/01t46000000Lo2mAAC Id: 01t46000000Lo2mAAC Name: Bundle A productHierarchyPath: 01t46000000Lo2mAAC<01t46000000Lo2wAAC name: Product C isVirtualItem: false provisioningStatus: New hasChildren: false itemType: lineItem PricebookEntryId: value: 01u46000001Z8aHAAS previousValue: null originalValue: null messages: [] label: Price Book Entry ID hidden: false fieldName: PricebookEntryId editable: false dataType: REFERENCE actions: {} Quantity: value: 1 previousValue: null originalValue: null messages: [] label: Quantity hidden: false fieldName: Quantity editable: true dataType: DOUBLE actions: {} vlocity_cmt__OneTimeTotal__c: value: 32.5 previousValue: null originalValue: null messages: [] label: One Time Total hidden: false fieldName: vlocity_cmt__OneTimeTotal__c editable: false dataType: CURRENCY actions: adjustmentcodes: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/listsofvalues?listkeys=AdjustmentCodes&cartId=80146000000h5jmAAA&id=80246000000hhO0AAI&fields=vlocity_cmt__OneTimeTotal__c&PricingVariableCode=OT_STD_PRC_TOTAL remote: params: methodName: getListsOfValues PricingVariableCode: OT_STD_PRC_TOTAL fields: vlocity_cmt__OneTimeTotal__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA listkeys: AdjustmentCodes client: records: [] params: {} applyadjustment: rest: params: adjustments: - PricingVariableCode: OT_STD_PRC_TOTAL AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__OneTimeTotal__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA method: POST link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhO0AAI/pricing remote: params: methodName: applyAdjustment adjustments: - PricingVariableCode: OT_STD_PRC_TOTAL AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__OneTimeTotal__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA client: records: [] params: {} pricedetail: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhO0AAI/pricing?cartId=80146000000h5jmAAA&id=80246000000hhO0AAI&fields=vlocity_cmt__OneTimeTotal__c remote: params: methodName: getPriceDetail fields: vlocity_cmt__OneTimeTotal__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA client: records: [] params: {} vlocity_cmt__RecurringTotal__c: value: 450 previousValue: null originalValue: null messages: [] label: Recurring Total hidden: false fieldName: vlocity_cmt__RecurringTotal__c editable: false dataType: CURRENCY actions: adjustmentcodes: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/listsofvalues?listkeys=AdjustmentCodes&cartId=80146000000h5jmAAA&id=80246000000hhO0AAI&fields=vlocity_cmt__RecurringTotal__c&PricingVariableCode=REC_MNTH_STD_PRC_TOTAL remote: params: methodName: getListsOfValues PricingVariableCode: REC_MNTH_STD_PRC_TOTAL fields: vlocity_cmt__RecurringTotal__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA listkeys: AdjustmentCodes client: records: [] params: {} applyadjustment: rest: params: adjustments: - PricingVariableCode: REC_MNTH_STD_PRC_TOTAL AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__RecurringTotal__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA method: POST link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhO0AAI/pricing remote: params: methodName: applyAdjustment adjustments: - PricingVariableCode: REC_MNTH_STD_PRC_TOTAL AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__RecurringTotal__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA client: records: [] params: {} pricedetail: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhO0AAI/pricing?cartId=80146000000h5jmAAA&id=80246000000hhO0AAI&fields=vlocity_cmt__RecurringTotal__c remote: params: methodName: getPriceDetail fields: vlocity_cmt__RecurringTotal__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA client: records: [] params: {} vlocity_cmt__ProvisioningStatus__c: value: New previousValue: null originalValue: null messages: [] label: Provisioning Status hidden: true fieldName: vlocity_cmt__ProvisioningStatus__c editable: false dataType: STRING actions: {} vlocity_cmt__BillingAccountId__c: value: 0014600000kAHZKAA4 previousValue: null originalValue: null messages: [] label: Billing Account hidden: false fieldName: vlocity_cmt__BillingAccountId__c editable: true dataType: REFERENCE actions: availablesites: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/sites?cartId=80146000000h5jmAAA&id=80246000000hhO0AAI&lookupField=vlocity_cmt__BillingAccountId__c remote: params: methodName: getAvailableSites lookupField: vlocity_cmt__BillingAccountId__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA client: records: [] params: {} vlocity_cmt__ServiceAccountId__c: value: 0014600000kAHZKAA4 previousValue: null originalValue: null messages: [] label: Service Account hidden: false fieldName: vlocity_cmt__ServiceAccountId__c editable: true dataType: REFERENCE actions: availablesites: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/sites?cartId=80146000000h5jmAAA&id=80246000000hhO0AAI&lookupField=vlocity_cmt__ServiceAccountId__c remote: params: methodName: getAvailableSites lookupField: vlocity_cmt__ServiceAccountId__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA client: records: [] params: {} vlocity_cmt__ProductHierarchyPath__c: value: 01t46000000Lo2mAAC<01t46000000Lo2wAAC previousValue: null originalValue: null messages: [] label: Product Hierarchy Path hidden: true fieldName: vlocity_cmt__ProductHierarchyPath__c editable: false dataType: STRING actions: {} vlocity_cmt__ParentItemId__c: value: 80246000000hhNzAAI previousValue: null originalValue: null messages: [] label: ParentItemId hidden: true fieldName: vlocity_cmt__ParentItemId__c editable: false dataType: STRING actions: {} vlocity_cmt__LineNumber__c: value: 0001.0001 previousValue: null originalValue: null messages: [] label: LineNumber hidden: true fieldName: vlocity_cmt__LineNumber__c editable: false dataType: STRING actions: {} vlocity_cmt__RootItemId__c: value: 80246000000hhNzAAI previousValue: null originalValue: null messages: [] label: RootItemId hidden: true fieldName: vlocity_cmt__RootItemId__c editable: false dataType: STRING actions: {} ListPrice: value: 0 previousValue: null originalValue: null messages: [] label: List Price hidden: true fieldName: ListPrice editable: false dataType: CURRENCY actions: {} vlocity_cmt__OneTimeCharge__c: value: 32.5 previousValue: null originalValue: 50 messages: [] label: One Time Charge hidden: true fieldName: vlocity_cmt__OneTimeCharge__c editable: false dataType: CURRENCY actions: adjustmentcodes: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/listsofvalues?listkeys=AdjustmentCodes&cartId=80146000000h5jmAAA&id=80246000000hhO0AAI&fields=vlocity_cmt__OneTimeCharge__c&PricingVariableCode=OT_STD_PRC remote: params: methodName: getListsOfValues PricingVariableCode: OT_STD_PRC fields: vlocity_cmt__OneTimeCharge__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA listkeys: AdjustmentCodes client: records: [] params: {} applyadjustment: rest: params: adjustments: - PricingVariableCode: OT_STD_PRC AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__OneTimeCharge__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA method: POST link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhO0AAI/pricing remote: params: methodName: applyAdjustment adjustments: - PricingVariableCode: OT_STD_PRC AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__OneTimeCharge__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA client: records: [] params: {} pricedetail: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhO0AAI/pricing?cartId=80146000000h5jmAAA&id=80246000000hhO0AAI&fields=vlocity_cmt__OneTimeCharge__c remote: params: methodName: getPriceDetail fields: vlocity_cmt__OneTimeCharge__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA client: records: [] params: {} vlocity_cmt__OneTimeCalculatedPrice__c: value: 32.5 previousValue: null originalValue: null messages: [] label: One Time Calculated Price hidden: true fieldName: vlocity_cmt__OneTimeCalculatedPrice__c editable: false dataType: CURRENCY actions: adjustmentcodes: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/listsofvalues?listkeys=AdjustmentCodes&cartId=80146000000h5jmAAA&id=80246000000hhO0AAI&fields=vlocity_cmt__OneTimeCalculatedPrice__c&PricingVariableCode=OT_STD_PRC_CALC remote: params: methodName: getListsOfValues PricingVariableCode: OT_STD_PRC_CALC fields: vlocity_cmt__OneTimeCalculatedPrice__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA listkeys: AdjustmentCodes client: records: [] params: {} applyadjustment: rest: params: adjustments: - PricingVariableCode: OT_STD_PRC_CALC AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__OneTimeCalculatedPrice__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA method: POST link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhO0AAI/pricing remote: params: methodName: applyAdjustment adjustments: - PricingVariableCode: OT_STD_PRC_CALC AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__OneTimeCalculatedPrice__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA client: records: [] params: {} pricedetail: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhO0AAI/pricing?cartId=80146000000h5jmAAA&id=80246000000hhO0AAI&fields=vlocity_cmt__OneTimeCalculatedPrice__c remote: params: methodName: getPriceDetail fields: vlocity_cmt__OneTimeCalculatedPrice__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA client: records: [] params: {} vlocity_cmt__OneTimeManualDiscount__c: value: 0 previousValue: null originalValue: null messages: [] label: One Time Manual Discount hidden: false fieldName: vlocity_cmt__OneTimeManualDiscount__c editable: true dataType: PERCENT actions: {} vlocity_cmt__RecurringCharge__c: value: 450 previousValue: null originalValue: null messages: [] label: Recurring Charge hidden: true fieldName: vlocity_cmt__RecurringCharge__c editable: false dataType: CURRENCY actions: adjustmentcodes: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/listsofvalues?listkeys=AdjustmentCodes&cartId=80146000000h5jmAAA&id=80246000000hhO0AAI&fields=vlocity_cmt__RecurringCharge__c&PricingVariableCode=REC_MNTH_STD_PRC remote: params: methodName: getListsOfValues PricingVariableCode: REC_MNTH_STD_PRC fields: vlocity_cmt__RecurringCharge__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA listkeys: AdjustmentCodes client: records: [] params: {} timelists: rest: params: {} method: GET link: '/services/apexrest/vlocity_cmt/v2/listsofvalues?listkeys=TimePlans,TimePolicies' remote: params: methodName: getListsOfValues listkeys: 'TimePlans,TimePolicies' client: records: [] params: {} applyadjustment: rest: params: adjustments: - PricingVariableCode: REC_MNTH_STD_PRC AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__RecurringCharge__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA method: POST link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhO0AAI/pricing remote: params: methodName: applyAdjustment adjustments: - PricingVariableCode: REC_MNTH_STD_PRC AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__RecurringCharge__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA client: records: [] params: {} pricedetail: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhO0AAI/pricing?cartId=80146000000h5jmAAA&id=80246000000hhO0AAI&fields=vlocity_cmt__RecurringCharge__c remote: params: methodName: getPriceDetail fields: vlocity_cmt__RecurringCharge__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA client: records: [] params: {} vlocity_cmt__RecurringCalculatedPrice__c: value: 450 previousValue: null originalValue: null messages: [] label: Recurring Calculated Price hidden: true fieldName: vlocity_cmt__RecurringCalculatedPrice__c editable: false dataType: CURRENCY actions: adjustmentcodes: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/listsofvalues?listkeys=AdjustmentCodes&cartId=80146000000h5jmAAA&id=80246000000hhO0AAI&fields=vlocity_cmt__RecurringCalculatedPrice__c&PricingVariableCode=REC_MNTH_STD_PRC_CALC remote: params: methodName: getListsOfValues PricingVariableCode: REC_MNTH_STD_PRC_CALC fields: vlocity_cmt__RecurringCalculatedPrice__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA listkeys: AdjustmentCodes client: records: [] params: {} applyadjustment: rest: params: adjustments: - PricingVariableCode: REC_MNTH_STD_PRC_CALC AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__RecurringCalculatedPrice__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA method: POST link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhO0AAI/pricing remote: params: methodName: applyAdjustment adjustments: - PricingVariableCode: REC_MNTH_STD_PRC_CALC AdjustmentCode: '' AdjustmentValue: 0 AdjustmentMethod: Percent DetailType: ADJUSTMENT Field: vlocity_cmt__RecurringCalculatedPrice__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA client: records: [] params: {} pricedetail: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhO0AAI/pricing?cartId=80146000000h5jmAAA&id=80246000000hhO0AAI&fields=vlocity_cmt__RecurringCalculatedPrice__c remote: params: methodName: getPriceDetail fields: vlocity_cmt__RecurringCalculatedPrice__c id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA client: records: [] params: {} vlocity_cmt__RecurringManualDiscount__c: value: 0 previousValue: null originalValue: null messages: [] label: Recurring Manual Discount hidden: false fieldName: vlocity_cmt__RecurringManualDiscount__c editable: true dataType: PERCENT actions: {} PricebookEntry: attributes: type: PricebookEntry url: /services/data/v39.0/sobjects/PricebookEntry/01u46000001Z8aHAAS Id: 01u46000001Z8aHAAS Product2Id: 01t46000000Lo2wAAC Pricebook2Id: 01s46000003EDDHAA4 Product2: attributes: type: Product2 url: /services/data/v39.0/sobjects/Product2/01t46000000Lo2wAAC Id: 01t46000000Lo2wAAC Name: Product C ProductCode: PROD_C vlocity_cmt__Type__c: None vlocity_cmt__IsConfigurable__c: false vlocity_cmt__ServiceAccountId__r: attributes: type: Account url: /services/data/v39.0/sobjects/Account/0014600000kAHZKAA4 Id: 0014600000kAHZKAA4 Name: Test Account 16 vlocity_cmt__BillingAccountId__r: attributes: type: Account url: /services/data/v39.0/sobjects/Account/0014600000kAHZKAA4 Id: 0014600000kAHZKAA4 Name: Test Account 16 vlocity_cmt__Action__c: value: null previousValue: null originalValue: null messages: [] label: Action hidden: false fieldName: vlocity_cmt__Action__c editable: true dataType: PICKLIST actions: {} vlocity_cmt__InCartQuantityMap__c: value: null previousValue: null originalValue: null messages: [] label: InCartQuantityMap hidden: true fieldName: vlocity_cmt__InCartQuantityMap__c editable: false dataType: TEXTAREA actions: {} vlocity_cmt__RecurringDiscountPrice__c: value: null previousValue: null originalValue: null messages: [] label: Recurring Discount Price hidden: true fieldName: vlocity_cmt__RecurringDiscountPrice__c editable: false dataType: CURRENCY actions: {} vlocity_cmt__CpqMessageData__c: value: null previousValue: null originalValue: null messages: [] label: Cpq Message Data hidden: true fieldName: vlocity_cmt__CpqMessageData__c editable: true dataType: TEXTAREA actions: {} vlocity_cmt__ItemName__c: value: null previousValue: null originalValue: null messages: [] label: Item Name hidden: false fieldName: vlocity_cmt__ItemName__c editable: true dataType: STRING actions: {} productCategories: totalSize: 0 messages: [] promotions: totalSize: 1 messages: [] records: - messages: [] actions: getpromodetails: rest: params: {} method: GET link: /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/promotions?cartId=80146000000h5jmAAA&id=80246000000hhO0AAI&promotionIds=a2F46000000kmtNEAQ&subaction=promodetails remote: params: methodName: getPromotionDetails subaction: promodetails promotionIds: a2F46000000kmtNEAQ id: 80246000000hhO0AAI cartId: 80146000000h5jmAAA client: params: {} displaySequence: -1 Id: a2d46000000cq2pAAA Name: Add Bundle A Promo Sequence: 1 }]}}]}}]} ``` ### DELETE Deletes an existing adjustment. `DELETE /cpq/carts/{cartid}/items/{itemId}/pricing` Operation ID: `Delete an existing adjustment`. Tags: Cart. This API is used to delete an applied adjustment (discount, markup, or override) on a price for a line item in the cart (Opportunity, Quote, Order) specified by {cartId} parameter and the line item id {id}. This API is only supported by the PricingElementServiceImplementation. Rest Handler - APIItemsCartsPricingCpqV2 Method Invoked - deleteAdjustment #### Parameters * `cartid` (path, string, required) Cart ID (Salesforce ID). Opportunity, Quote or Order ID. _Example_ ``` 801360000000oQ9 ``` * `itemId` (path, string, required) Line Item ID under the cart. _Example_ ``` 80236000009E2InAAK ``` * `adjustmentId` (query, string) Adjustment Id _Example_ ``` a2H46000000hj2ZEAQ ``` #### Responses * **200** #### Response for Delete Adjustment ```json { totalSize: 1 messages: [] records: - messages: [] displaySequence: -1 id: 02i46000000gusCAAQ nv_cmt_dev__RecurringCharge__c: pricedetail: - actions: {} DetailType: PRICE Description: $10 MRC StartValue: 10 EndValue: 10 AdjustmentType: None AdjustmentMethod: null AdjustmentValue: 0 - actions: {} DetailType: ADJUSTMENT Description: One Day Promo adjustment StartValue: 10 EndValue: 9 AdjustmentType: Discount AdjustmentMethod: Percent AdjustmentValue: -10 }] } } } } } ``` ### GET Expand Parent Item To Display Next Level Children. `GET /cpq/carts/{cartid}/items/{itemId}/expand` Operation ID: `Expand Parent Item`. Tags: Cart. This API retrieves next level of children under a particular product in a bundle (in cart) Rest Handler - APIExpandItemCartsCpqv2 Method Invoked - getExpandedItems #### Parameters * `cartid` (path, string, required) Cart ID (Salesforce ID). Opportunity, Quote or Order ID. _Example_ ``` 801360000000oQ9 ``` * `itemId` (path, string, required) Line Item ID under the cart. _Example_ ``` 80236000009E2InAAK ``` * `productHierarchyPath` (query, string) Product hierarchy path of the item getting expanded. _Example_ ``` 01t36000004hM92AAE<01t36000004hM8xAAE ``` #### Responses * **200** #### Get Expanded Cart Items ```json { "totalSize": 1, "messages": [], "records": [{ "messages": [], "actions": { "expanditems": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80136000000OXQvAAO/items/80236000009E2InAAK/expand?cartId=80136000000OXQvAAO&itemId=80236000009E2InAAK&productHierarchyPath=01t36000004hM92AAE<01t36000004hM8xAAE" }, "remote": { "params": { "methodName": "getExpandedItems", "productHierarchyPath": "01t36000004hM92AAE<01t36000004hM8xAAE", "itemId": "80236000009E2InAAK", "cartId": "80136000000OXQvAAO" } }, "client": { "params": {} } } }, "displaySequence": -1, "Id": { "label": "Price Book Entry ID", "value": "01u36000009qFdRAAU" }, "Pricebook2Id": { "label": "Price Book ID", "value": "01s36000006iLkuAAE" }, "Product2Id": { "label": "Product ID", "value": "01t36000004hM8xAAE" }, "ProductCode": { "label": "Product Code", "value": "es-aug-vhcild1" }, "UnitPrice": { "label": "List Price", "value": null }, "Name": { "label": "Product Name", "value": "es-aug-vhcild1" }, "vlocity_cmt__RecurringPrice__c": { "label": "Recurring Price", "value": null }, "IsActive": { "label": "Active", "value": true }, "Product2": { "attributes": { "type": "Product2", "url": "/services/data/v41.0/sobjects/Product2/01t36000004hM8xAAE" }, "Description": "es-aug-vhcild1", "Name": "es-aug-vhcild1", "vlocity_cmt__IsConfigurable__c": false, "vlocity_cmt__Type__c": "None", "vlocity_cmt__SubType__c": "None", "Id": "01t36000004hM8xAAE", "vlocity_cmt__JSONAttribute__c": null }, "productId": "01t36000004hM8xAAE", "defaultQuantity": 1.0, "minQuantity": 0.0, "maxQuantity": 99999.0, "groupMinQuantity": 0, "groupMaxQuantity": 99999, "sequenceNumber": 1.00, "productChildItemId": "a1x36000002sB2zAAE", "productChildItemDefinition": { "attributes": { "type": "vlocity_cmt__ProductChildItem__c", "url": "/services/data/v41.0/sobjects/vlocity_cmt__ProductChildItem__c/a1x36000002sB2zAAE" }, "vlocity_cmt__IsVirtualItem__c": true, "vlocity_cmt__ChildLineNumber__c": "1", "Name": "a1x36000002sB2z", "vlocity_cmt__SeqNumber__c": 1.00, "Id": "a1x36000002sB2zAAE", "vlocity_cmt__ChildProductId__r": { "attributes": { "type": "Product2", "url": "/services/data/v41.0/sobjects/Product2/01t36000004hM8xAAE" }, "Name": "es-aug-vhcild1", "Id": "01t36000004hM8xAAE" }, "vlocity_cmt__Quantity__c": 1, "vlocity_cmt__ParentProductId__c": "01t36000004hM92AAE", "vlocity_cmt__MinimumChildItemQuantity__c": 0, "vlocity_cmt__MaxQuantity__c": 99999, "vlocity_cmt__MaximumChildItemQuantity__c": 99999, "vlocity_cmt__IsRootProductChildItem__c": false, "vlocity_cmt__MinQuantity__c": 0, "vlocity_cmt__CollapseHierarchy__c": false, "vlocity_cmt__ParentProductId__r": { "attributes": { "type": "Product2", "url": "/services/data/v41.0/sobjects/Product2/01t36000004hM92AAE" }, "Name": "es-aug-bundle", "Id": "01t36000004hM92AAE" }, "vlocity_cmt__ChildProductId__c": "01t36000004hM8xAAE", "vlocity_cmt__IsOverride__c": false }, "productHierarchyPath": "01t36000004hM92AAE<01t36000004hM8xAAE", "isVirtualItem": true, "attributeValues": {}, "hasChildren": true, "itemType": "productGroup", "parentLineItemId": "80236000009E2InAAK", "productCategories": { "totalSize": 0, "messages": [] }, "childProducts": { "totalSize": 0, "messages": [], "records": [{ "messages": [], "actions": { "addtocart": { "rest": { "params": { "items": [{ "parentId": "80236000009E2InAAK", "parentHierarchyPath": "01t36000004hM92AAE<01t36000004hM8xAAE", "itemId": "01u36000009qFeFAAU" }], "cartId": "80136000000OXQvAAO", "price": true, "validate": true, "includeAttachment": false, "pagesize": 20, "lastRecordId": null, "hierarchy": -1, "query": null }, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80136000000OXQvAAO/items" }, "remote": { "params": { "methodName": "postCartsItems", "items": [{ "parentId": "80236000009E2InAAK", "parentHierarchyPath": "01t36000004hM92AAE<01t36000004hM8xAAE", "itemId": "01u36000009qFeFAAU" }], "cartId": "80136000000OXQvAAO", "price": true, "validate": true, "includeAttachment": false, "pagesize": 20, "lastRecordId": null, "hierarchy": -1, "query": null } }, "client": { "params": {} } }, "getproductbyid": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80136000000OXQvAAO/products?cartId=80136000000OXQvAAO&id=01u36000009qFeFAAU" }, "remote": { "params": { "methodName": "getCartsProductsById", "id": "01u36000009qFeFAAU", "cartId": "80136000000OXQvAAO" } }, "client": { "params": { "cartId": "80136000000OXQvAAO", "id": "01u36000009qFeFAAU", "methodName": "getCartsProductsById" } } } }, "displaySequence": -1, "Id": { "label": "Price Book Entry ID", "value": "01u36000009qFeFAAU" }, "Pricebook2Id": { "label": "Price Book ID", "value": "01s36000006iLkuAAE" }, "Product2Id": { "label": "Product ID", "value": "01t36000004hM97AAE" }, "ProductCode": { "label": "Product Code", "value": "es-aug-addon1" }, "UnitPrice": { "label": "List Price", "value": null }, "Name": { "label": "Product Name", "value": "es-aug-addon1" }, "vlocity_cmt__RecurringPrice__c": { "label": "Recurring Price", "value": null }, "IsActive": { "label": "Active", "value": true }, "Product2": { "attributes": { "type": "Product2", "url": "/services/data/v41.0/sobjects/Product2/01t36000004hM97AAE" }, "Description": "es-aug-addon1", "Name": "es-aug-addon1", "vlocity_cmt__IsConfigurable__c": false, "vlocity_cmt__Type__c": "None", "vlocity_cmt__SubType__c": "None", "Id": "01t36000004hM97AAE", "vlocity_cmt__JSONAttribute__c": null }, "productId": "01t36000004hM97AAE", "defaultQuantity": 0.0, "minQuantity": 0.0, "maxQuantity": 5.0, "groupMinQuantity": 0, "groupMaxQuantity": 99999, "sequenceNumber": 1.00, "productChildItemId": "a1x36000002sB39AAE", "productChildItemDefinition": { "attributes": { "type": "vlocity_cmt__ProductChildItem__c", "url": "/services/data/v41.0/sobjects/vlocity_cmt__ProductChildItem__c/a1x36000002sB39AAE" }, "vlocity_cmt__IsVirtualItem__c": false, "vlocity_cmt__ChildLineNumber__c": "1", "Name": "a1x36000002sB39", "vlocity_cmt__SeqNumber__c": 1.00, "Id": "a1x36000002sB39AAE", "vlocity_cmt__ChildProductId__r": { "attributes": { "type": "Product2", "url": "/services/data/v41.0/sobjects/Product2/01t36000004hM97AAE" }, "Name": "es-aug-addon1", "Id": "01t36000004hM97AAE" }, "vlocity_cmt__Quantity__c": 0, "vlocity_cmt__ParentProductId__c": "01t36000004hM8xAAE", "vlocity_cmt__MinimumChildItemQuantity__c": 0, "vlocity_cmt__MaxQuantity__c": 5, "vlocity_cmt__MaximumChildItemQuantity__c": 99999, "vlocity_cmt__IsRootProductChildItem__c": false, "vlocity_cmt__MinQuantity__c": 0, "vlocity_cmt__CollapseHierarchy__c": false, "vlocity_cmt__ParentProductId__r": { "attributes": { "type": "Product2", "url": "/services/data/v41.0/sobjects/Product2/01t36000004hM8xAAE" }, "Name": "es-aug-vhcild1", "Id": "01t36000004hM8xAAE" }, "vlocity_cmt__ChildProductId__c": "01t36000004hM97AAE", "vlocity_cmt__IsOverride__c": false }, "productHierarchyPath": "01t36000004hM92AAE<01t36000004hM8xAAE<01t36000004hM97AAE", "isVirtualItem": false, "attributeValues": {}, "hasChildren": false, "itemType": "childProduct", "productCategories": { "totalSize": 0, "messages": [] } }] } }] } ``` Media type: `application/json`. Schema: `array of result`. Array of `result`. ### PUT Update Item Attributes `PUT /cpq/carts/{cartid}/items/{itemId}/itemattributes` Operation ID: `Update Item Attributes`. Tags: Cart. This API runs the product configuration rules on the updated attribute in the cart. Any changes done as an impact of product configuration rules are returned back as response of this API. Rest Handler - APIItemAttributesItemsCartsCpqV2 Method Invoked - putItemAttributes #### Parameters * `cartid` (path, string, required) Cart ID (Salesforce ID). Opportunity, Quote or Order ID. _Example_ ``` 801360000000oQ9 ``` * `itemId` (path, string, required) Line Item ID under the cart. _Example_ ``` 80236000009E2InAAK ``` * `price` (query, boolean) pricing evaluation _Example_ ``` true ``` * `validate` (query, boolean) Indicates whether validation rules are run for the current API request (true) or not (false). Default: `true`. _Example_ ``` true ``` #### Request body (required) Request Body with input fields. #### Update Item Attributes request example ```json { "fields":null, "items":{JSONRECORD}, "itemId":"8021I000001kvWeQAI", "cartId":"8011I000000TOcSQAW", "methodName":"putItemAttributes", "price":true,"validate":true } ``` Media type: `application/json`. Schema: `Item`. #### Responses * **200** #### Response for update item attributes ```json { "methodName": "putItemAttributes", "items": { "records": [{ "attributeCategories": { "totalSize": 1, "messages": [], "records": [{ "messages": [], "displaySequence": 999, "Code__c": "0529CattegoryA", "Name": "0529CattegoryA", "id": "a0941000006fDUjAAM", "productAttributes": { "totalSize": 1, "messages": [], "records": [{ "messages": [], "code": "A_PicklistAttribute_Text", "dataType": "text", "inputType": "dropdown", "multiselect": false, "required": false, "readonly": false, "disabled": false, "filterable": true, "attributeId": "a0A41000005Xp1IEAS", "label": "A_PicklistAttribute_Text", "displaySequence": 1, "hasRules": true, "values": [{ "id": "1", "name": "1", "label": "I am first (label)", "readonly": false, "disabled": false, "value": "1", "defaultSelected": false }, { "id": "2", "name": "2", "label": "I am second (label)", "readonly": false, "disabled": false, "value": "2", "defaultSelected": false }, { "id": "3", "name": "3", "label": "I am third (label)", "readonly": false, "disabled": false, "value": "3", "defaultSelected": false }, { "id": "4", "name": "4", "label": "I am no sequence (label)", "readonly": false, "disabled": false, "value": "4", "defaultSelected": false } ], "userValues": "1" }] } }] }, "Id": { "value": "80241000006AutkAAC", "previousValue": null, "originalValue": null, "messages": [], "label": "Order Product ID", "hidden": false, "fieldName": "Id", "editable": false, "dataType": "ID", "actions": {} }, "Product2": { "attributes": { "type": "Product2", "url": "/services/data/v41.0/sobjects/Product2/01t410000032V0sAAE" }, "Name": "City2City", "vlocity_cmt_develop__IsConfigurable__c": true, "vlocity_cmt_develop__Type__c": "None", "vlocity_cmt_develop__SubType__c": "None", "Id": "01t410000032V0sAAE", "vlocity_cmt_develop__JSONAttribute__c": null }, "PricebookEntry": { "attributes": { "type": "PricebookEntry", "url": "/services/data/v41.0/sobjects/PricebookEntry/01u41000004eEY1AAM" }, "Product2Id": "01t410000032V0sAAE", "Pricebook2Id": "01s41000007liRQAAY", "Id": "01u41000004eEY1AAM", "Product2": { "attributes": { "type": "Product2", "url": "/services/data/v41.0/sobjects/Product2/01t410000032V0sAAE" }, "Name": "City2City", "Id": "01t410000032V0sAAE", "ProductCode": "City2City", "vlocity_cmt_develop__Type__c": "None", "vlocity_cmt_develop__IsConfigurable__c": true }, "value": { "attributes": { "type": "PricebookEntry", "url": "/services/data/v41.0/sobjects/PricebookEntry/01u41000004eEY1AAM" }, "Product2Id": "01t410000032V0sAAE", "Id": "01u41000004eEY1AAM", "Product2": { "attributes": { "type": "Product2", "url": "/services/data/v41.0/sobjects/Product2/01t410000032V0sAAE" }, "Name": "City2City", "Id": "01t410000032V0sAAE" } } }, "PricebookEntryId": { "value": "01u41000004eEY1AAM", "previousValue": null, "originalValue": null, "messages": [], "label": "Price Book Entry ID", "hidden": false, "fieldName": "PricebookEntryId", "editable": false, "dataType": "REFERENCE", "actions": {} } }] }, "filters": null, "itemId": "80241000006AutkAAC", "id": "80241000006AutkAAC", "cartId": "80141000002H2ILAA0", "price": true, "validate": true } ``` Media type: `application/json`. Schema: `array of result`. Array of `result`. ### POST Clones line items in the cart. `POST /cpq/carts/{cartid}/items/clone` Operation ID: `Clones line items`. Tags: Cart. Clones line items in the cart. #### Parameters * `cartid` (path, string, required) Cart ID (Salesforce ID). Opportunity, Quote or Order ID. _Example_ ``` 801360000000oQ9 ``` * `itemId` (path, string, required) Line Item ID under the cart. _Example_ ``` 80236000009E2InAAK ``` #### Request body (required) Request Body with input fields. #### Clone root line item request example ```json { "methodName": "cloneItems", "cartId": "801360000008eNU", "items":[ {"itemId":"01t36000000pfcKAAQ"}] } ``` #### Clone child line item request example ```json { "methodName": "cloneItems", "cartId": "8014T000000rXVo", "items": [ { "itemId": "8024T000000hVrX", "parentRecord": { "records": [ { "Id": "8024T000000hVaj", "productId": "01t4T000000WTjwQAG", "productHierarchyPath": "01t4T000000WTjwQAG", "itemType": "lineItem", "parentLineItemId": "8024T000000hVaj" } ] } } ] } ``` Media type: `application/json`. Schema: `Item`. #### Responses * **200** #### Clone root line items ```json { "totalSize" => 1, "messages" => [{ "severity" => "INFO", "messageId" => nil, "message" => "Clone Successful.", "code" => "153", "bundleId" => nil, "actions" => {} }], "actions" => { "itempricesupdated" => { "rest" => { "params" => {}, "method" => "GET", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwDJQAY/price" }, "remote" => { "params" => { "cartId" => "8016A000000bwDJQAY", "methodName" => "getCartLineItemPrices" } }, "client" => { "params" => {} } } }, "records" => [{ "messages" => [], "actions" => { "addtocart" => { "rest" => { "params" => { "items" => [{ "quantity" => 1, "parentId" => "8026A000000cCaQQAU", "itemId" => "01u6A00000135XeQAI" }], "cartId" => "8016A000000bwDJQAY", "price" => true, "validate" => true, "includeAttachment" => false, "pagesize" => 20, "lastRecordId" => nil, "hierarchy" => -1, "query" => nil }, "method" => "POST", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwDJQAY/items" }, "remote" => { "params" => { "methodName" => "postCartsItems", "items" => [{ "quantity" => 1, "parentId" => "8026A000000cCaQQAU", "itemId" => "01u6A00000135XeQAI" }], "cartId" => "8016A000000bwDJQAY", "price" => true, "validate" => true, "includeAttachment" => false, "pagesize" => 20, "lastRecordId" => nil, "hierarchy" => -1, "query" => nil } }, "client" => { "params" => {} } }, "updateitems" => { "rest" => { "params" => { "items" => [{ "itemId" => "8026A000000cCaQQAU" }], "filters" => nil, "fields" => nil, "cartId" => "8016A000000bwDJQAY", "price" => true, "validate" => true, "includeAttachment" => false, "pagesize" => 20, "lastRecordId" => nil, "hierarchy" => -1, "query" => nil }, "method" => "PUT", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwDJQAY/items" }, "remote" => { "params" => { "methodName" => "putCartsItems", "items" => [{ "itemId" => "8026A000000cCaQQAU" }], "filters" => nil, "fields" => nil, "cartId" => "8016A000000bwDJQAY", "price" => true, "validate" => true, "includeAttachment" => false, "pagesize" => 20, "lastRecordId" => nil, "hierarchy" => -1, "query" => nil } }, "client" => { "params" => {} } }, "deleteitem" => { "rest" => { "params" => {}, "method" => "DELETE", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwDJQAY/items/8026A000000cCaQQAU?hierarchy=-1&pagesize=20&includeAttachment=false&validate=true&price=true&cartId=8016A000000bwDJQAY&id=8026A000000cCaQQAU" }, "remote" => { "params" => { "methodName" => "deleteCartsItems", "id" => "8026A000000cCaQQAU", "filters" => nil, "fields" => nil, "cartId" => "8016A000000bwDJQAY", "price" => true, "validate" => true, "includeAttachment" => false, "pagesize" => 20, "lastRecordId" => nil, "hierarchy" => -1, "query" => nil } }, "client" => { "params" => {} } }, "cloneitem" => { "rest" => { "params" => { "items" => [{ "itemId" => "8026A000000cCaQQAU" }], "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY" }, "method" => "POST", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwDJQAY/items/clone" }, "remote" => { "params" => { "methodName" => "cloneItems", "items" => [{ "itemId" => "8026A000000cCaQQAU" }], "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY" } }, "client" => { "params" => {} } }, "modifyattributes" => { "rest" => { "params" => { "items" => [{ "itemId" => "8026A000000cCaQQAU" }], "filters" => nil, "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY" }, "method" => "PUT", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwDJQAY/items/8026A000000cCaQQAU/itemAttributes" }, "remote" => { "params" => { "methodName" => "putItemAttributes", "items" => [{ "itemId" => "8026A000000cCaQQAU" }], "filters" => nil, "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY" } }, "client" => { "params" => {} } } }, "displaySequence" => -1, "Id" => { "value" => "8026A000000cCaQQAU", "previousValue" => nil, "originalValue" => nil, "messages" => [], "label" => "Order Product ID", "hidden" => false, "fieldName" => "Id", "editable" => false, "dataType" => "ID", "actions" => {} }, "Pricebook2Id" => "01s6A0000037JCtQAM", "Product2Id" => "01t6A000000fd0AQAQ", "ProductCode" => "IRKPL", "UnitPrice" => { "value" => 0.0, "previousValue" => nil, "originalValue" => nil, "messages" => [], "label" => "Unit Price", "hidden" => true, "fieldName" => "UnitPrice", "editable" => false, "dataType" => "CURRENCY", "actions" => {} }, "Name" => "IRKPL", "vlocity_cmt__RecurringPrice__c" => 0.0, "IsActive" => true, "Product2" => { "attributes" => { "type" => "Product2", "url" => "/services/data/v40.0/sobjects/Product2/01t6A000000fd0AQAQ" }, "Name" => "IRKPL", "vlocity_cmt__IsConfigurable__c" => false, "vlocity_cmt__Type__c" => "None", "vlocity_cmt__SubType__c" => "None", "RecordTypeId" => "0126A000000gwBfQAI", "Id" => "01t6A000000fd0AQAQ", "vlocity_cmt__JSONAttribute__c" => nil }, "productId" => "01t6A000000fd0AQAQ", "defaultQuantity" => 1.0, "minQuantity" => 0.0, "maxQuantity" => 99999.0, "groupMinQuantity" => 0, "groupMaxQuantity" => 99999, "sequenceNumber" => 1.0, "productChildItemDefinition" => { "attributes" => { "type" => "vlocity_cmt__ProductChildItem__c", "url" => "/services/data/v40.0/sobjects/vlocity_cmt__ProductChildItem__c/a2a6A000000wm6XQAQ" }, "vlocity_cmt__MinQuantity__c" => 0, "vlocity_cmt__SeqNumber__c" => 1.0, "Name" => "Root PCI", "Id" => "a2a6A000000wm6XQAQ", "vlocity_cmt__Quantity__c" => 1, "vlocity_cmt__MaximumChildItemQuantity__c" => 99999, "vlocity_cmt__MaxQuantity__c" => 99999, "vlocity_cmt__ParentProductId__r" => { "attributes" => { "type" => "Product2", "url" => "/services/data/v40.0/sobjects/Product2/01t6A000000fd0AQAQ" }, "Name" => "IRKPL", "Id" => "01t6A000000fd0AQAQ", "RecordTypeId" => "0126A000000gwBfQAI" }, "vlocity_cmt__MinimumChildItemQuantity__c" => 0, "vlocity_cmt__CollapseHierarchy__c" => false, "vlocity_cmt__IsOverride__c" => false, "vlocity_cmt__IsVirtualItem__c" => false, "vlocity_cmt__ChildLineNumber__c" => "1", "vlocity_cmt__IsRootProductChildItem__c" => true, "vlocity_cmt__ParentProductId__c" => "01t6A000000fd0AQAQ" }, "productHierarchyPath" => "01t6A000000fd0AQAQ", "name" => "IRKPL", "isVirtualItem" => false, "provisioningStatus" => "New", "hasChildren" => false, "itemType" => "lineItem", "PricebookEntryId" => { "value" => "01u6A00000135XeQAI", "previousValue" => nil, "originalValue" => nil, "messages" => [], "label" => "Price Book Entry ID", "hidden" => false, "fieldName" => "PricebookEntryId", "editable" => false, "dataType" => "REFERENCE", "actions" => {} }, "Quantity" => { "value" => 1.0, "previousValue" => nil, "originalValue" => nil, "messages" => [], "label" => "Quantity", "hidden" => false, "fieldName" => "Quantity", "editable" => true, "dataType" => "DOUBLE", "actions" => {} }, "vlocity_cmt__OneTimeTotal__c" => { "value" => 10.0, "previousValue" => nil, "originalValue" => nil, "messages" => [], "label" => "One Time Total", "hidden" => false, "fieldName" => "vlocity_cmt__OneTimeTotal__c", "editable" => false, "dataType" => "CURRENCY", "actions" => { "adjustmentcodes" => { "rest" => { "params" => {}, "method" => "GET", "link" => "/services/apexrest/vlocity_cmt/v2/listsofvalues?listkeys=AdjustmentCodes&cartId=8016A000000bwDJQAY&id=8026A000000cCaQQAU&fields=vlocity_cmt__OneTimeTotal__c&PricingVariableCode=OT_STD_PRC_TOTAL" }, "remote" => { "params" => { "methodName" => "getListsOfValues", "PricingVariableCode" => "OT_STD_PRC_TOTAL", "fields" => "vlocity_cmt__OneTimeTotal__c", "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY", "listkeys" => "AdjustmentCodes" } }, "client" => { "records" => [], "params" => {} } }, "applyadjustment" => { "rest" => { "params" => { "adjustments" => [{ "PricingVariableCode" => "OT_STD_PRC_TOTAL", "AdjustmentCode" => "", "AdjustmentValue" => 0, "AdjustmentMethod" => "Percent", "DetailType" => "ADJUSTMENT", "Field" => "vlocity_cmt__OneTimeTotal__c" }], "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY" }, "method" => "POST", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwDJQAY/items/8026A000000cCaQQAU/pricing" }, "remote" => { "params" => { "methodName" => "applyAdjustment", "adjustments" => [{ "PricingVariableCode" => "OT_STD_PRC_TOTAL", "AdjustmentCode" => "", "AdjustmentValue" => 0, "AdjustmentMethod" => "Percent", "DetailType" => "ADJUSTMENT", "Field" => "vlocity_cmt__OneTimeTotal__c" }], "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY" } }, "client" => { "records" => [], "params" => {} } }, "pricedetail" => { "rest" => { "params" => {}, "method" => "GET", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwDJQAY/items/8026A000000cCaQQAU/pricing?cartId=8016A000000bwDJQAY&id=8026A000000cCaQQAU&fields=vlocity_cmt__OneTimeTotal__c" }, "remote" => { "params" => { "methodName" => "getPriceDetail", "fields" => "vlocity_cmt__OneTimeTotal__c", "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY" } }, "client" => { "records" => [], "params" => {} } } } }, "vlocity_cmt__RecurringTotal__c" => { "value" => 0.0, "previousValue" => nil, "originalValue" => nil, "messages" => [], "label" => "Recurring Total", "hidden" => false, "fieldName" => "vlocity_cmt__RecurringTotal__c", "editable" => false, "dataType" => "CURRENCY", "actions" => { "adjustmentcodes" => { "rest" => { "params" => {}, "method" => "GET", "link" => "/services/apexrest/vlocity_cmt/v2/listsofvalues?listkeys=AdjustmentCodes&cartId=8016A000000bwDJQAY&id=8026A000000cCaQQAU&fields=vlocity_cmt__RecurringTotal__c&PricingVariableCode=REC_MNTH_STD_PRC_TOTAL" }, "remote" => { "params" => { "methodName" => "getListsOfValues", "PricingVariableCode" => "REC_MNTH_STD_PRC_TOTAL", "fields" => "vlocity_cmt__RecurringTotal__c", "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY", "listkeys" => "AdjustmentCodes" } }, "client" => { "records" => [], "params" => {} } }, "applyadjustment" => { "rest" => { "params" => { "adjustments" => [{ "PricingVariableCode" => "REC_MNTH_STD_PRC_TOTAL", "AdjustmentCode" => "", "AdjustmentValue" => 0, "AdjustmentMethod" => "Percent", "DetailType" => "ADJUSTMENT", "Field" => "vlocity_cmt__RecurringTotal__c" }], "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY" }, "method" => "POST", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwDJQAY/items/8026A000000cCaQQAU/pricing" }, "remote" => { "params" => { "methodName" => "applyAdjustment", "adjustments" => [{ "PricingVariableCode" => "REC_MNTH_STD_PRC_TOTAL", "AdjustmentCode" => "", "AdjustmentValue" => 0, "AdjustmentMethod" => "Percent", "DetailType" => "ADJUSTMENT", "Field" => "vlocity_cmt__RecurringTotal__c" }], "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY" } }, "client" => { "records" => [], "params" => {} } }, "pricedetail" => { "rest" => { "params" => {}, "method" => "GET", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwDJQAY/items/8026A000000cCaQQAU/pricing?cartId=8016A000000bwDJQAY&id=8026A000000cCaQQAU&fields=vlocity_cmt__RecurringTotal__c" }, "remote" => { "params" => { "methodName" => "getPriceDetail", "fields" => "vlocity_cmt__RecurringTotal__c", "id" => "8026A000000cCaQQAU", "cartId" => "8016A000000bwDJQAY" } }, "client" => { "records" => [], "params" => {} } } } }, } ``` #### Clone child line items ```json { "totalSize": 1, "messages": [ { "code": "153", "severity": "INFO", "message": "Successfully added." } ], "actions": { "itempricesupdated": { "rest": { "params": { }, "method": "GET", "link": "/services/apexrest/daily_new/v2/cpq/carts/8014T000000rXVoQAM/price?price=false" }, "remote": { "params": { "price": false, "cartId": "8014T000000rXVoQAM", "methodName": "getCartLineItemPrices" } }, "client": { "params": { } } } }, "records": [ { "messages": [ ], "actions": { "addtocart": { "rest": { "params": { "items": [ { "quantity": 1, "itemId": "01u4T000000zC6kQAE" } ], "cartId": "8014T000000rXVoQAM", "price": true, "validate": true, "includeAttachment": true, "pagesize": 20, "lastRecordId": null, "hierarchy": -1, "query": null }, "method": "POST", "link": "/services/apexrest/daily_new/v2/cpq/carts/8014T000000rXVoQAM/items" }, "remote": { "params": { } }, "client": { "params": { } } }, "updateitems": { "rest": { "params": { "items": [ { "itemId": "8024T000000hVajQAE" } ], "filters": null, "fields": null, "cartId": "8014T000000rXVoQAM", "price": true, "validate": true, "includeAttachment": true, "pagesize": 20, "lastRecordId": null, "hierarchy": -1, "query": null }, "method": "PUT", "link": "/services/apexrest/daily_new/v2/cpq/carts/8014T000000rXVoQAM/items" }, "remote": { "params": { } }, "client": { "params": { } } }, "deleteitem": { "rest": { "params": { }, "method": "DELETE", "link": "/services/apexrest/daily_new/v2/cpq/carts/8014T000000rXVoQAM/items/8024T000000hVajQAE?hierarchy=-1&pagesize=20&includeAttachment=true&validate=true&price=true&cartId=8014T000000rXVoQAM&id=8024T000000hVajQAE" }, "remote": { "params": { } }, "client": { "params": { } } }, "configdelete": { "rest": { "params": { }, "method": null, "link": null }, "remote": { "params": { } }, "client": { "params": { } } }, "cloneitem": { "rest": { "params": { "items": [ { "itemId": "8024T000000hVajQAE" } ], "id": "8024T000000hVajQAE", "cartId": "8014T000000rXVoQAM" }, "method": "POST", "link": "/services/apexrest/daily_new/v2/cpq/carts/8014T000000rXVoQAM/items/clone" }, "remote": { "params": { } }, "client": { "params": { } } }, "modifyattributes": { "rest": { "params": { "items": [ { "itemId": "8024T000000hVajQAE" } ], "filters": null, "itemId": "8024T000000hVajQAE", "id": "8024T000000hVajQAE", "cartId": "8014T000000rXVoQAM" }, "method": "PUT", "link": "/services/apexrest/daily_new/v2/cpq/carts/8014T000000rXVoQAM/items/8024T000000hVajQAE/itemAttributes" }, "remote": { "params": { } }, "client": { "params": { } } } }, "displaySequence": -1, "Id": { "value": "8024T000000hVajQAE", "previousValue": null, "originalValue": null, "messages": [ ], "label": "Order Product ID", "hidden": false, "fieldName": "Id", "editable": false, "dataType": "ID", "alternateValues": null, "actions": { } }, "name": "TEST Offer", "productId": "01t4T000000WTjwQAG", "vlocity_cmt__InCartQuantityMap__c": { "value": { "01t4T000000WTkBQAW": 2, "01t4T000000WTkGQAW": 1 }, "previousValue": null, "originalValue": null, "messages": [ ], "label": "InCartQuantityMap", "hidden": true, "fieldName": "vlocity_cmt__InCartQuantityMap__c", "editable": false, "dataType": "TEXTAREA", "alternateValues": null, "actions": { } }, "isVirtualItem": false, "lineItems": { "totalSize": 0, "messages": [ ], "records": [ { "messages": [ ], "actions": { "addtocart": { "rest": { "params": { "items": [ { "quantity": 1, "parentId": "8024T000000hVajQAE", "parentHierarchyPath": "01t4T000000WTjwQAG", "itemId": "01u4T000000zC74QAE" } ], "cartId": "8014T000000rXVoQAM", "price": true, "validate": true, "includeAttachment": true, "pagesize": 20, "lastRecordId": null, "hierarchy": -1, "query": null }, "method": "POST", "link": "/services/apexrest/daily_new/v2/cpq/carts/8014T000000rXVoQAM/items" }, "remote": { "params": { } }, "client": { "params": { } } }, "updateitems": { "rest": { "params": { "items": [ { "itemId": "8024T000000hVrcQAE" } ], "filters": null, "fields": null, "cartId": "8014T000000rXVoQAM", "price": true, "validate": true, "includeAttachment": true, "pagesize": 20, "lastRecordId": null, "hierarchy": -1, "query": null }, "method": "PUT", "link": "/services/apexrest/daily_new/v2/cpq/carts/8014T000000rXVoQAM/items" }, "remote": { "params": { } }, "client": { "params": { } } }, "deleteitem": { "rest": { "params": { }, "method": "DELETE", "link": "/services/apexrest/daily_new/v2/cpq/carts/8014T000000rXVoQAM/items/8024T000000hVrcQAE?hierarchy=-1&pagesize=20&includeAttachment=true&validate=true&price=true&cartId=8014T000000rXVoQAM&id=8024T000000hVrcQAE" }, "remote": { "params": { } }, "client": { "params": { } } }, "configdelete": { "rest": { "params": { }, "method": null, "link": null }, "remote": { "params": { } }, "client": { "params": { } } }, "cloneitem": { "rest": { "params": { "items": [ { "itemId": "8024T000000hVrcQAE" } ], "id": "8024T000000hVrcQAE", "cartId": "8014T000000rXVoQAM" }, "method": "POST", "link": "/services/apexrest/daily_new/v2/cpq/carts/8014T000000rXVoQAM/items/clone" }, "remote": { "params": { } }, "client": { "params": { } } }, "modifyattributes": { "rest": { "params": { "items": [ { "itemId": "8024T000000hVrcQAE" } ], "filters": null, "itemId": "8024T000000hVrcQAE", "id": "8024T000000hVrcQAE", "cartId": "8014T000000rXVoQAM" }, "method": "PUT", "link": "/services/apexrest/daily_new/v2/cpq/carts/8014T000000rXVoQAM/items/8024T000000hVrcQAE/itemAttributes" }, "remote": { "params": { } }, "client": { "params": { } } } }, "displaySequence": -1, "UnitPrice": { "value": 0.00, "previousValue": null, "originalValue": null, "messages": [ ], "label": "Unit Price", "hidden": true, "fieldName": "UnitPrice", "editable": false, "dataType": "CURRENCY", "alternateValues": null, "actions": { } }, "Product2": { "attributes": { "type": "Product2", "url": "/services/data/v50.0/sobjects/Product2/01t4T000000WTkBQAW" }, "vlocity_cmt__Type__c": "None", "vlocity_cmt__IsConfigurable__c": false, "Name": "Test Internet 2", "Id": "01t4T000000WTkBQAW", "vlocity_cmt__SubType__c": "None", "IsActive": true, "vlocity_cmt__SpecificationType__c": "Offer", "vlocity_cmt__GlobalGroupKey__c": "eb006d2e-e816-7a0e-4060-2bed6511be52", "vlocity_cmt__ProductSpecId__c": "01t4T000000WTk1QAG", "ProductCode": "TEST-OFFERSPEC-003", "RecordTypeId": "0124T000000PFWfQAO", "vlocity_cmt__ProductSpecId__r": { "attributes": { "type": "Product2", "url": "/services/data/v50.0/sobjects/Product2/01t4T000000WTk1QAG" }, "ProductCode": "Test-Product-Specification-01", "Name": "Test Product Specification", "Id": "01t4T000000WTk1QAG", "RecordTypeId": "0124T000000PFWfQAO", "vlocity_cmt__SpecificationType__c": "Product" }, "vlocity_cmt__AttributeMetadata__c": null, "vlocity_cmt__AttributeDefaultValues__c": null }, "vlocity_cmt__RecurringPrice__c": 0.00, "Name": "Test Internet 2", "Id": { "value": "8024T000000hVrcQAE", "previousValue": null, "originalValue": null, "messages": [ ], "label": "Order Product ID", "hidden": false, "fieldName": "Id", "editable": false, "dataType": "ID", "alternateValues": null, "actions": { } }, "Product2Id": "01t4T000000WTkBQAW", "IsActive": true, "ProductCode": "TEST-OFFERSPEC-003", "Pricebook2Id": "01s4T000000PYMyQAO", "PricebookEntry": { "attributes": { "type": "PricebookEntry", "url": "/services/data/v50.0/sobjects/PricebookEntry/01u4T000000zC74QAE" }, "Id": "01u4T000000zC74QAE", "Pricebook2Id": "01s4T000000PYMyQAO", "Product2Id": "01t4T000000WTkBQAW", "Product2": { "attributes": { "type": "Product2", "url": "/services/data/v50.0/sobjects/Product2/01t4T000000WTkBQAW" }, "Id": "01t4T000000WTkBQAW", "vlocity_cmt__GlobalGroupKey__c": "eb006d2e-e816-7a0e-4060-2bed6511be52", "vlocity_cmt__IsConfigurable__c": false, "vlocity_cmt__Type__c": "None", "Name": "Test Internet 2", "ProductCode": "TEST-OFFERSPEC-003" } }, "productId": "01t4T000000WTkBQAW", "defaultQuantity": 1, "minQuantity": 0, "maxQuantity": 5, "groupMinQuantity": 0, "groupMaxQuantity": 99999, "sequenceNumber": 2.00, "productChildItemDefinition": { "attributes": { "type": "vlocity_cmt__ProductChildItem__c" }, "vlocity_cmt__SeqNumber__c": 2.00, "vlocity_cmt__IsVirtualItem__c": false, "vlocity_cmt__Quantity__c": 1, "vlocity_cmt__CollapseHierarchy__c": false, "vlocity_cmt__ChildProductId__c": "01t4T000000WTkBQAW", "vlocity_cmt__MinQuantity__c": 0, "vlocity_cmt__IsOverride__c": false, "vlocity_cmt__ParentProductId__c": "01t4T000000WTjwQAG", "Name": "a354T000000dq2j", "vlocity_cmt__ChildProductId__r": { "attributes": { "type": "Product2", "url": "/services/data/v50.0/sobjects/Product2/01t4T000000WTkBQAW" }, "Name": "Test Internet 2", "Id": "01t4T000000WTkBQAW", "RecordTypeId": "0124T000000PFWfQAO", "vlocity_cmt__GlobalGroupKey__c": "eb006d2e-e816-7a0e-4060-2bed6511be52", "vlocity_cmt__ProductSpecId__c": "01t4T000000WTk1QAG" }, "vlocity_cmt__ChildLineNumber__c": "2", "vlocity_cmt__MinimumChildItemQuantity__c": 0, "vlocity_cmt__IsRootProductChildItem__c": false, "vlocity_cmt__ParentProductId__r": { "attributes": { "type": "Product2", "url": "/services/data/v50.0/sobjects/Product2/01t4T000000WTjwQAG" }, "Name": "TEST Offer", "Id": "01t4T000000WTjwQAG", "RecordTypeId": "0124T000000PFWfQAO", "vlocity_cmt__GlobalGroupKey__c": "40a771b8-f4f4-5e12-81ec-47b822007a7c" }, "vlocity_cmt__MaximumChildItemQuantity__c": 99999, "vlocity_cmt__MaxQuantity__c": 5 }, "productHierarchyPath": "01t4T000000WTjwQAG<01t4T000000WTkBQAW", "name": "Test Internet 2", "isVirtualItem": false, "hasChildren": false, "orderActive": false, "itemType": "lineItem", "action": "Add", "SellingPeriod": "Present", "ListPrice": { "value": 0.00, "previousValue": null, "originalValue": null, "messages": [ ], "label": "List Price", "hidden": true, "fieldName": "ListPrice", "editable": false, "dataType": "CURRENCY", "alternateValues": null, "actions": { } }, "OrderId": { "value": "8014T000000rXVoQAM", "previousValue": null, "originalValue": null, "messages": [ ], "label": "Order ID", "hidden": false, "fieldName": "OrderId", "editable": false, "dataType": "REFERENCE", "alternateValues": null, "actions": { } }, "PricebookEntryId": { "value": "01u4T000000zC74QAE", "previousValue": null, "originalValue": null, "messages": [ ], "label": "Price Book Entry ID", "hidden": false, "fieldName": "PricebookEntryId", "editable": false, "dataType": "REFERENCE", "alternateValues": null, "actions": { } }, "Quantity": { "value": 1.00, "previousValue": null, "originalValue": null, "messages": [ ], "label": "Quantity", "hidden": false, "fieldName": "Quantity", "editable": true, "dataType": "DOUBLE", "alternateValues": null, "actions": { } }, "vlocity_cmt__Action__c": { "value": "Add", "previousValue": null, "originalValue": null, "messages": [ ], "label": "Action", "hidden": false, "fieldName": "vlocity_cmt__Action__c", "editable": true, "dataType": "PICKLIST", "alternateValues": null, "actions": { } }, "vlocity_cmt__AssetReferenceId__c": { "value": "e7423d01-2533-a274-106f-c977a9e30e98", "previousValue": null, "originalValue": null, "messages": [ ], "label": "Asset Reference Id", "hidden": true, "fieldName": "vlocity_cmt__AssetReferenceId__c", "editable": true, "dataType": "STRING", "alternateValues": null, "actions": { } }, "vlocity_cmt__BillingAccountId__c": { "value": "0014T00000EIFwBQAX", "previousValue": null, "originalValue": null, "messages": [ ], "label": "Billing Account", "hidden": false, "fieldName": "vlocity_cmt__BillingAccountId__c", "editable": true, "dataType": "REFERENCE", "alternateValues": null, "actions": { "availablesites": { "rest": { "params": { }, "method": "GET", "link": "/services/apexrest/daily_new/v2/cpq/carts/8014T000000rXVoQAM/sites?cartId=8014T000000rXVoQAM&id=8024T000000hVrcQAE&lookupField=vlocity_cmt__billingaccountid__c" }, "remote": { "params": { } }, "client": { "records": [ ], "params": { } } } } }, "vlocity_cmt__CatalogItemReferenceDateTime__c": { "value": "2020-12-01T08:00:00.000Z", "previousValue": null, "originalValue": null, "messages": [ ], "label": "Reference Time", "hidden": false, "fieldName": "vlocity_cmt__CatalogItemReferenceDateTime__c", "editable": true, "dataType": "DATETIME", "alternateValues": null, "actions": { } }, "vlocity_cmt__CurrencyPaymentMode__c": { "value": "Currency", "previousValue": null, "originalValue": null, "messages": [ ], "label": "Currency Payment Mode", "hidden": true, "fieldName": "vlocity_cmt__CurrencyPaymentMode__c", "editable": true, "dataType": "PICKLIST", "alternateValues": null, "actions": { } }, "vlocity_cmt__EffectiveOneTimeTotal__c": { "value": 0.00, "previousValue": null, "originalValue": null, "messages": [ ], "label": "Effective One Time Total", "hidden": false, "fieldName": "vlocity_cmt__EffectiveOneTimeTotal__c", "editable": true, "dataType": "CURRENCY", "alternateValues": null, "actions": { } }, "vlocity_cmt__EffectiveRecurringTotal__c": { "value": 0.00, "previousValue": null, "originalValue": null, "messages": [ ], "label": "Effective Recurring Total", "hidden": false, "fieldName": "vlocity_cmt__EffectiveRecurringTotal__c", "editable": true, "dataType": "CURRENCY", "alternateValues": null, "actions": { } }, "vlocity_cmt__IsChangesAllowed__c": { "value": true, "previousValue": null, "originalValue": null, "messages": [ ], "label": "Changes Allowed", "hidden": false, "fieldName": "vlocity_cmt__IsChangesAllowed__c", "editable": true, "dataType": "BOOLEAN", "alternateValues": null, "actions": { } }, "vlocity_cmt__LineNumber__c": { "value": "0001.0003", "previousValue": null, "originalValue": null, "messages": [ ], "label": "LineNumber", "hidden": true, "fieldName": "vlocity_cmt__LineNumber__c", "editable": false, "dataType": "STRING", "alternateValues": null, "actions": { } }, "vlocity_cmt__OneTimeCalculatedPrice__c": { "value": 10.00, "previousValue": null, "originalValue": null, "messages": [ ], "label": "One Time Calculated Price", "hidden": true, "fieldName": "vlocity_cmt__OneTimeCalculatedPrice__c", "editable": false, "dataType": "CURRENCY", "alternateValues": null, "actions": { "adjustmentcodes": { "rest": { "params": { }, "method": "GET", "link": "/services/apexrest/daily_new/v2/listsofvalues?listkeys=AdjustmentCodes&cartId=8014T000000rXVoQAM&id=8024T000000hVrcQAE&fields=vlocity_cmt__OneTimeCalculatedPrice__c&PricingVariableCode=OT_STD_PRC_CALC" }, "remote": { "params": { } }, "client": { "records": [ ], "params": { } } }, "applyadjustment": { "rest": { "params": { "adjustments": [ { "PricingVariableCode": "OT_STD_PRC_CALC", "AdjustmentCode": "", "AdjustmentValue": 0, "AdjustmentMethod": "Percent", "DetailType": "ADJUSTMENT", "Field": "vlocity_cmt__OneTimeCalculatedPrice__c" } ], "id": "8024T000000hVrcQAE", "cartId": "8014T000000rXVoQAM" }, "method": "POST", "link": "/services/apexrest/daily_new/v2/cpq/carts/8014T000000rXVoQAM/items/8024T000000hVrcQAE/pricing" }, "remote": { "params": { } }, "client": { "records": [ ], "params": { } } }, "pricedetail": { "rest": { "params": { }, "method": "GET", "link": "/services/apexrest/daily_new/v2/cpq/carts/8014T000000rXVoQAM/items/8024T000000hVrcQAE/pricing?cartId=8014T000000rXVoQAM&id=8024T000000hVrcQAE&fields=vlocity_cmt__OneTimeCalculatedPrice__c" }, "remote": { "params": { } }, "client": { "records": [ ], "params": { } } } } }, "vlocity_cmt__OneTimeCharge__c": { "value": 10.00, "previousValue": null, "originalValue": null, "messages": [ ], "label": "One Time Charge", "hidden": true, "fieldName": "vlocity_cmt__OneTimeCharge__c", "editable": false, "dataType": "CURRENCY", "alternateValues": null, "actions": { "adjustmentcodes": { "rest": { "params": { }, "method": "GET", "link": "/services/apexrest/daily_new/v2/listsofvalues?listkeys=AdjustmentCodes&cartId=8014T000000rXVoQAM&id=8024T000000hVrcQAE&fields=vlocity_cmt__OneTimeCharge__c&PricingVariableCode=OT_STD_PRC" }, "remote": { "params": { } }, "client": { "records": [ ], "params": { } } }, "applyadjustment": { "rest": { "params": { "adjustments": [ { "PricingVariableCode": "OT_STD_PRC", "AdjustmentCode": "", "AdjustmentValue": 0, "AdjustmentMethod": "Percent", "DetailType": "ADJUSTMENT", "Field": "vlocity_cmt__OneTimeCharge__c" } ], "id": "8024T000000hVrcQAE", "cartId": "8014T000000rXVoQAM" }, "method": "POST", "link": "/services/apexrest/daily_new/v2/cpq/carts/8014T000000rXVoQAM/items/8024T000000hVrcQAE/pricing" }, "remote": { "params": { } }, "client": { "records": [ ], "params": { } } }, "pricedetail": { "rest": { "params": { }, "method": "GET", "link": "/services/apexrest/daily_new/v2/cpq/carts/8014T000000rXVoQAM/items/8024T000000hVrcQAE/pricing?cartId=8014T000000rXVoQAM&id=8024T000000hVrcQAE&fields=vlocity_cmt__OneTimeCharge__c" }, "remote": { "params": { } }, "client": { "records": [ ], "params": { } } } } }, "vlocity_cmt__OneTimeManualDiscount__c": { "value": 0.00, "previousValue": null, "originalValue": null, "messages": [ ], "label": "One Time Manual Discount", "hidden": false, "fieldName": "vlocity_cmt__OneTimeManualDiscount__c", "editable": true, "dataType": "PERCENT", "alternateValues": null, "actions": { } }, "vlocity_cmt__OneTimeTotal__c": { "value": 10.00, "previousValue": null, "originalValue": null, "messages": [ ], "label": "One Time Total", "hidden": false, "fieldName": "vlocity_cmt__OneTimeTotal__c", "editable": false, "dataType": "CURRENCY", "alternateValues": null, "actions": { "adjustmentcodes": { "rest": { "params": { }, "method": "GET", "link": "/services/apexrest/daily_new/v2/listsofvalues?listkeys=AdjustmentCodes&cartId=8014T000000rXVoQAM&id=8024T000000hVrcQAE&fields=vlocity_cmt__OneTimeTotal__c&PricingVariableCode=OT_STD_PRC_TOTAL" }, "remote": { "params": { } }, "client": { "records": [ ], "params": { } } }, "pricedetail": { "rest": { "params": { }, "method": "GET", "link": "/services/apexrest/daily_new/v2/cpq/carts/8014T000000rXVoQAM/items/8024T000000hVrcQAE/pricing?cartId=8014T000000rXVoQAM&id=8024T000000hVrcQAE&fields=vlocity_cmt__OneTimeTotal__c" }, "remote": { "params": { } }, "client": { "records": [ ], "params": { } } } } }, "vlocity_cmt__ParentItemId__c": { "value": "c8539d4a-f9a8-4e52-11e7-bfd918f2b883", "previousValue": null, "originalValue": null, "messages": [ ], "label": "ParentItemId", "hidden": true, "fieldName": "vlocity_cmt__ParentItemId__c", "editable": false, "dataType": "STRING", "alternateValues": null, "actions": { } }, "vlocity_cmt__Product2Id__c": { "value": "01t4T000000WTkBQAW", "previousValue": null, "originalValue": null, "messages": [ ], "label": "Product", "hidden": false, "fieldName": "vlocity_cmt__Product2Id__c", "editable": true, "dataType": "REFERENCE", "alternateValues": null, "actions": { "availablesites": { "rest": { "params": { }, "method": "GET", "link": "/services/apexrest/daily_new/v2/cpq/carts/8014T000000rXVoQAM/sites?cartId=8014T000000rXVoQAM&id=8024T000000hVrcQAE&lookupField=vlocity_cmt__product2id__c" }, "remote": { "params": { } }, "client": { "records": [ ], "params": { } } } } }, "vlocity_cmt__ProductGroupKey__c": { "value": "eb006d2e-e816-7a0e-4060-2bed6511be52", "previousValue": null, "originalValue": null, "messages": [ ], "label": "Product Group Key", "hidden": false, "fieldName": "vlocity_cmt__ProductGroupKey__c", "editable": false, "dataType": "STRING", "alternateValues": null, "actions": { } }, "vlocity_cmt__ProductHierarchyGroupKeyPath__c": { "value": "40a771b8-f4f4-5e12-81ec-47b822007a7c", "vlocity_cmt__StringId__c":"a3c1N0000016TkfQAE", "vlocity_cmt__Translation__c":"spe<26>", "vlocity_cmt__LocaleCode__c":"fr", "vlocity_cmt__StringId__r":{ "attributes":{ "type":"vlocity_cmt__String__c", "url":"/services/data/v43.0/sobjects/vlocity_cmt__String__c/a3c1N0000016TkfQAE" }, "Id":"a3c1N0000016TkfQAE", "vlocity_cmt__BaseString__c":"SPE-26" } }, { "displaySequence":-1, "Id":"a3b1N000000pfpTQAQ", "Name":"a3b1N000000pfpT", "vlocity_cmt__StringId__c":"a3c1N0000016TkfQAE", "vlocity_cmt__LocaleCode__c":"de", "vlocity_cmt__StringId__r":{ "attributes":{ "type":"vlocity_cmt__String__c", "url":"/services/data/v43.0/sobjects/vlocity_cmt__String__c/a3c1N0000016TkfQAE" }, "Id":"a3c1N0000016TkfQAE", "vlocity_cmt__BaseString__c":"SPE-26" } }, { "displaySequence":-1, "Id":"a3b1N000000pfpUQAQ", "Name":"a3b1N000000pfpU", "vlocity_cmt__StringId__c":"a3c1N0000016TkgQAE", "vlocity_cmt__LocaleCode__c":"fi", "vlocity_cmt__StringId__r":{ "attributes":{ "type":"vlocity_cmt__String__c", "url":"/services/data/v43.0/sobjects/vlocity_cmt__String__c/a3c1N0000016TkgQAE" }, "Id":"a3c1N0000016TkgQAE", "vlocity_cmt__BaseString__c":"Demo1" } }, { "displaySequence":-1, "Id":"a3b1N000000pfpVQAQ", "Name":"a3b1N000000pfpV", "vlocity_cmt__StringId__c":"a3c1N0000016TkgQAE", "vlocity_cmt__LocaleCode__c":"fr", "vlocity_cmt__StringId__r":{ "attributes":{ "type":"vlocity_cmt__String__c", "url":"/services/data/v43.0/sobjects/vlocity_cmt__String__c/a3c1N0000016TkgQAE" }, "Id":"a3c1N0000016TkgQAE", "vlocity_cmt__BaseString__c":"Demo1" } }, { "displaySequence":-1, "Id":"a3b1N000000pfpWQAQ", "Name":"a3b1N000000pfpW", "vlocity_cmt__StringId__c":"a3c1N0000016TkgQAE", "vlocity_cmt__LocaleCode__c":"de", "vlocity_cmt__StringId__r":{ "attributes":{ "type":"vlocity_cmt__String__c", "url":"/services/data/v43.0/sobjects/vlocity_cmt__String__c/a3c1N0000016TkgQAE" }, "Id":"a3c1N0000016TkgQAE", "vlocity_cmt__BaseString__c":"Demo1" } }, { "displaySequence":-1, "Id":"a3b1N000000pfpXQAQ", "Name":"a3b1N000000pfpX", "vlocity_cmt__StringId__c":"a3c1N0000016TkhQAE", "vlocity_cmt__LocaleCode__c":"fi", "vlocity_cmt__StringId__r":{ "attributes":{ "type":"vlocity_cmt__String__c", "url":"/services/data/v43.0/sobjects/vlocity_cmt__String__c/a3c1N0000016TkhQAE" }, "Id":"a3c1N0000016TkhQAE", "vlocity_cmt__BaseString__c":"TestProd-3" } }, { "displaySequence":-1, "Id":"a3b1N000000pfpYQAQ", "Name":"gtestprod-3_fr", "vlocity_cmt__StringId__c":"a3c1N0000016TkhQAE", "vlocity_cmt__Translation__c":"gtestprod-3_fr", "vlocity_cmt__LocaleCode__c":"fr", "vlocity_cmt__StringId__r":{ "attributes":{ "type":"vlocity_cmt__String__c", "url":"/services/data/v43.0/sobjects/vlocity_cmt__String__c/a3c1N0000016TkhQAE" }, "Id":"a3c1N0000016TkhQAE", "vlocity_cmt__BaseString__c":"TestProd-3" } }, { "displaySequence":-1, "Id":"a3b1N000000pfpZQAQ", "Name":"TestProd-3_german", "vlocity_cmt__StringId__c":"a3c1N0000016TkhQAE", "vlocity_cmt__Translation__c":"TestProd-3_german", "vlocity_cmt__LocaleCode__c":"de", "vlocity_cmt__StringId__r":{ "attributes":{ "type":"vlocity_cmt__String__c", "url":"/services/data/v43.0/sobjects/vlocity_cmt__String__c/a3c1N0000016TkhQAE" }, "Id":"a3c1N0000016TkhQAE", "vlocity_cmt__BaseString__c":"TestProd-3" } }, { "displaySequence":-1, "Id":"a3b1N000000pfpeQAA", "Name":"serasdfwe", "vlocity_cmt__StringId__c":"a3c1N0000016TkjQAE", "vlocity_cmt__Translation__c":"serasdfwe", "vlocity_cmt__LocaleCode__c":"fr", "vlocity_cmt__StringId__r":{ "attributes":{ "type":"vlocity_cmt__String__c", "url":"/services/data/v43.0/sobjects/vlocity_cmt__String__c/a3c1N0000016TkjQAE" }, "Id":"a3c1N0000016TkjQAE", "vlocity_cmt__BaseString__c":"May17SpecialChars <= this text will be cut out" } }, { "displaySequence":-1, "Id":"a3b1N000000pfpkQAA", "Name":"TestProd-10_fr", "vlocity_cmt__StringId__c":"a3c1N0000016TklQAE", "vlocity_cmt__Translation__c":"TestProd-10_fr", "vlocity_cmt__LocaleCode__c":"fr", "vlocity_cmt__StringId__r":{ "attributes":{ "type":"vlocity_cmt__String__c", "url":"/services/data/v43.0/sobjects/vlocity_cmt__String__c/a3c1N0000016TklQAE" }, "Id":"a3c1N0000016TklQAE", "vlocity_cmt__BaseString__c":"TestProd-10" } }, { "displaySequence":-1, "Id":"a3b1N000000pfplQAA", "Name":"testprod-10", "vlocity_cmt__StringId__c":"a3c1N0000016TklQAE", "vlocity_cmt__Translation__c":"testprod-10", "vlocity_cmt__LocaleCode__c":"de", "vlocity_cmt__StringId__r":{ "attributes":{ "type":"vlocity_cmt__String__c", "url":"/services/data/v43.0/sobjects/vlocity_cmt__String__c/a3c1N0000016TklQAE" }, "Id":"a3c1N0000016TklQAE", "vlocity_cmt__BaseString__c":"TestProd-10" } }, { "displaySequence":-1, "Id":"a3b1N000000pfpmQAA", "Name":"demo-A_fi", "vlocity_cmt__StringId__c":"a3c1N0000016TkmQAE", "vlocity_cmt__Translation__c":"demo-A_fi", "vlocity_cmt__LocaleCode__c":"fi", "vlocity_cmt__StringId__r":{ "attributes":{ "type":"vlocity_cmt__String__c", "url":"/services/data/v43.0/sobjects/vlocity_cmt__String__c/a3c1N0000016TkmQAE" }, "Id":"a3c1N0000016TkmQAE", "vlocity_cmt__BaseString__c":"Demo-A" } }, { "displaySequence":-1, "Id":"a3b1N000000pfpnQAA", "Name":"échantillon-a", "vlocity_cmt__StringId__c":"a3c1N0000016TkmQAE", "vlocity_cmt__Translation__c":"échantillon-a", "vlocity_cmt__LocaleCode__c":"fr", "vlocity_cmt__StringId__r":{ "attributes":{ "type":"vlocity_cmt__String__c", "url":"/services/data/v43.0/sobjects/vlocity_cmt__String__c/a3c1N0000016TkmQAE" }, "Id":"a3c1N0000016TkmQAE", "vlocity_cmt__BaseString__c":"Demo-A" } }, { "displaySequence":-1, "Id":"a3b1N000000pfpoQAA", "Name":"demo-A", "vlocity_cmt__StringId__c":"a3c1N0000016TkmQAE", "vlocity_cmt__Translation__c":"demo-A", "vlocity_cmt__LocaleCode__c":"de", "vlocity_cmt__StringId__r":{ "attributes":{ "type":"vlocity_cmt__String__c", "url":"/services/data/v43.0/sobjects/vlocity_cmt__String__c/a3c1N0000016TkmQAE" }, "Id":"a3c1N0000016TkmQAE", "vlocity_cmt__BaseString__c":"Demo-A" } }, { "displaySequence":-1, "Id":"a3b1N000000pfprQAA", "Name":"TESTPROD-4", "vlocity_cmt__StringId__c":"a3c1N0000016TknQAE", "vlocity_cmt__Translation__c":"TESTPROD-4", "vlocity_cmt__LocaleCode__c":"de", "vlocity_cmt__StringId__r":{ "attributes":{ "type":"vlocity_cmt__String__c", "url":"/services/data/v43.0/sobjects/vlocity_cmt__String__c/a3c1N0000016TknQAE" }, "Id":"a3c1N0000016TknQAE", "vlocity_cmt__BaseString__c":"TestProd-4" } } ] } ``` Media type: `application/json`. Schema: `getStringTranslationResponse`. ### PUT Update string translations. `PUT /stringtranslations` Operation ID: `Update string translations`. Tags: StringTranslations. update string translations. #### Request body (required) #### Request Example Update String Translations. ```json [ { "Id":"a4D41000000TaQ2EAK", "h_cpq_promotion__Translation__c":"Apr10_frNew", "h_cpq_promotion__StringId__c":"a4E41000000TqXjEAK", "h_cpq_promotion__LocaleCode__c":"fr" } ] ``` Media type: `application/json`. Schema: `UpdateStringTranslationRequest`. #### Responses * **200** OK - API request processed. Look for messages in the response to determine if it succeeded or failed. Media type: `application/json`. Schema: `UpdateStringTranslationResponse`. ### POST Create string translations. `POST /stringtranslations` Operation ID: `Create string translations`. Tags: StringTranslations. create string translations. #### Request body (required) #### Request Example Create String Translations. ```json [ { "h_cpq_promotion__Translation__c":"Apr10_frNew", "h_cpq_promotion__StringId__c":"a4E41000000TqXjEAK", "h_cpq_promotion__LocaleCode__c":"fr" } ] ``` Media type: `application/json`. Schema: `CreateStringTranslationRequest`. #### Responses * **200** OK - API request processed. Look for messages in the response to determine if it succeeded or failed. Media type: `application/json`. Schema: `CreateStringTranslationResponse`. ### DELETE Remove string translations `DELETE /stringtranslations/id` Operation ID: `Delete string translations`. Tags: StringTranslations. Remove string translations. Rest Handler - APIStringTranslationsV2 Method Invoked - deleteStringTranslations #### Parameters * `id` (path, string, required) salesforce id _Example_ ``` a4D41000000TaQ2EAK ``` #### Responses * **200** OK - API request processed. Look for messages in the response to determine if it succeeded or failed. Media type: `application/json`. Schema: `deleteStringTranslationsResponse`. ### GET Get dictionary `GET /stringtranslations/dictionary/domain/localeCode` Operation ID: `Get dictionary`. Tags: StringTranslations. Return dictionary of given domain and locale code. Rest Handler - APIDictionaryStringTranslationsV2 Method Invoked - getDictionary #### Parameters * `domain` (path, string, required) domain is CPQ. _Example_ ``` CPQ ``` * `localeCode` (path, string, required) localeCode. For example en\_US. _Example_ ``` fr ``` * `page` (query, number) dictionary is divided into multiple pages. _Example_ ``` 1 ``` * `pageSize` (query, number) pageSize is number of words return in a page. _Example_ ``` 16000 ``` #### Responses * **200** ### dictionary api with page=1 ```json { "totalSize":1, "records": [ { "displaySequence":-1, "localeCode":"fr", "domain":"CPQ", "totalSize":15, "dictionary": { "TestProd-7":"TestProd-7_fr", "TestProd-8":"TestProd-8_fr", "ruleset-2 failed.":"fr_ruleset-2-failed", "ruleset-1-failed":"fr_ruleset-1-failed", "TestProd-6-child-1":"apple-1", "TestProd-6-root":"apple", "failed products":"failed products fr", "TestProd-2":"atestprod-fr", "TestProd-20":"htestprod-20", "TestProd-1":"ztestprod-fr", "Demo-B":"demo-B_fr", "Demo-A":"échantillon-a", "TestProd-10":"TestProd-10_fr", "TestProd-3":"gtestprod-3_fr", "Acc-1":"hr_fr" } } ] } ``` Media type: `application/json`. Schema: `dictionaryResponse`. ## Schemas ### CreateOrderBody A representation to create a new order. Includes all fields of `CreateCartBody`. * `inputFields` (_array of object_, required) An array of objects each defining a field and input value. Fields must be valid field API names for the Salesforce Order object [as defined here](https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_order.htm) or Vlocity field extensions or fields from related objects using relationship names such as Account.Name [see Understanding Relationship Names](https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_relationships_understanding.htm) for more information. _Example_ ``` { "subaction": "createOrder", "inputFields": [ { "accountid": "0016A0000072D43" }, { "effectivedate": "2017-12-07" }, { "status": "Draft" }, { "Pricebook2Id": "01s6A000002Y7wz" }, { "vlocity_cmt__OriginatingChannel__c": "Retail" }, { "name": "New customer order" } ], "fields": "Id,OrderNumber,Name,EffectiveDate,Status,AccountId,Account.Name,vlocity_cmt__EffectiveOrderTotal__c,vlocity_cmt__EffectiveRecurringTotal__c,TotalAmount,vlocity_cmt__OriginatingChannel__c" } ``` ### CreateCartResult Created cart. * `totalSize` (_integer_, read-only) Number of records in the records array. Example: `1`. * `messages` (_Messages_) * `actions` (_array of object_, read-only) * `action` (_Action_) * `records` (_array of Cart_) ### CartResult * `totalSize` (_integer_, read-only) Number of records in the records array. Example: `1`. * `records` (_array of CartDetail_) ### UpdateCartBody A representation to update the cart. * `inputFields` (_array of object_, required) An array of objects each defining a field and input value. Fields must be valid field API names for the Salesforce Order object [as defined here](https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_order.htm) or Vlocity field extensions or fields from related objects using relationship names such as Account.Name [see Understanding Relationship Names](https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_relationships_understanding.htm) for more information. _Example_ ``` { "inputFields": [ { "Pricebook2Id": "01s6A000002Y7wz" } ], "fields": "Id,Name" } ``` ### CartAttributeDetail Get Cart Attribute Details. * `totalSize` (_integer_, read-only) Number of records in the records array. Example: `1`. * `messages` (_Messages_) * `records` (_array of attributeCategory_) ### ValidateCartBody Request body sent in for validate cart * `cartId` (_string_) Example: `8011N00000157LkQAI`. * `methodName` (_string_) Example: `runCartValidation`. * `price` (_boolean_) Example: `true`. * `validate` (_boolean_) Example: `true`. ### ValidateCartResponse Response for the validate cart * `totalSize` (_integer_, read-only) Number of records in the records array. Example: `1`. * `messages` (_Messages_) * `actions` (_array of object_, read-only) * `action` (_Action_) * `records` (_array of Cart_) ### PostPromoCartResponse Response for the add promot to cart. * `totalSize` (_integer_, read-only) Number of records in the records array. Example: `1`. * `messages` (_Messages_) * `actions` (_array of object_, read-only) * `action` (_Action_) * `records` (_array of Cart_) ### SiteResult A detailed representation of a given cart. Includes all fields of `JsonResult`. ### Asset the Asset List * `Name` (_JsonField_) * `SerialNumber` (_JsonField_) * `Quantity` (_JsonField_) * `Status` (_JsonField_) * `vlocity_cmt__ProvisioningStatus__c` (_JsonField_) * `vlocity_cmt__RecurringTotal__c` (_JsonField_) * `vlocity_cmt__OneTimeTotal__c` (_JsonField_) * `childAssets` (_result_) ### PriceList * `Id` (_string_) Example: `a2Lf4000000TvFmEAK`. ### result * `totalSize` (_integer_, required) * `actions` (_array of object_) * `prev` (_Action_) * `next` (_Action_) * `messages` (_Error_, required) * `records` (_array of Account_, required) ### PriceCartBody Request body sent in for price cart * `cartId` (_string_) Example: `8011N00000157LkQAI`. * `methodName` (_string_) Example: `priceCart`. * `validate` (_boolean_) Example: `true`. * `limitScopeToPassedItem` (_boolean_) Example: `true`. * `items` (_array of any_) _Example_ ``` [ "80279000000Y5C9AAK", "80279000000Y5CAAA0" ] ``` ### Item The item in the delete * `messages` (_Messages_) * `Id` (_string_) Example: `80241000000Ha4aAAC`. ### ReplacementBody * `attributeCodesToCopyDuringReplace` (_array of any_) Determines which attributes to copy when replacing an offer. Specify the unique code of the attribute. _Example_ ``` [ "CMT-9413-4", "CMT-9413" ] ``` * `price` (_boolean_) Example: `true`. * `targetOfferIdToItemIds` (_string_) PriceBookEntryId of Target to RootLineItemId of Source Example: `01uf40000039ps9AAA:802f400000Pxl2mAAB`. ### TransformationBody * `attributeCodesToCopyDuringReplace` (_array of any_) Determines which attributes to copy when replacing an offer. Specify the unique code of the attribute. _Example_ ``` [ "CMT-9413-4", "CMT-9413" ] ``` * `price` (_boolean_) Example: `true`. * `replaceIntentSpecification` (_object_) * `SourceIntent` (_array of SourceIntentItem_) * `TargetIntent` (_object_) * `1` (_string_) Example: `01u1N00000FHXs0QAH`. ### getStringTranslationResponse get string translation response. * `totalSize` (_integer_, read-only) Number of records in the records array. Example: `1`. * `actions` (_array of object_, read-only) * `action` (_Action_) * `records` (_array of stringTranslationObject_) ### UpdateStringTranslationRequest Array of `stringTranslationObject`. ### UpdateStringTranslationResponse * `totalSize` (_integer_, read-only) Number of records in the records array. Example: `1`. * `messages` (_Messages_) ### CreateStringTranslationRequest Array of `stringTranslationObject`. ### CreateStringTranslationResponse * `totalSize` (_integer_, read-only) Number of records in the records array. Example: `1`. * `messages` (_Messages_) ### deleteStringTranslationsResponse * `totalSize` (_integer_, read-only) Number of records in the records array. Example: `1`. * `messages` (_Messages_) ### dictionaryResponse The response when an item is deleted from cart * `totalSize` (_integer_, read-only) Number of records in the records array. Example: `1`. * `records` (_array of dictionary_) ### CreateCartBody Discriminator: `subaction` selects the concrete type. * `subaction` (_string_, required) Type of cart to create and method to use to create it. Allowed values: `createOrder`, `createQuote`, `createOppty`, `assetToQuote`, `assetToOrder`, `assetChangeSite`. * `fields` (_string_) List of fields to return in the response, separated by commas. ### Messages Array of `object`. * `severity` (_string_) * `messageId` (_string_) * `code` (_integer (int32)_, required) * `message` (_string_, required) Example: `Successfully completed`. ### Action * `remote` (_object_, read-only) JavaScript Remoting URL * `REST` (_object_, read-only) REST URL ### Cart * `messages` (_Messages_) * `displaySequence` (_integer_) Sequence to display in the UI. Example: `-1`. * `Id` (_string_) Example: `8016A000000bwElQAI`. * `Name` (_string_) Example: `New customer order`. * `EffectiveDate` (_string (date)_) Example: `2017-12-25`. * `AccountId` (_string_) Example: `0016A0000053kHN`. * `Account.Name` (_string_) Example: `Acme Inc.`. * `EffectiveRecurringTotal__c` (_number (float)_) * `EffectiveOneTimeTotal__c` (_number (float)_) * `EffectiveOrderTotal__c` (_number (float)_) * `OrderNumber` (_string_) Order Number assigned by Salesforce Example: `00000141`. * `Status` (_string_) Example: `Draft`. ### CartDetail * `messages` (_Messages_) * `displaySequence` (_integer_) Sequence to display in the UI. Example: `-1`. * `details` (_object_) Cart details. Includes all fields of `JsonResult`. * `records` (_array of object_) * `Id` (_string_) Example: `8016A000000bwElQAI`. * `Name` (_string_) Example: `New customer order`. * `EffectiveDate` (_string (date)_) Example: `2017-12-25`. * `AccountId` (_string_) Example: `0016A0000053kHN`. * `Account.Name` (_string_) Example: `Acme Inc.`. * `EffectiveRecurringTotal__c` (_number (float)_) * `EffectiveOneTimeTotal__c` (_number (float)_) * `EffectiveOrderTotal__c` (_number (float)_) * `OrderNumber` (_string_) Order Number assigned by Salesforce Example: `00000141`. * `Status` (_string_) Example: `Draft`. * `orderStatusValue` (_string_) Example: `In Progress`. * `OrderStatus__c` (_string_) Example: `In Progress`. * `IsChangesAllowed__c` (_boolean_) Example: `true`. * `SupersededOrderId__c` (_string_) * `ObjectType` (_string_) Example: `Order`. * `discountsForSubmission` (_boolean_) Example: `false`. * `cartAddedDiscounts` (_number_) Example: `0`. * `canCheckoutDiscounts` (_boolean_) Example: `false`. * `isNotActiveContractDiscountPresent` (_boolean_) Example: `false`. * `accountDiscountsCount` (_number_) Example: `0`. * `contractDiscountsCount` (_number_) Example: `0`. * `frameAgreementPresent` (_boolean_) Example: `false`. * `isCartActivated` (_boolean_) Example: `true`. ### attributeCategory * `totalSize` (_integer_, read-only) Number of records in the records array. Example: `1`. * `messages` (_Messages_) * `Name` (_string_) Example: `Category1.0`. * `Id` (_string_) Example: `a0936000002rQiFAAU`. * `Code` (_string_) Example: `Al_size`. * `productAttributes` (_array of productAttribute_) ### JsonResult * `totalSize` (_integer_, read-only) Number of records in the records array. Example: `1`. * `messages` (_Messages_) * `records` (_array of object_) * `messages` (_Messages_) * `displaySequence` (_integer_) Sequence to display in the UI. Example: `-1`. * `actions` (_array of object_, read-only) ### JsonField * `datatype` (_string_) * `fieldName` (_string_) * `value` (_string_) * `editable` (_boolean_) * `hidden` (_boolean_) ### Error * `severity` (_string_) Severity of the error. Typically "ERROR" * `messageId` (_string_) * `code` (_integer (int32)_, required) * `message` (_string_, required) Example: `Error Message`. ### Account * `Name` (_string_) * `PhotoUrl` (_string_) * `OwnerId` (_string_) ### SourceIntentItem * `GroupId` (_integer_, required) specifies which group this item would be part of in the target Example: `1`. * `ActionParameter` (_string_, required) specifies the replacement price book entry of the replacement item. Only valid when the Action is set to Replace Example: `01u1N00000GNlFFQA1`. * `Action` (_string_, required) specifies the source action (Disconnect, Keep, or Replace) Example: `Replace`. * `LineItemId` (_string_, required) the line item id to which the action will be applied. Example: `0QL1N000002UiEVWA0`. ### stringTranslationObject string translations * `displaySequence` (_integer_) Sequence to display in the UI. Example: `-1`. * `Id` (_string_) Example: `a3b1N000000pfpLQAQ`. * `Name` (_string_) Example: `Root 1`. * `vlocity_cmt__StringId__c` (_string_) Example: `a3c1N0000016TkaQAE`. * `vlocity_cmt__Translation__c` (_string_) Example: `hello_fr`. * `vlocity_cmt__LocaleCode__c` (_string_) Example: `fr`. * `vlocity_cmt__StringId__r` (_stringObject_) ### dictionary The response for dictionary * `totalSize` (_integer_, read-only) Number of records in the records array. Example: `1`. * `domain` (_string_) domain is CPQ. Example: `CPQ,`. * `localeCode` (_string_) locale code. Example: `fr`. * `dictionary` (_object_) mapping of words/sentences. Additional properties: `object`. * `code` (_string_) * `text` (_string_) ### productAttribute Product Attribute * `totalSize` (_integer_, read-only) Number of records in the records array. Example: `1`. * `messages` (_Messages_) * `Name` (_string_) Example: `Attribute1.0`. * `attributeId` (_string_) Example: `a0A36000007YtQIEA0`. * `label` (_string_) Example: `Description`. * `values` (_array of attributeValue_) ### stringObject represent string object * `Id` (_string_) Example: `a3b1N000000pfpLQAQ`. * `vlocity_cmt__BaseString__c` (_string_) Example: `hello`. ### attributeValue Attribute Value * `id` (_string_) Example: `1`. * `name` (_string_) Example: `1`. * `label` (_string_) Example: `label1`. ### CartPromotions Includes all fields of `JsonResult`. * `records` (_array of CartPromotion_) ### AccountAppliedPromotions Includes all fields of `JsonResult`. * `records` (_array of AppliedPromotion_) ### CartPromotion Representation of an available or applied promotion. * `displaySequence` (_integer_, read-only) Sequence to display in the UI. Example: `0`. * `Name` (_string_, read-only) (Available promotions only) Name of the promotion. Example: `Summer TV Blowout`. * `vlocity_cmt__Code__c` (_string_, read-only) (Available promotions only) Code the identifies the given promotion. Example: `DEC123`. * `vlocity_cmt__Description__c` (_string_, read-only) (Available promotions only) Description of the promotion. Example: `25% Off HD Promo`. * `Id` (_string_, read-only) (Available promotions only) Id of the promotion (Salesforce Id). Example: `a2B37000000u5PEEAY`. * `category` (_string_, read-only) Qualification Category - Whether the promotion is _qualified_ or _disqualified_ for this cart. Allowed values: `qualified`, `disqualified`. Example: `qualified`. * `qualifications` (_array of Qualification_, read-only) * `vlocity_cmt__Sequence__c` (_object_) (Applied promotions only) Sequence in which this promotion is applied to the cart. Includes all fields of `JsonField`. * `vlocity_cmt__PromotionId__r` (_object_) (Applied promotions only) Id of the promotion. Includes all fields of `LinkField`. * `vlocity_cmt__CommitmentStartDate__c` (_object_) (Applied promotions only) Includes all fields of `JsonField`. * `vlocity_cmt__CommitmentEndDate__c` (_object_) (Applied promotions only) Includes all fields of `JsonField`. * `vlocity_cmt__PricingStartDate__c` (_object_) (Applied promotions only) Includes all fields of `JsonField`. * `vlocity_cmt__PricingEndDate__c` (_object_) (Applied promotions only) Includes all fields of `JsonField`. * `vlocity_cmt__RequestDate__c` (_object_) (Applied promotions only) Includes all fields of `JsonField`. * `vlocity_cmt__AppliesTo__c` (_object_) (Applied promotions only) Includes all fields of `JsonField`. ### AppliedPromotion Representation of an applied promotion which is applied to an account, contract or asset(s). * `vlocity_cmt__Sequence__c` (_JsonField_) * `vlocity_cmt__PromotionId__r` (_LinkField_) * `vlocity_cmt__PromotionDescription` (_JsonField_) * `vlocity_cmt__CommitmentStartDate__c` (_JsonField_) * `vlocity_cmt__CommitmentEndDate__c` (_JsonField_) * `vlocity_cmt__PricingStartDate__c` (_JsonField_) * `vlocity_cmt__PricingEndDate__c` (_JsonField_) * `vlocity_cmt__CancellationDate__c` (_JsonField_) * `vlocity_cmt__AppliedDate__c` (_JsonField_) * `vlocity_cmt__AppliesTo__c` (_JsonField_) * `category` (_string_, read-only) Qualification Category - Whether the applied promotion is now _qualified_ or _disqualified_ for the current state of the customer account. Allowed values: `qualified`, `disqualified`. Example: `qualified`. * `qualifications` (_array of Qualification_, read-only) ### Qualification Representation of a qualification required for the object it describes and whether it passes or fails for that object. * `type` (_string_) Type of qualification such as rule set, rule or rule condition. Allowed values: `RuleSet`, `Rule`, `RuleCondition`. * `name` (_string_) Name of the qualification. * `qualifies` (_boolean_) Whether this qualification is satisfied or not. * `failureMessage` (_string_) If not satisfied, a message explaining why not. * `qualifications` (_array of Qualification_) ### AccountDisqualifiedPromotions Includes all fields of `JsonResult`. * `records` (_array of AppliedPromotion_) ### LineItem The Line Item object * `itemId` (_JsonField_) * `Id` (_JsonField_) * `Pricebook2Id__r` (_LinkField_) * `Product2Id__r` (_LinkField_) * `ProductCode` (_JsonField_) * `vlocity_cmt__EffectiveQuantity__c` (_JsonField_) * `vlocity_cmt__OneTimeTotal__c` (_JsonField_) * `vlocity_cmt__RecurringCharge__c` (_JsonField_) * `attributeCategory` (_attributeCategory_) ### CreateQuoteBody A representation to create a new quote. Includes all fields of `CreateCartBody`. * `inputFields` (_array of object_, required) An array of objects each defining a field and input value. Fields must be valid field API names for the Salesforce Quote object [as defined here](https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_quote.htm) or Vlocity field extensions or fields from related objects using relationship names such as Account.Name [see Understanding Relationship Names](https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_relationships_understanding.htm) for more information. _Example_ ``` { "subaction": "createQuote", "inputFields": [ { "accountId": "0016A0000072D43" }, { "opportunityId": "0066A000002aVklQAE" }, { "status": "Draft" }, { "Pricebook2Id": "01s6A000002Y7wz" }, { "vlocity_cmt__OriginatingChannel__c": "Retail" }, { "name": "New customer quote" } ], "fields": "Id,QuoteNumber,Name,OpportunityId,Status,AccountId,Account.Name,vlocity_cmt__EffectiveQuoteTotal__c,vlocity_cmt__EffectiveRecurringTotal__c,GrandTotal,vlocity_cmt__OriginatingChannel__c" } ``` ### CreateOpptyBody A representation to create a new opportunity. Includes all fields of `CreateCartBody`. * `inputFields` (_array of object_, required) An array of objects each defining a field and input value. Fields must be valid field API names for the Salesforce Opportunity object [as defined here](https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_opportunity.htm) or Vlocity field extensions or fields from related objects using relationship names such as Account.Name [see Understanding Relationship Names](https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_relationships_understanding.htm) for more information. _Example_ ``` { "subaction": "createOppty", "inputFields": [ { "accountId": "0016A0000053kHN" }, { "stageName": "Prospecting" }, { "name": "New customer opportunity" }, { "type": "New Customer" }, { "closeDate": "2017-12-07" }, { "vlocity_cmt__NumberOfContractedMonths__c": 24 }, { "Pricebook2Id": "01s6A000002Y7wz" }, { "vlocity_cmt__OriginatingChannel__c": "Dealer" } ], "fields": "Id,Name,AccountId,Account.Name,vlocity_cmt__EffectiveRecurringTotal__c,vlocity_cmt__EffectiveOneTimeTotal__c,vlocity_cmt__EffectiveOpportunityTotal__c,Amount,vlocity_cmt__OriginatingChannel__c" } ``` ### AssetToOrderBody A representation to create a new order from an array of customer assets. Includes all fields of `CreateCartBody`. * `inputFields` (_array of object_, required) An array of objects each defining a field and input value. Fields must be valid field API names for the Salesforce Order object [as defined here](https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_order.htm) or Vlocity field extensions or fields from related objects using relationship names such as Account.Name [see Understanding Relationship Names](https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_relationships_understanding.htm) for more information. _Example_ ``` { "subaction": "assetToOrder", "accountId": "0016A0000072D3y", "requestDate": "2017-12-07", "assetIdList": [ "01t36000000pfcKAAQ", "02i6A000000YEXN" ], "fields": "Id,OrderNumber,Name,EffectiveDate,Status,AccountId,Account.Name,vlocity_cmt__EffectiveOrderTotal__c,vlocity_cmt__EffectiveRecurringTotal__c,TotalAmount,vlocity_cmt__OriginatingChannel__c" } ``` ### AddCartItemBody A representation to update the cart. * `inputFields` (_array of object_, required) An array of objects each defining a field and input value. Fields must be valid field API names for the Salesforce Order object [as defined here](https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_order.htm) or Vlocity field extensions or fields from related objects using relationship names such as Account.Name [see Understanding Relationship Names](https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_relationships_understanding.htm) for more information. _Example_ ``` { "items": [ { "itemId": "01uf4000000gmRTAAY", "parentId": "802f4000000PZ1VAAW", "parentRecord": { "records": [ { "messages": [], "displaySequence": -1, "Id": { "messages": [], "label": "Order Product ID", "hidden": false, "fieldName": "Id", "editable": false, "dataType": "ID", "value": "802f4000000PZ1VAAW" }, "UnitPrice": { "messages": [], "label": "Unit Price", "hidden": true, "fieldName": "UnitPrice", "editable": false, "dataType": "CURRENCY", "value": 358.95 }, "productId": "01tf4000000Kd0uAAC", "defaultQuantity": 1, "minQuantity": 0, "maxQuantity": 99999, "groupMinQuantity": 0, "groupMaxQuantity": 99999, "sequenceNumber": 1, "productHierarchyPath": "01tf4000000Kd0uAAC", "itemType": "lineItem", "childProducts": { "records": [ { "Name": { "label": "Product Name", "value": "PRODUCT-77151" }, "UnitPrice": { "label": "List Price", "value": 0 }, "vlocity_cmt__RecurringPrice__c": { "label": "Recurring Price", "value": 0 }, "Product2Id": { "label": "Product ID", "value": "01tf4000000Kd0zAAC" }, "Pricebook2Id": { "label": "Price Book ID", "value": "01sf4000003LYn3AAG" }, "Id": { "label": "Price Book Entry ID", "value": "01uf4000000gmRTAAY" }, "defaultQuantity": 0, "productId": "01tf4000000Kd0zAAC", "Product2": { "Name": "PRODUCT-77151", "RecordTypeId": "012f40000004zEOAAY", "vlocity_cmt__IsConfigurable__c": false, "vlocity_cmt__SubType__c": "None", "vlocity_cmt__Type__c": "None" }, "messages": [], "actions": { "addtocart": { "rest": { "params": { "price": true, "validate": true, "includeAttachment": false, "pagesize": 20, "hierarchy": -1, "items": [ { "parentId": "802f4000000PZ1VAAW", "quantity": 0, "itemId": "01uf4000000gmRTAAY" } ], "cartId": "801f4000000ChZjAAK" }, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/801f4000000ChZjAAK/items" }, "remote": { "params": { "price": true, "validate": true, "includeAttachment": false, "pagesize": 20, "hierarchy": -1, "items": [ { "parentId": "802f4000000PZ1VAAW", "quantity": 0, "itemId": "01uf4000000gmRTAAY" } ], "cartId": "801f4000000ChZjAAK", "methodName": "postCartsItems" } }, "client": { "params": { "pagesize": 0, "hierarchy": 0 } } } } } ] }, "vlocity_cmt__RecurringPrice__c": 527.96, "name": "PRODUCT-39982", "provisioningStatus": "New", "Product2Id": "01tf4000000Kd0uAAC", "PricebookEntryId": { "messages": [], "label": "Price Book Entry ID", "hidden": false, "fieldName": "PricebookEntryId", "editable": false, "dataType": "REFERENCE", "value": "01uf4000000gmRJAAY" }, "Quantity": { "messages": [], "label": "Quantity", "hidden": false, "fieldName": "Quantity", "editable": true, "dataType": "DOUBLE", "value": 1 }, "vlocity_cmt__OneTimeTotal__c": { "messages": [], "label": "One Time Total", "hidden": false, "fieldName": "vlocity_cmt__OneTimeTotal__c", "editable": false, "dataType": "CURRENCY", "value": 358.95 }, "vlocity_cmt__RecurringTotal__c": { "messages": [], "label": "Recurring Total", "hidden": false, "fieldName": "vlocity_cmt__RecurringTotal__c", "editable": false, "dataType": "CURRENCY", "value": 527.96 }, "vlocity_cmt__OneTimeCharge__c": { "messages": [], "label": "One Time Charge", "hidden": true, "fieldName": "vlocity_cmt__OneTimeCharge__c", "editable": false, "dataType": "CURRENCY", "value": 358.95 }, "vlocity_cmt__RecurringCharge__c": { "messages": [], "label": "Recurring Charge", "hidden": true, "fieldName": "vlocity_cmt__RecurringCharge__c", "editable": false, "dataType": "CURRENCY", "value": 527.96 }, "vlocity_cmt__RecurringManualDiscount__c": { "messages": [], "label": "Recurring Manual Discount", "hidden": false, "fieldName": "vlocity_cmt__RecurringManualDiscount__c", "editable": true, "dataType": "PERCENT", "value": 0 }, "vlocity_cmt__OneTimeManualDiscount__c": { "messages": [], "label": "One Time Manual Discount", "hidden": false, "fieldName": "vlocity_cmt__OneTimeManualDiscount__c", "editable": true, "dataType": "PERCENT", "value": 0 }, "PricebookEntry": { "Product2Id": "01tf4000000Kd0uAAC", "Pricebook2Id": "01sf4000003LYn3AAG", "Id": "01uf4000000gmRJAAY", "Product2": { "Name": "PRODUCT-39982", "Id": "01tf4000000Kd0uAAC", "vlocity_cmt__Type__c": "None", "vlocity_cmt__IsConfigurable__c": "false" } }, "Product2": { "Name": "PRODUCT-39982", "RecordTypeId": "012f40000004zEOAAY", "vlocity_cmt__IsConfigurable__c": false, "vlocity_cmt__SubType__c": "None", "vlocity_cmt__Type__c": "None" }, "vlocity_cmt__ItemName__c": { "messages": [], "label": "Item Name", "hidden": false, "fieldName": "vlocity_cmt__ItemName__c", "editable": true, "dataType": "STRING" }, "actions": { "addtocart": { "rest": { "params": { "price": true, "validate": true, "includeAttachment": false, "pagesize": 20, "hierarchy": -1, "items": [ { "parentId": "802f4000000PZ1VAAW", "quantity": 1, "itemId": "01uf4000000gmRJAAY" } ], "cartId": "801f4000000ChZjAAK" }, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/801f4000000ChZjAAK/items" }, "remote": { "params": { "price": true, "validate": true, "includeAttachment": false, "pagesize": 20, "hierarchy": -1, "items": [ { "parentId": "802f4000000PZ1VAAW", "quantity": 1, "itemId": "01uf4000000gmRJAAY" } ], "cartId": "801f4000000ChZjAAK", "methodName": "postCartsItems" } }, "client": { "params": { "pagesize": 0, "hierarchy": 0 } } } } } ] } } ], "hierarchy": "0,", "pagesize": "0,", "levelBasedApproach": false } ``` ### NewAccountSite Request body sent to create new account for the current site. * `cartId` (_string_) Example: `8011N00000157LkQAI`. * `methodName` (_string_) Example: `newSite`. * `ObjectType` (_string_) Example: `Account`. * `items` (_array of any_) _Example_ ``` [ "Name", "vlocity_cmt__Active__c" ] ``` ### DeleteCartItem The response when an item is deleted from cart * `totalSize` (_integer_, read-only) Number of records in the records array. Example: `1`. * `messages` (_Messages_) * `actions` (_array of object_, read-only) * `action` (_Action_) * `records` (_array of Item_) ### PostPricingResponse Response for the post pricing of lineItems. * `totalSize` (_integer_, read-only) Number of records in the records array. Example: `1`. * `messages` (_Messages_) * `actions` (_array of object_, read-only) * `action` (_Action_) ### GetCartItemResult Response of Get Cart Items * `totalSize` (_integer_, read-only) Number of records in the records array. Example: `1`. * `messages` (_Messages_) * `records` (_array of CartItem_) ### CartItem Response of Get Cart Items * `messages` (_Messages_) * `actions` (_Action_) * `itemId` (_string_) itemId Example: `01u41000001QPtsAAG`. ### GetProductResult The list of products in the selectables * `totalSize` (_integer_, read-only) Number of records in the records array. Example: `1`. * `messages` (_Messages_) * `actions` (_array of object_, read-only) * `action` (_Action_) * `records` (_array of Product_) ### Product the product object * `messages` (_Messages_) * `displaySequence` (_integer_) Sequence to display in the UI. Example: `-1`. * `Id` (_string_) Example: `01u41000001QPs0AAG`. * `Pricebook2Id` (_string_) Example: `01s41000005dPYQAA2`. * `Product2Id` (_string_) Example: `01t41000000sYZQAA2`. * `UnitPrice` (_number (float)_) Example: `1`. * `Name` (_string_) Example: `Root 1`. * `IsActive` (_boolean_) Example: `true`. ### LinkField * `Id` (_string_) * `Name` (_string_) * `Url` (_string_) # Contains Offer API Running the Contains Offer API is optional. The Contains Offer API finds all the products and promotions that contain a given offer in their hierarchy and also qualifies under the given context combination. This API also paginates and sorts the list of products and promotions and caches the result. This API adds the required action nodes to the responses if there are remaining pages after the current page. You can obtain the ctxEligibilityCacheKey required in the request body of this API from the apiResponse.eligibilityContextKey node in the response body of the [Context Eligibility API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-context-eligibility-api.md). You can obtain the offerId required in the URI of this API from the apiResponse.data.catalogProductRelationDetails.Product node in the response body of the [Catalog Profile API](/docs/commerce/commerce/guide/comms-t-catalog-profile-api.html). ## Preconditions You must first run the [Context Eligibility API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-context-eligibility-api.md) to obtain the offerId required in the request body of this API. ## URI /services/apexrest/{namespace}/v3/admin/catalogs/{catalogCode}/offers/{offerId}/containsoffer ## HTTP Method POST ## URI Parameters If you specify just one of these two parameters, it follows the behavior described in the table below and accepts your defined time for the parameter you specified. If you are using one or both parameters, you must specify them with the same values for all of the Populate Cache APIs in this sequence. | Parameter | Example | Default | Optional/Required | Notes | | ------------------ | ------------------- | ------------------------------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | effectiveStartTime | 2001-07-04T12:08:56 | Current date and time | Optional | effectiveStartTime is the time that you want your cached catalog entries to be effective. It should be in the UTC date-time format. Your effectiveStartTime must occur after the current time for which you are executing the Populate Cache APIs or you will receive an error message. | | expirationTime | 2001-07-04T12:08:56 | effectiveStartTime + TimeToLive | Optional | expirationTime is the time that you want your cached catalog entries to expire. It should also be in the UTC date-time format. Your expirationTime must occur after your effectiveStartTime or you receive an error message. TimeToLive is a custom setting created in CPQ Configuration Setup. It has a default value of 30 days. | Here is an example of how to pass the URI parameters: ```nolang GET /services/apexrest/vlocity_cmt/v3/admin/catalogs/AS-Test-Catalog/containsoffer?effectiveStartTime=2021-07-04T12:08:56&expirationTime=2021-08-04T12:08:56 ``` ## Request Body Parameters | Parameter | Data type | Description | Default | Optional/Required | | ---------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- | ----------------- | | ctxEligibilityCacheKey | String | Cache key pointing to the context eligibility record whose context combination calculates the eligibility of offers returned by this API. | Null, which produces a response for the default context combination | Optional | ## Sample Request Body This is a sample request for the ctxEligibilityCacheKey. ``` { "ctxEligibilityCacheKey": "200b3622d38bb67369192ced32fbda5c" } ``` ## Remote API This is an example of how you invoke the API using Apex: ```nolang String methodName; String requestBodyJSON; Map input = new Map(); Map output = new Map(); Map options = new Map(); // Setting remote parameters methodName = 'getContainingOffers'; requestBodyJSON = '{"ctxEligibilityCacheKey":"02ab891802e4df7a0f68a0f998a55879"}'; input.put('apiName', 'CMContainsOffer'); // required input.put('methodName', methodName); // required input.put('catalogCode', 'TestCatalog'); // required input.put('offerId', '01t4x000000x269AAA'); // required input.put('requestBody', requestBodyJSON); // required input.put('effectiveStartTime', null); // optional input.put('expirationTime', null); // optional //remote action invocation vlocity_cmt.CpqAppHandler appHandler = new vlocity_cmt.CpqAppHandler(); appHandler.invokeMethod(methodName, input, output, options); ``` ## Parallel Invocation You can run this API in parallel for multiple catalogs, offers, and context combinations. For example, there may be 100 products (Product1, Product2 ... Product100) and 100 context combinations (Combo1, Combo2 ... Combo100) that you can run in parallel. ```nolang THREAD1 - POST /services/apexrest/{namespace}/v3/admin/catalogs/catalog1/offers/Product1/containsoffer THREAD2 - POST /services/apexrest/{namespace}/v3/admin/catalogs/catalog1/offers/Product1/containsoffer ...... THREAD100 - POST /services/apexrest/{namespace}/v3/admin/catalogs/catalog1/offers/Product1/containsoffer THREAD101 - POST /services/apexrest/{namespace}/v3/admin/catalogs/catalog1/offers/Product2/containsoffer ...... THREAD10000 - POST /services/apexrest/{namespace}/v3/admin/catalogs/catalog1/offers/Product100/containsoffer ``` ## HTTP Headers | Header | Description | | ------------ | ---------------- | | Content-Type | application/json | ## Response Body This example shows products and promotions that contain a given offer in their hierarchy and also qualifies under the given context combination. ``` [ { "contextKey": "d187cb8118349e3e32460393c62e44e1", "result": { "Promotion": [ "a3T4x000000l39BEAQ" ], "Product": [ "01t4x000000wx2vAAA", "01t4x000000wx2wAAA" ] } } ] ``` ## HTTP Response Codes | Code | Description | | ---- | --------------------- | | 200 | OK | | 500 | Internal Server Error | # Context Combinations API The Context Combinations API generates a cartesian product of all the sets of dimension combination values passed in the request body. If a context dimension is not passed in the request, all the valuesForCaching are used for that dimension to generate the cartesian product. This API also returns a cache key that is required by the context eligibility API. Keep the pageSize option under 20 to avoid reaching Salesforce governor limits. You can obtain the dimensions required for the request body of this API from the apiResponse node in the response body of the [Context Dimensions API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-context-dimensions-api.md). The code for each element in the API response becomes the key of the dimensions hash map and the valuesForCaching forms its values. ## Precondition You must first run the [Context Dimensions API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-context-dimensions-api.md) to obtain the dimensions required for the request body of this API. ## URI /services/apexrest/{namespace}/v3/admin/catalogs/{catalogCode}/contextcombinations ## HTTP Method POST ## URI Parameters If you specify just one of these two parameters, it follows the behavior described in the table below and accepts your defined time for the parameter you specified. If you are using one or both parameters, you must specify them with the same values for all of the Populate Cache APIs in this sequence. | Parameter | Example | Default | Optional/Required | Notes | | ------------------ | ------------------- | ------------------------------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | effectiveStartTime | 2001-07-04T12:08:56 | Current date and time | Optional | effectiveStartTime is the time that you want your cached catalog entries to be effective. It should be in the UTC date-time format. Your effectiveStartTime must occur after the current time for which you are executing the Populate Cache APIs or you will receive an error message. | | expirationTime | 2001-07-04T12:08:56 | effectiveStartTime + TimeToLive | Optional | expirationTime is the time that you want your cached catalog entries to expire. It should also be in the UTC date-time format. Your expirationTime must occur after your effectiveStartTime or you receive an error message. TimeToLive is a custom setting created in CPQ Configuration Setup. It has a default value of 30 days. | Here is an example of how to pass the URI parameters: ```nolang GET /services/apexrest/vlocity_cmt/v3/admin/catalogs/AS-Test-Catalog/contextcombinations?effectiveStartTime=2021-07-04T12:08:56&expirationTime=2021-08-04T12:08:56 ``` ## Request Body Parameters For example,

Parameter

Data Type

Description

Default

Optional/Required

dimensions

Map/Dictionary/Associative array

Key = String

Value = List of strings

Map containing only the dimensions for which you want to reduce the number of values used for creating combinations. This API lets you generate only cached entries for specific context dimensions and values, for example, you can calculate combinations for Gold and Silver values for an Account SLA dimension.

You can leave this parameter blank if you want to perform all the context combinations relevant to your sales catalog or are not using any context dimensions with your catalog.

You can obtain the dimensions required for the request body of this API from the apiResponse node in the response body of the Context Dimensions API.

N/A

Required

pagesize

Positive integer

Number of entries to process

20

Optional

offset

Non-negative integer

Index of the entry from which to start processing

0

Optional

```nolang { "dimensions": { }, "pagesize": 4, "offset":12 } ``` ## Sample Request Body This is a sample request for a catalog without rules assigned to its offers. ```nolang { "dimensions": { // This map defines the deviations that you want from the default behavior of the API. If you want the default behavior i.e. populate all combinations, you can leave this hashmap blank. "D1": [ "V1", "V2" ], "D2": [ "V3", "V4" ], "D3": [ "V5", "V6" ], "D4": [ "V7", "V8" ] }, "pagesize": 4, "offset":12 } Here there are 4 dimensions and for each dimension, there are two values. Hence there are 16 possible combinations of dimensions: D1:V1, D2:V3, D3:V5, D4:V7 D1:V1, D2:V3, D3:V5, D4:V8 D1:V1, D2:V3, D3:V6, D4:V7 D1:V1, D2:V3, D3:V6, D4:V8 D1:V1, D2:V4, D3:V5, D4:V7 D1:V1, D2:V4, D3:V5, D4:V8 D1:V1, D2:V4, D3:V6, D4:V7 D1:V1, D2:V4, D3:V6, D4:V8 D1:V2, D2:V3, D3:V5, D4:V7 D1:V2, D2:V3, D3:V5, D4:V8 D1:V2, D2:V3, D3:V6, D4:V7 D1:V2, D2:V3, D3:V6, D4:V8 D1:V2, D2:V4, D3:V5, D4:V7 D1:V2, D2:V4, D3:V5, D4:V8 D1:V2, D2:V4, D3:V6, D4:V7 D1:V2, D2:V4, D3:V6, D4:V8 The above API call will return 4 combinations starting from the 12th combination. i.e. D1:V2, D2:V4, D3:V5, D4:V7 D1:V2, D2:V4, D3:V5, D4:V8 D1:V2, D2:V4, D3:V6, D4:V7 D1:V2, D2:V4, D3:V6, D4:V8 ``` ## Remote API This is an example of how you invoke the API using Apex: ```nolang String methodName; String requestBodyJSON; Map input = new Map(); Map output = new Map(); Map options = new Map(); // Setting remote parameters methodName = 'getContextCombinations'; requestBodyJSON = '{"dimensions":{"D1":["V1","V2"],"D2":["V4","V5"]},"offset":20,"pagesize":10}'; input.put('apiName','CMContextCombinations'); // required input.put('catalogCode', 'TestCatalog'); // required input.put('effectiveStartTime', null); // optional input.put('expirationTime', null); // optional input.put('requestBody', requestBodyJSON); // required input.put('methodName',methodName); // required input.put('requestURL', '/v3/admin/catalogs/TestCatalog/contextcombinations'); //required //remote action invocation vlocity_cmt.CpqAppHandler appHandler = new vlocity_cmt.CpqAppHandler(); appHandler.invokeMethod(methodName, input, output, options); ``` ## Parallel Invocation You can run this API in parallel for multiple catalogs. For example, you may have 100 catalogs (Catalog1, Catalog2..Catalog 100). Each catalog has five dimensions with three values each. This gives you a total of 243 combinations for each catalog. If you have a page size of 20, this gives you 13 pages per catalog with a total of 1,300 combinations. Each of these pages can be populated in parallel threads. ```nolang THREAD1 - POST /services/apexrest/{namespace}/v3/admin/catalogs/catalog1/contextcombinations THREAD2 - POST /services/apexrest/{namespace}/v3/admin/catalogs/catalog1/contextcombinations ... THREAD13 - POST /services/apexrest/{namespace}/v3/admin/catalogs/catalog1/contextcombinations THREAD14 - POST /services/apexrest/{namespace}/v3/admin/catalogs/catalog2/contextcombinations ...... THREAD1300 - POST /services/apexrest/{namespace}/v3/admin/catalogs/catalog100/contextcombinations ``` ## HTTP Headers | Header | Description | | ------------ | ---------------- | | Content-Type | application/json | ## Response Body This example shows a cartesian product of dimension combination values passed in the request body. ``` { "cacheKey": "fac5fff741e461da4b74355c892277ec", "apiResponse": [ { "D1": "V1", "D2": "V4" }, { "D1": "V1", "D2": "V5" }, { "D1": "V2", "D2": "V4" }, { "D1": "V2", "D2": "V5" } ], "catalogCode": "allDimensionProductsCatalog-", "errorCode": "INVOKE-200", "error": "OK" } ``` ## HTTP Response Codes | Code | Description | | ---- | --------------------- | | 200 | OK | | 500 | Internal Server Error | # Context Dimensions API The Context Dimensions API generates a list of cacheable and active context dimension codes and their values for caching. These dimensions and values are associated with rule sets attached to the catalog offers. This API does not require anything from the previous API response. The list is ordered and is guaranteed to return the same order on every run as long as dimensions are not added or removed from the catalog. If a context dimension associated with a catalog offer is not cacheable, it does not appear in the response. If a cacheable context dimension is not associated with a catalog offer, it does not appear in the response. The Context Dimensions API call is required regardless of whether you have any rule sets linked to your catalog because the output of this API is internally required by subsequent APIs. ## URI /services/apexrest/{namespace}/v3/admin/catalogs/{catalogCode}/contextdimensions ## HTTP Method GET ## URI Parameters If you specify just one of these two parameters, it follows the behavior described in the table below and accepts your defined time for the parameter you specified. If you are using one or both parameters, you must specify them with the same values for all of the Populate Cache APIs in this sequence. | Parameter | Example | Default | Optional/Required | Notes | | ------------------ | ------------------- | ------------------------------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | effectiveStartTime | 2001-07-04T12:08:56 | Current date and time | Optional | effectiveStartTime is the time that you want your cached catalog entries to be effective. It should be in the UTC date-time format. Your effectiveStartTime must occur after the current time for which you are executing the Populate Cache APIs or you will receive an error message. | | expirationTime | 2001-07-04T12:08:56 | effectiveStartTime + TimeToLive | Optional | expirationTime is the time that you want your cached catalog entries to expire. It should also be in the UTC date-time format. Your expirationTime must occur after your effectiveStartTime or you receive an error message. TimeToLive is a custom setting created in CPQ Configuration Setup. It has a default value of 30 days. | Here is an example of how to pass the URI parameters: ```nolang GET /services/apexrest/vlocity_cmt/v3/admin/catalogs/AS-Test-Catalog/contextdimensions?effectiveStartTime=2021-07-04T12:08:56&expirationTime=2021-08-04T12:08:56 ``` ## Remote API This is an example of how you invoke the API using Apex: ```nolang String methodName; Map input = new Map(); Map output = new Map(); Map options = new Map(); // Setting remote parameters methodName = 'getContextDimensions'; input.put('apiName','CMContextDimensions'); // required input.put('catalogCode', 'TestCatalog'); // required input.put('effectiveStartTime', null); // optional input.put('expirationTime', null); // optional input.put('methodName',methodName); // required input.put('requestURL', '/v3/admin/catalogs/TestCatalog/contextdimensions'); // required //remote action invocation vlocity_cmt.CpqAppHandler appHandler = new vlocity_cmt.CpqAppHandler(); appHandler.invokeMethod(methodName, input, output, options); ``` ## Parallel Invocation This API can be run in parallel for multiple catalogs. For example, if you have 100 catalogs (Catalog1, Catalog2..Catalog 100), you can run the API for all 100 catalogs in 100 parallel threads. ```nolang THREAD1 - GET /services/apexrest/{namespace}/v3/admin/catalogs/catalog1/contextdimensions THREAD2 - GET /services/apexrest/{namespace}/v3/admin/catalogs/catalog2/contextdimensions ...... THREAD100 - GET /services/apexrest/{namespace}/v3/admin/catalogs/catalog100/contextdimensions ``` ## HTTP Headers | Header | Description | | ------------ | ---------------- | | Content-Type | application/json | ## Response Body This example shows a list of maps having dimension code and values marked for caching. ``` [ { "code": "DIMENSION1", "valuesForCaching": [ "VALUE1", "VALUE2", "VALUE3" ] }, { "code": "DIMENSION2", "valuesForCaching": [ "VALUE4", "VALUE5", "VALUE6" ] }, { "code": "DIMENSION3", "valuesForCaching": [ "VALUE7", "VALUE8", "VALUE9" ] } ] ``` The response body contains the following: - DIMENSION1, DIMENSION2, DIMENSION3, etc. are sorted in an arbitrary order. There is no need to specify these in EPC. - DIMENSION1, DIMENSION2, DIMENSION3, etc. are extracted from all the rules of the products in the catalog, for example, only the relevant dimensions. ## HTTP Response Codes | Code | Description | | ---- | --------------------- | | 200 | OK | | 500 | Internal Server Error | # Context Eligibility API The Context Eligibility API identifies context combinations of products and promotions that are eligible for each of the combinations. The API accepts cacheKey as the request body parameter for Context Eligibility. Context Eligibility is an output parameter consisting of generated context combinations. For each context combination in the output of the Context Combinations API, there is one context eligibility in the API response that contains qualifying products and promotions for that context combination. You can obtain the cacheKey required in the request body of this API from the cacheKey node in the response body of the [Context Combinations API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-context-combinations-api.md). ## Precondition You must first run the [Context Combinations API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-context-combinations-api.md) to obtain the cacheKey required in the request body of this API. ## URI /services/apexrest/{namespace}/v3/admin/catalogs/{catalogCode}/contexteligibility ## HTTP Method POST ## URI Parameters If you specify just one of these two parameters, it follows the behavior described in the table below and accepts your defined time for the parameter you specified. If you are using one or both parameters, you must specify them with the same values for all of the Populate Cache APIs in this sequence. | Parameter | Example | Default | Optional/Required | Notes | | ------------------ | ------------------- | ------------------------------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | effectiveStartTime | 2001-07-04T12:08:56 | Current date and time | Optional | effectiveStartTime is the time that you want your cached catalog entries to be effective. It should be in the UTC date-time format. Your effectiveStartTime must occur after the current time for which you are executing the Populate Cache APIs or you will receive an error message. | | expirationTime | 2001-07-04T12:08:56 | effectiveStartTime + TimeToLive | Optional | expirationTime is the time that you want your cached catalog entries to expire. It should also be in the UTC date-time format. Your expirationTime must occur after your effectiveStartTime or you receive an error message. TimeToLive is a custom setting created in CPQ Configuration Setup. It has a default value of 30 days. | Here is an example of how to pass the URI parameters: ```nolang GET /services/apexrest/vlocity_cmt/v3/admin/catalogs/AS-Test-Catalog/contexteligibility?effectiveStartTime=2021-07-04T12:08:56&expirationTime=2021-08-04T12:08:56 ``` ## Request Body Parameters | Parameter | Data Type | Description | Default | Optional/Required | | --------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | ----------------- | | cacheKey | String | Cache key pointing to the record containing combinations for the context eligibility that needs populating. You can obtain the cacheKey required in the request body of this API from the cacheKey node in the response body of the Context Combinations API. | N/A | Required | ## Sample Request Body This is a sample request for a cacheKey. ```nolang { "cacheKey": "1f1d5f350cb0efd232086e274ef00647" } ``` ## Remote API This is an example of how you invoke the API using Apex: ```nolang String methodName; String requestBodyJSON; Map input = new Map(); Map output = new Map(); Map options = new Map(); // Setting remote parameters methodName = 'getEligibility'; requestBodyJSON = '{"cacheKey":"1f1d5f350cb0efd232086e274ef00647"}'; input.put('apiName','CMContextEligibility'); //required input.put('catalogCode', 'TestCatalog'); //required input.put('effectiveStartTime', null); //optional input.put('expirationTime', null); //optional input.put('requestBody', requestBodyJSON); //required input.put('methodName',methodName); //required input.put('requestURL', '/v3/admin/catalogs/TestCatalog/contexteligibility'); //required //remote action invocation vlocity_cmt.CpqAppHandler appHandler = new vlocity_cmt.CpqAppHandler(); appHandler.invokeMethod(methodName, input, output, options); ``` ## Parallel Invocation You can process each contextCombinationResultItem in parallel. If there are 100 catalogs and each catalog links to 13 contextCombinationsResultItems, then all 1,300 contextCombinationResultItems can be run in parallel. ```nolang THREAD1 - POST /services/apexrest/{namespace}/v3/admin/catalogs/catalog1/contexteligibility THREAD2 - POST /services/apexrest/{namespace}/v3/admin/catalogs/catalog1/contexteligibility ... THREAD13 - POST /services/apexrest/{namespace}/v3/admin/catalogs/catalog1/contexteligibility THREAD14 - POST /services/apexrest/{namespace}/v3/admin/catalogs/catalog2/contexteligibility ...... THREAD1300 - POST /services/apexrest/{namespace}/v3/admin/catalogs/catalog100/contexteligibility ``` ## HTTP Headers | Header | Description | | ------------ | ---------------- | | Content-Type | application/json | ## Response Body This example shows the context combinations of products and promotions that are eligible for each of the combinations. ``` { "apiResponse": [ { "eligibilityObjMap": { "Promotion": [], "Product": [ "01t5w00000FbI08AAF" ] }, "contextValueKeySet": [ "DIM_ORD_FUNCTION\"UPGRADE\"", "DIM_SALES_CHANNEL\"VHAOnlineStore\"", "DIM_ORD_TYPE_001\"Connect\"", "OriginatingChannel\"CallCenter\"", "AccountStatus\"Active\"" ], "contextValueKeyCount": 5, "eligibilityContextString": "testcatalogCtxEligibilityResult0a49c26b44fcf8257224e7e077a5d97c", "eligibilityContextKey": "c161669788f961dba463ed0742f17622", "contextString": "{\"AccountStatus\":\"Active\",\"DIM_ORD_FUNCTION\":\"UPGRADE\",\"DIM_ORD_TYPE_001\":\"Connect\",\"DIM_SALES_CHANNEL\":\"VHAOnlineStore\",\"OriginatingChannel\":\"CallCenter\"}", "contextKey": "0a49c26b44fcf8257224e7e077a5d97c" } ], "catalogCode": "allDimensionProductsCatalog-", "errorCode": "INVOKE-200", "error": "OK" } ``` ## HTTP Response Codes | Code | Description | | ---- | --------------------- | | 200 | OK | | 500 | Internal Server Error | # Context Eligibility Rules with Digital Commerce The Digital Commerce API caching leverages the context eligibility rules framework. Use the context rules framework to build rules that change what products, promotions, and prices appear for customers. You can also create rules to ensure pricing adjustments are allowed only in certain conditions. For more information about Context Rules Framework, refer to [Context Rules Framework](https://help.salesforce.com/s/articleView?id=ind.comms_context_rules_framework.htm). You can execute the context eligibility rules for: - [Anonymous and Known User Browsing](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-anonymous-and-known-user-browsing.md) - [Configure and Basket Operations](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-configure-and-basket-operations.md) # CPQ APIs to Replace OmniCPQServiceWrapper The OmniCPQServiceWrapper implementation is a class for OmniScripts that supports named methods used in guided selling. **note:** As of the CME Spring '17 release, OmniCPQServiceWrapper is deprecated. Salesforce recommends using the Omnichannel CPQ REST APIs instead of OmniCPQServiceWrapper. | OmniCPQServiceWrapper Method Name | CPQ API Method Name | CPQ API Name | | --------------------------------- | ------------------- | --------------------------------------------------------- | | addProducts | postCartsItems | [Add Items to Cart](https://developer.salesforce.com/docs/industries/cme/guide/comms-add-items-to-cart.md) | | createOpportunity | createCart | [Create Cart](https://developer.salesforce.com/docs/industries/cme/guide/comms-create-cart.md) | | createOrder | createCart | [Create Cart](https://developer.salesforce.com/docs/industries/cme/guide/comms-create-cart.md) | | createQuote | createCart | [Create Cart](https://developer.salesforce.com/docs/industries/cme/guide/comms-create-cart.md) | | deleteItem | deleteCartsItems | [Remove Items from Cart](https://developer.salesforce.com/docs/industries/cme/guide/comms-remove-items-from-cart.md) | | getProducts | getCartsProducts | [Get List of Products](https://developer.salesforce.com/docs/industries/cme/guide/comms-get-list-of-products.md) | | submitOpportunity | checkout | [Checkout Items in Cart](https://developer.salesforce.com/docs/industries/cme/guide/comms-checkout-items-in-cart.md) | | submitOrder | checkout | [Checkout Items in Cart](https://developer.salesforce.com/docs/industries/cme/guide/comms-checkout-items-in-cart.md) | | submitQuote | checkout | [Checkout Items in Cart](https://developer.salesforce.com/docs/industries/cme/guide/comms-checkout-items-in-cart.md) | | updateItem | putCartsItems | [Update Items in Cart](https://developer.salesforce.com/docs/industries/cme/guide/comms-update-items-in-cart.md) | # CpqAppHandlerError Codes for Cart-Based APIs Out of the box, error messages in CpqAppHandlerErrors.cls are based on custom labels. You define all CpqAppHandler error messages in the CpqAppHandlerErrors class, then create the translations for these messages. Each error must have: - A unique integer code. - A default error message. You may use this message to construct the JSONMessage. The out of box error messages defined in the CpqAppHandlerErrors class are not intended to be translated because the error code is used to get the translated error message. The following is the via_cpq/classes/CpqAppHandlerErrors.cls: ```nolang public class CpqAppHandlerErrors { // General Cart Errors - 100 public static CpqAppHandlerError INVALID_CART_ID = new CpqAppHandlerError('100', Label.CPQInvalidCartID); public static CpqAppHandlerError NO_RESULTS_FOUND = new CpqAppHandlerError('101', Label.CPQNoResultsFound); public static CpqAppHandlerError INVALID_CATALOG_ID = new CpqAppHandlerError('102', Label.CPQInvalidCatalogID); public static CpqAppHandlerError INVALID_ACCOUNT_ID = new CpqAppHandlerError('103', Label.InvalidAccountId); public static CpqAppHandlerError INVALID_ASSET_ID = new CpqAppHandlerError('104', Label.InvalidAssetId); public static CpqAppHandlerError NO_PARAMS_FOUND = new CpqAppHandlerError('105', Label.NoParamsFound); public static CpqAppHandlerError NO_URL_PASSED = new CpqAppHandlerError('106', Label.NoURLPassed); public static CpqAppHandlerError KEY_GENERATION_ERROR = new CpqAppHandlerError('107', Label.KeyGenerationError); public static CpqAppHandlerError INVALID_PREMISES_ID = new CpqAppHandlerError('108', Label.InvalidPremisesId); // Product Errors - 120 public static CpqAppHandlerError INVALID_COMPARE_PRODUCT_ID = new CpqAppHandlerError('120', Label.CPQNoValidProdID); public static CpqAppHandlerError MIN_NUMBER_PRODUCT_COMPARE = new CpqAppHandlerError('121', Label.CPQMinTwoProd); public static CpqAppHandlerError INVALID_PBE_ID = new CpqAppHandlerError('122', Label.CPQInvalidPBEID); // Item Errors - 140 public static CpqAppHandlerError INVALID_ITEM_ID = new CpqAppHandlerError('140', Label.CPQInvalidItemID); public static CpqAppHandlerError VALIDATION_ERROR_DELETE = new CpqAppHandlerError('141', Label.CPQItemCannotBeDeleted); public static CpqAppHandlerError INVALID_QUANTITY = new CpqAppHandlerError('142', Label.CPQInvalidQLI); public static CpqAppHandlerError NO_ITEMS_TO_ADD = new CpqAppHandlerError('143', Label.CPQNoItemsToAdd); public static CpqAppHandlerError NO_ITEMS_TO_UPDATE = new CpqAppHandlerError('144', Label.CPQNoItemsToUpdate); public static CpqAppHandlerError NO_ITEMS_TO_DELETE = new CpqAppHandlerError('145', Label.CPQNoItemsToDelete); public static CpqAppHandlerError VALIDATION_ERROR_ADD = new CpqAppHandlerError('146', Label.CPQNoItemsToDelete); public static CpqAppHandlerError NO_ITEMS_TO_CLONE = new CpqAppHandlerError('147', Label.CPQNoItemsToClone); public static CpqAppHandlerError ADD_SUCCESSFUL = new CpqAppHandlerError('150', Label.CPQAddSuccess); public static CpqAppHandlerError UPDATE_SUCCESSFUL = new CpqAppHandlerError('151', Label.CPQUpdateSuccessful); public static CpqAppHandlerError DELETE_SUCCESSFUL = new CpqAppHandlerError('152', Label.CPQDeleteSuccessful); public static CpqAppHandlerError CLONE_SUCCESSFUL = new CpqAppHandlerError('153', Label.CPQCloneSuccessful); // Attribute Errors - 160 public static CpqAppHandlerError NO_ATTRIBUTE_FOUND = new CpqAppHandlerError('160', Label.CPQNoAttributesFilters); public static CpqAppHandlerError ATTRIBUTE_MODIFICATION_SUCCESSFUL = new CpqAppHandlerError('161', Label.CPQAttributesModifySuccess); public static CpqAppHandlerError NO_ATTRIBUTE_MODIFICATION = new CpqAppHandlerError('162', Label.CPQNoAttributesToModify); // Pricing Errors - 180 public static CpqAppHandlerError PRICELIST_INVALID = new CpqAppHandlerError('181', Label.CPQInvalidPriceList); // Other errors - 200 public static CpqAppHandlerError REQUIRED_FIELDS_MISSING = new CpqAppHandlerError('200', Label.CPQReqFieldMissing); public static CpqAppHandlerError INSERT_FAILED = new CpqAppHandlerError('201', Label.CPQInsertFailed); public static CpqAppHandlerError INVALID_OBJECT_TYPE = new CpqAppHandlerError('202', Label.CPQInvalidObjectType); public static CpqAppHandlerError VALUE_MISSING = new CpqAppHandlerError('203', Label.CPQPleaseEnterValue); public static CpqAppHandlerError REQUIRED_ATTR_MISSING = new CpqAppHandlerError('204', Label.CPQAttributeMissing); public static CpqAppHandlerError INVALID_PARAM = new CpqAppHandlerError('205', Label.CPQInvalidParameter); public static CpqAppHandlerError VALIDATION_INFO = new CpqAppHandlerError('206', Label.CPQValidationInfo); public static CpqAppHandlerError VALIDATION_WARN = new CpqAppHandlerError('207', Label.CPQValidationWarning); public static CpqAppHandlerError VALIDATION_ERROR = new CpqAppHandlerError('208', Label.CPQValidationError); // Generic catch all Error messages public static CpqAppHandlerError GENERIC_PRODUCT_SERVICE_EXCEPTION = new CpqAppHandlerError('209', Label.CPQProductServiceException); public static CpqAppHandlerError GENERIC_ITEM_SERVICE_EXCEPTION = new CpqAppHandlerError('210', Label.CPQItemServiceException); public static CpqAppHandlerError GENERIC_PRICING_SERVICE_EXCEPTION = new CpqAppHandlerError('211', Label.CPQPricingServiceException); //Other errors continued public static CpqAppHandlerError CLONE_FAILED = new CpqAppHandlerError('212', Label.CPQCloneFailed); public static CpqAppHandlerError UPDATE_FAILED = new CpqAppHandlerError('213', Label.CPQUpdateFailed); public static CpqAppHandlerError SUBMIT_FAILED = new CpqAppHandlerError('214', Label.CPQSubmitFailed); public static CpqAppHandlerError FDO_FAILED = new CpqAppHandlerError('215', Label.CPQFdoFailed); public static CpqAppHandlerError ACCOUNT_INACTIVE = new CpqAppHandlerError('216', Label.CPQAccountInactiveOrExpired); //Bundle Error/Warning messages - 220 public static CpqAppHandlerError BUNDLE_HAS_ERRORS = new CpqAppHandlerError('220', Label.ThisBundleHasErrors); public static CpqAppHandlerError BUNDLE_HAS_WARNINGS = new CpqAppHandlerError('221', Label.ThisBundleHasWarnings); //Promotion Service Errors - 300 public static CpqAppHandlerError GENERIC_PROMOTION_SERVICE_EXCEPTION = new CpqAppHandlerError('310', Label.CPQPromotionServiceException); public static CpqAppHandlerError MULTIPLE_CONTEXT_NODES_DETECTED = new CpqAppHandlerError('320', Label.CPQMultipleNodesDetected); public static CpqAppHandlerError CARDINALITY_EXCEPTION = new CpqAppHandlerError('330', Label.CPQPromotionCardinalityException); public static CpqAppHandlerError PAST_OR_ENDOFLIFE_PRODUCTS_EXCEPTION = new CpqAppHandlerError('340', Label.CPQPastOrEndOfLifeProductException); public static CpqAppHandlerError PROMOTION_PAST_OR_ENDOFLIFE_PRODUCTS_EXCEPTION = new CpqAppHandlerError('340', Label.CPQPromotionPastOrEndOfLifeProductException); //Override Service Errors - 400 public static CpqAppHandlerError CARDINALITY_OVERRIDE_SERVICE_EXCEPTION = new CpqAppHandlerError('410', Label.CPQCardinalityOverrideServiceException); public static CpqAppHandlerError CART_UPGRADE_EXCEPTION = new CpqAppHandlerError('420', Label.CPQCartUpgradeException); public static CpqAppHandlerError GENERIC_PRODUCT_HIERARCHY_EXCEPTION = new CpqAppHandlerError('230', Label.CPQIncorrectProdConfig); public static CpqAppHandlerError RULE_CODE_FAIL_LEVEL_HARD_FAIL = new CpqAppHandlerError('301', Label.CPQRuleConditionHardFail); public static CpqAppHandlerError RULE_CODE_FAIL_LEVEL_SOFT_FAIL = new CpqAppHandlerError('302', Label.CPQRuleConditionSoftFail); public static CpqAppHandlerError RULE_CODE_FAIL_LEVEL_SOFT_PASS = new CpqAppHandlerError('303', Label.CPQRuleConditionSoftPass); public static CpqAppHandlerError CANNOT_CANCEL = new CpqAppHandlerError('304', Label.CannotCancel); public static CpqAppHandlerError CANCEL_SUCCESSFUL = new CpqAppHandlerError('305', Label.CancelSuccessful); public static CpqAppHandlerError CANCEL_FAILED = new CpqAppHandlerError('306', Label.CancelFailed); public static CpqAppHandlerError CANCEL_RETRY = new CpqAppHandlerError('307', Label.CancelRetry); public static CpqAppHandlerError CANCEL_ORDER_INVALID_SUBMIT_STATUS = new CpqAppHandlerError('308', Label.CancelOrderInvalidSubmitStatus); public static CpqAppHandlerError CANCEL_ACCEPTED = new CpqAppHandlerError('309', 'Cancellation is accepted.');//CMT-5552 can not add Custom label in patch. We can fix it in v105 // Discount messages - 500 public static CpqAppHandlerError DISCOUNT_ADD_SUCCESSFUL = new CpqAppHandlerError('510', Label.CPQDiscountAddedSuccess); public static CpqAppHandlerError DISCOUNT_CONFIGURE_SUCCESSFUL = new CpqAppHandlerError('520', Label.CPQDiscountConfigSuccess); public static CpqAppHandlerError DISCOUNT_CLONE_SUCCESSFUL = new CpqAppHandlerError('530', Label.CPQDiscountCloneSuccess); public static CpqAppHandlerError DISCOUNT_DELETE_SUCCESSFUL = new CpqAppHandlerError('540', Label.CPQDiscountDeleteSuccess); public static CpqAppHandlerError DISCOUNT_SUBMIT_SUCCESSFUL = new CpqAppHandlerError('550', Label.CPQDiscountSubmitSuccess); public static CpqAppHandlerError DISCOUNT_ADD_FAIL = new CpqAppHandlerError('560', Label.CPQDiscountAddedFailed); public static CpqAppHandlerError DISCOUNT_CONFIGURE_FAIL = new CpqAppHandlerError('570', Label.CPQDiscountConfigFailed); public static CpqAppHandlerError DISCOUNT_CLONE_FAIL = new CpqAppHandlerError('580', Label.CPQDiscountCloneFailed); public static CpqAppHandlerError DISCOUNT_DELETE_FAIL = new CpqAppHandlerError('590', Label.CPQDiscountDeleteFailed); public static CpqAppHandlerError DISCOUNT_SUBMIT_FAIL = new CpqAppHandlerError('600', Label.CPQDiscountSubmitFailed); public static CpqAppHandlerError DISCOUNT_UNAPPROVED = new CpqAppHandlerError('610', Label.CPQDiscountUnapproved); public static CpqAppHandlerError DISCOUNT_ALREADY_SUBMITTED = new CpqAppHandlerError('620', Label.CPQDiscountAlreadySubmitted); //Offer Migration Plans Errors - 700 public static CpqAppHandlerError GENERIC_OFFER_MIGRATION_PLAN_EXCEPTION = new CpqAppHandlerError('710', Label.CPQOfferMigrationPlanServiceException); public static CpqAppHandlerError CANNOT_REPLACE_SAME_OFFER_EXCEPTION = new CpqAppHandlerError('720', Label.CPQCannotReplaceSameOfferException); public static CpqAppHandlerError NO_REPLACEABLE_OFFER_IN_CART_EXCEPTION = new CpqAppHandlerError('730', Label.CPQNoReplaceableOfferInCart); public static CpqAppHandlerError ALL_DISCONNECTED_COMPONENTS_EXCEPTION = new CpqAppHandlerError('740', Label.CPQAllDisconnectedComponents); //Replace offer service errors - 800 public static CpqAppHandlerError GENERIC_REPLACE_OFFER_SERVICE_EXCEPTION = new CpqAppHandlerError('810', Label.CPQReplaceOfferServiceException); public static CpqAppHandlerError PROMOTION_ITEM_EXCEPTION = new CpqAppHandlerError('820', Label.CPQPromotionItemException); public static CpqAppHandlerError REPLACEMENT_SUCCESSFUL = new CpqAppHandlerError('830', Label.CPQReplaceSuccess); public static CpqAppHandlerError NO_REPLACEMENT_PERFORMED = new CpqAppHandlerError('840', Label.CPQNoReplacementPerformed); //Compare offer service errors - 900 public static CpqAppHandlerError GENERIC_COMPARE_OFFER_SERVICE_EXCEPTION = new CpqAppHandlerError('910', Label.CPQCompareOfferServiceException); public static CpqAppHandlerError TARGET_NOT_FOUND_EXCEPTION = new CpqAppHandlerError('920', Label.CPQCompareTargetNotFoundException); public class CpqAppHandlerError { public String code; public String message; public CpqAppHandlerError(String code, String message) { this.code = code; this.message = message; } } } ``` # CpqAppHandlerHook Troubleshooting Guide Use this guide to troubleshoot the CpqAppHandlerHook if it isn't working properly. ## Attribute-Based Pricing Is the product not displaying the correct price in the cart based on the BillingZipCodeAttributePricingMatrix? Use the troubleshooting headings below to assist in your evaluation. For BillingZipCodeAttributePricingMatrix: - Verify all matrix headers are spelled correctly - Verify all input/output data in the matrix has proper spacing, punctuation and correct spelling - Verify the matrix is enabled and has the highest priority For BillingZipCodeAttributePricingProcedure: - Verify all variables has proper spacing, punctuation and correct spelling - Verify the calculation steps - Matrix lookup is pointing to the BillingZipCodeAttributePricingMatrix - Matrix calculations are pointing to the MRC/NRC BillingZipCodeAttributePricingMatrix outputs - Include in Calculation Output is checked - Procedure is enabled - Verify if the procedure is working using the Simulate button on the Vlocity Procedure page For the custom billing zip code pricing plan step: - Verify all data input is spelled correctly and has proper spacing - Step is active ## Modifying the Cart Is the Billing Zip Code column not displaying in the cart? Use the troubleshooting headings below to assist in your evaluation. For the billing zip code field setting: - API names are spelled correctly with proper punctuation - Correct CPQ API is linked For the Card template: - Fields Input Map includes the Billing Zip Code custom field and is preceded with a comma - Correct custom view State is selected on the card - Loyalty Pricing enabled? Use the CustomView_CPQAdvancedPricingLoyalty state - Loyalty Pricing not enabled? Use the CustomView_CPQAdvancedPricing state - Layout and card are both activated - Verified all the above and the column still isn’t displaying, clear your browser cacheEnd Bookmark for Task Overview TOC. - Start Bookmark for Task Overview TOC # Create a CpqAppHandler Hook You can write custom Pre-invoke and Post-invoke hooks for an interface to implement custom logic. To change the default behavior of a CPQ operation, you create a custom implementation of the CpqAppHandler hook interface, CpqAppHandlerHook. The example used to illustrate the tasks is a customization that prices products in the Industries CPQ Cart based on a customer’s billing zip code. ​Salesforce Industries Communications, Media, and Energy and Energy & Utilities Cloud use the CpqAppHandler hook interface. To create a custom implementation of CpqAppHandlerHook involves multiple tasks. These tasks include setting up a matrix, editing the pricing plan, creating an Apex class, and modifying the Cart. **note:** Pricing Products Based on Zip Code Management has come to Felix with the requirement that they’d like the ability to price products in the Industries CPQ Cart based on a customer’s billing zip code. Felix knows he can price products based on their attributes using attribute-based pricing, but using the customer’s billing zip code has him stumped. Felix scratches his head wondering how this can be accomplished. In Felix’s research, he comes across the topic in software development called a hook. This is the answer to Felix’s dilemma. Using a hook, he can modify the pricing behavior in the cart without changing the underlying programming code. Felix saddles up to the challenge and starts by mapping out the steps required to fulfill management’s request. 1. Review the uses of CpqAppHandlerHook. 2. Review the billing zip code custom field. 3. Create an attribute pricing matrix for billing zip code. 4. Create an attribute pricing procedure for billing zip code. 5. Create a custom pricing plan step for billing zip code. 6. Create a new Apex class. 7. Create the CpqAppHandlerHookImplementation. 8. Add a new column to the cart. 9. Add billing zip code as a custom field in the cart. 10. Test in the cart. 11. Troubleshoot if necessary. **See Also** - [Adding Pre- and Post-Processing Logic](https://help.salesforce.com/s/articleView?id=ind.comms_pre__and_post_processing_logic_for_cpq_apis.htm) - [Pre- and Post-Processing Logic for CPQ APIs](https://developer.salesforce.com/docs/industries/cme/guide/comms-pre__and-post-processing-logic-for-cpq-apis.md) # Create a Custom Pricing Plan Step for the Billing Zip Code In this task, Felix needs to add a pricing plan step to the Default Pricing Plan so that products in the cart are priced according to the Billing Zip Code Attribute Pricing Procedure and Matrix. 1. Navigate to the **Vlocity Product Console**. 2. Next to **Pricing Plan** in the **Pricing** area, click the **search icon** ![](https://developer.salesforce.com/docs/media/image23.png). 3. In the **Search Pricing Plan...** dialog box, press the return or enter key to display the Default Pricing Plan. 4. Click on the **Default Pricing Plan**. 5. Click on the **Pricing Plan Steps** facet. 6. Click **New Item**. 7. Enter the following data in the **General Properties** pane: | Field | Entry | | ------------------- | -------------------------------------------- | | Name | Calculate Billing Zip Code Attribute Pricing | | Implementation Name | CustomPricingPlanStepImpl | | Method Name | GetMatrixPrice | | Sequence | 9 | | Active | (checked) | 8. Click the **Edit** icon ![](https://developer.salesforce.com/docs/media/image40.png) to open the **Parameters** dialog box. 9. Click the + symbol to add the following parameters: | First Box | Second Box | | ------------- | --------------------------------------- | | ProcedureName | BillingZipCodeAttributePricingProcedure | | MatrixName | BillingZipCodeAttributePricingMatrix | | RangeFields | Billing_Zip_Code\_\_c | 10. Click **Done**. 11. Click **Save** in the General Properties pane. See [Create a New Apex Class](https://developer.salesforce.com/docs/industries/cme/guide/comms-create-a-new-apex-class.md). # Create a New Apex Class In this task, Felix needs to create a new Apex class to inject logic for the new custom field – Billing Zip Code. Without this logic the new custom field will not populate. 1. Navigate to the **Setup** icon and select **Developer Console**. 2. From the **Developer Console**, click **File > New > Apex Class**. 3. Name the Apex Class `CpqAppHandlerHookImplementation` and click **OK**. 4. Click [here](https://volt.my.salesforce.com/sfc/p/o0000000IKm8/a/3m0000005upo/e5fxAdKe2n4qwyxNK2u8_0.32vNJ9pPUWfbdVrHGfEc) to download the `CpqAppHandlerHookImplementation.txt` file. 5. Paste the code from that file in the **Enter Apex Code** box. You will have 48 lines of code. ![](https://developer.salesforce.com/docs/media/image90.png) 6. Click **File > Save**. 7. Review line 12. Note the `String customFields` API. 8. Close the Developer Console. See [Create the CpqAppHandlerHook Implementation](https://developer.salesforce.com/docs/industries/cme/guide/comms-create-the-cpqapphandlerhook-implementation.md). # Create an Apex Class As part of overriding the 255-character limitation, you need to create an Apex class. 1. In your org, in **Settings**, click **Setup**. 2. In **Quick Find,** enter `Apex` and click **Apex Classes**. 3. Click **New**. 4. Copy the sample implementation provided above and paste it in the **Apex Class Edit** field. 5. Click **Save**. # Create an Attribute Pricing Matrix for the Billing Zip Code In this task, Felix needs to create an attribute pricing matrix for all US billing zip codes. 1. Using the **Lightning App Launcher** in the upper left, click **Files.** 2. Locate the `BillingZipCodeAttributePricingMatrix v2.csv` file. 3. Click the drop-down menu on the **BillingZipCodeAttributePricingMatrix v2** line and select **Download**. 4. Navigate to the **Vlocity Calculation Matrices** tab. You may need to click the **More** dropdown menu to expand for additional tabs. 5. Click **New**. 6. On the New Vlocity Calculation Matrix dialog box, type `BillingZipCodeAttributePricingMatrix` for the **Calculation Matrix Name** and click **Save**. 7. Click the **Related** tab, select **BillingZipCodeAttributePricingMatrix v1**. 8. On the **Details** tab, under the Table section, click **Upload CSV**. 9. Click **Choose File,** select the downloaded `.csv` file, and click **Upload**. 10. Ensure that seven records were uploaded successfully and click **Close**. 11. **Edit** the **Header Information** with the following: | Name | Header Type | | --------------------- | ----------- | | Source Product Name | **Input** | | Source Product Code | **Input** | | Characteristic Name | **Input** | | Characteristic Value | **Input** | | Billing_Zip_Code\_\_c | **Input** | | MRC | **Output** | | NRC | **Output** | ![Header Information](https://developer.salesforce.com/docs/media/image84.png) 12. Click **Save Data**. 13. Click the **Edit Data** button. Review the seven records uploaded from the `.csv` file. 14. Click the **Edit** button in the BillingZipCodeAttributePricingMatrix v1 header. 15. Select **yesterday’s date** from the calendar icon for the **Start Date / Time Date** field. 16. Check the **Enabled** box and **Save**. See [Create an Attribute Pricing Procedure for the Billing Zip Code](https://developer.salesforce.com/docs/industries/cme/guide/comms-create-an-attribute-pricing-procedure-for-the-billing-zip-code.md). # Create an Attribute Pricing Procedure for the Billing Zip Code In this task, Felix needs to create an attribute pricing procedure so that product pricing is calculated based on the Billing Zip Code attribute pricing matrix. 1. Navigate to the **Vlocity Calculation Procedures** tab. You may need to click the **More** dropdown menu to expand for additional tabs. 2. Click **New**. 3. On the **New Vlocity Calculation Procedure** dialog box, select **Declarative** as the record type and click **Next**. 4. Type `BillingZipCodeAttributePricingProcedure` for the **Calculation Procedure Name** and click **Save**. 5. Click the **Related** tab, select **BillingZipCodeAttributePricingProcedure v1**. 6. In the **Variables and Constants** section of the Pricing Calculation, click **Add Variable**. 7. Enter the following: | Field | Entry | | --------- | ---------------- | | Name | REC_MNTH_STD_PRC | | Data Type | **Currency** | 8. Click **Add Variable** to add the next variable. | Field | Entry | | --------- | ------------ | | Name | OT_STD_PRC | | Data Type | **Currency** | ![](https://developer.salesforce.com/docs/media/image86.png) 9. Scroll to the **Calculation Steps** section of the Pricing Calculation. 10. Click **Add Step**. 11. Select the **Matrix Lookup** radio button. 12. In the **Matrix Name** field, type `Billing`. 13. Select **BillingZipCodeAttributePricingMatrix**. 14. Check the box **Include in Calculation Output**. ![](https://developer.salesforce.com/docs/media/image87.png) 15. Notice the variables added to the Variables and Constants section of the procedure. 16. Click **Add Step** to add another **Calculation Step**. 17. Select the **Calculation** radio button. 18. Type `MRC` in the first box and select **MRC (BillingZipCodeAttributePricingMatrix)**. 19. Type `REC` in the second box and select **REC_MNTH_STD_PRC**. 20. Check the box **Include in Calculation Output**. 21. Click **Add Step** to add another calculation step. 22. Select the **Calculation** radio button. 23. Type `NRC` in the first box and select **NRC (BillingZipCodeAttributePricingMatrix)**. 24. Type `OT` in the second box and select **OT_STD_PRC**. 25. Check the box **Include in Calculation Output**. 26. Click **Save Calculation Procedure**. ![](https://developer.salesforce.com/docs/media/image88.png) 27. Click **OK** to the message that the save was successful. 28. Scroll to the top of the page and click the **Edit** button in the header. 29. Check the **Enabled** box and **Save**. See [Create a Custom Pricing Plan Step for the Billing Zip Code](https://developer.salesforce.com/docs/industries/cme/guide/comms-create-a-custom-pricing-plan-step-for-the-billing-zip-code.md). # Create an Interface Implementation As part of overriding the 255-character limitation, you need to create an interface implementation. 1. In your org, go to the **App Launcher** and click **Interface Implementations**. 2. Click **New**. 3. In **Interface Name**, enter `DCAPIParamsInterface`. **note:** Ensure that you name this interface correctly. When this interface exists, the parameters specified in this iinterface override the default parameters. 4. In **Active Implementation Class**, enter the name of the Apex class that you just created, `DCAPIParamsImplementation`. 5. Click **Save**. 6. Click **Related**. 7. Go to Interface Implementation Detail and click **New**. 8. In **Available Implementation**, enter the name of the Apex class that you just created, `DCAPIParamsImplementation`. 9. Click **Active** to activate this implementation. 10. Click **Default** to set this as the default implementation. 11. Click **Save**. # Create an Order or OrderItem Field Set To update any fields other than the fields in the preceding list, you can create a field set on Orders for Order field updates and OrderProducts for OrderItem field updates. The fieldset name and label should match CartAllowedFieldSet for both Orders and OrderProducts. To create a new field set: 1. Navigate to **Setup** then select either **Orders** or **OrderProducts**, then select **Field Sets**. 2. Add a new fieldset with name and label. For this example, we will use: `CartAllowedFieldSet` 3. Any customer created custom fields are allowed by SF Field Data security, when it is part of CartAllowedFieldSet Field Set. In this example, we are adding `Order Start Date`. 4. Verify the new custom field is present: 1. Use the Create Cart API to create a new basket and save the CartContextKey. 2. Call the Create Cart API again using the CartContextKey and the new fieldset as shown using REST Explorer below: ![Create a New Field Set](https://developer.salesforce.com/docs/media/create_cart_fieldset.png) # Create Basket with BasketAction The Create Basket with BasketAction API provides the ability to create a basket from items that were added by a user during the configure operation. Also see [Post Offer Details with Configuration API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-post-offer-details-with-configuration-api.md). Use this API to create a basket in the following ways depending on the format of the request body: AddWithNoConfig, AddAfterConfig, and AssetToBasket. - returnBasket - This flag indicates whether to return basket information in the AssetToBasket API response. The default value is true, meaning that the AssetToBasket API returns basket information as it did in previous releases, ensuring backward compatibility. If set to false, the Assettobasket API returns only the basket key, and not the complete basket. To use the returnBasket flag, the CacheAPI.SkinnyBasket custom setting must be set to true. - includeAttachments - Use this flag to determine whether the API returns attachments URI or not. The default value is false. If includeAttachment is true, the basket API returns a URI to the attachments. If includeAttachment is false or the isloggedin flag is false, the basket API does not return the attachments. - When basket items are created, added, modified, or deleted, the basket contents effectivity are validated. Starting in CME Spring '22, you can update the usage quantity in Basket Operation: - Pass the usage quantity as “FieldsTobeUpdated“ for the Usage Quantity field. - Pass the Attribute Binding using the respective attribute in the JSON request. ## AddWithNoConfig To add the offer without any configured attribute values, pass the following in the request body of the API call: ```nolang "basketAction":"AddWithNoConfig", "offer":"offer_code" ``` ## AddAfterConfig To add a configured offer, pass the following in the body of the API call: ```nolang "basketAction":"AddAfterConfig" "productConfig":"result_from_Get_Offer_Details_API" ``` ## AssetToBasket To change an asset to a basket, format the body of the API call similar to the following: ```nolang "basketAction":"AssetToBasket" "rootAssetIds":"the root asset Ids" "requestDateTime":"requested_date_time" ``` Use UTC date format for the date-time string: YYYY-MM-DDTHH:MM:SS.SSSZ. Ensure that you specify the requestDateTime parameter using UTC date and time. requestDateTime should be a future date compared to the current local date. A validation check runs to see if requestDateTime is in the future. If not, then it means the date has passed and an error is generated. **Attribute Basket Cache Exclusion** The Fall '20 release includes an Attribute Basket Cache feature. See [Attribute Basket Cache Exclusion](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-attribute-basket-cache-exclusion.md). ## Rules Supported - [Context Eligibility Rules](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-context-eligibility-rules.md) for how known users are supported. - Pricing Interface (see [Attribute-Based Pricing](https://help.salesforce.com/s/articleView?id=ind.comms_attribute_based_pricing.htm)) - Product Validation Interface (see [Context Rules Framework](https://help.salesforce.com/s/articleView?id=ind.comms_context_rules_framework.htm) and [Advanced Rules Framework](https://help.salesforce.com/s/articleView?id=ind.comms_advanced_rules_framework.htm)) - For anonymous users, [Advanced Rules](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-advanced-rules.md) are supported for [Defining Advanced Rules Using Configuration Type](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-defining-advanced-rules-using-configuration-type.md) and [Defining Advanced Rules Using Attribute Configuration Type](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-defining-advanced-rules-using-attribute-configuration-type.md) types only. - For known users, [Advanced Rules](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-advanced-rules.md) are supported for [Defining Advanced Rules Using Configuration Type](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-defining-advanced-rules-using-configuration-type.md) and [Defining Advanced Rules Using Attribute Configuration Type](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-defining-advanced-rules-using-attribute-configuration-type.md) types only. - [Product Relationships](https://help.salesforce.com/s/articleView?id=ind.comms_product_relationships_overview.htm) are supported with filters, for example, product A removes Product B. - [Pricing](https://help.salesforce.com/s/articleView?id=ind.comms_pricing_definition.htm) is supported. However, for pricing, do not use Pricing for Advance Rules. Always use the Custom Pricing Plan, which triggers [Attribute-Based Pricing](https://help.salesforce.com/s/articleView?id=ind.comms_attribute_based_pricing.htm). - Also see [Using Context Rules with Digital Commerce APIs](https://help.salesforce.com/s/articleView?id=ind.comms_using_context_rules_with_digital_commerce_apis.htm) ## Prerequisites - Catalog should have CatalogCode**c populated; spaces are not allowed in CatalogCode**c. - Products should have ProductCode populated; spaces are not allowed in ProductCode. - Promotions should have Code**c populated; spaces are not allowed in Code**c. - Catalog should be present with products and promotions attached to it as records under the CatalogProductRelationship\_\_c object. - The Catalog should be attached to a default price list through the DefaultPriceList**c field on Catalog**c object. - Price list entries should exist for all the products attached to the catalog. - Create a custom setting called [CacheAPIFields](https://help.salesforce.com/s/articleView?id=ind.comms_t_cpq_configuration_settings_reference_148927.htm) with a value of true. CacheAPIFields is not required for CME 103.1.14 and later versions. - Batch jobs for the following should have been run ahead of time, thereby populating the cache: - Context combinations - Offer details - Pricing results **note:** Digital Commerce API operations create pseudo accounts or orders in the background for basic computations related to respective API calls. The pseudo accounts or orders is auto deleted based on the CreateCart interface implementation: - **DefaultCreateCartImplementation:**During Basket API operations, any pseudo account or order deletion is honored by the custom setting **CacheAPI.DeletePseudoRecords**. - **CreateCartFromPoolImplementation:**During Basket API operations, any pseudo account or order deletion is not honored by the custom setting **CacheAPI.DeletePseudoRecords**. ## Parameters and Response For API parameter names and descriptions, see [Digital Commerce REST API](https://developer.salesforce.com/docs/industries/cme/references/dc-rest1?meta=Summary) ## Create Basket API for an Anonymous User Example: Create a new basket and add an offer. ```nolang POST /v3/catalogs/{catalog_code}/basket ``` ```nolang Method: POST API: /services/apexrest/vlocity_cmt/v3/catalogs/{catalog_code}/basket Request Body: {"offer":"iPhone8","basketAction":"AddWithNoConfig"} ``` Example: Add an offer to a previously created basket. In the example, the request body is truncated for clarity. ```nolang Method: POST API: /services/apexrest/vlocity_cmt/v3/catalogs/Mobiles/basket/50ba987c870c64774e24c27787288650 Request Body: {"basketAction":"AddAfterConfig","productConfig":"{\"offerDetails\":{\"Offer\":{\"priceResult\":...} ``` ## Create Basket API for a Known User Example: Add a Product to an Empty Basket. ```nolang /services/apexrest/vlocity_cmt/v3/catalogs/{catalog_code}/basket?context={"accountId":"{account_ID}"}&inloggedin=true ``` ```nolang Method: POST API: /services/apexrest/vlocity_cmt/catalogs/{catalog_code}/basket?context={"accountId":"{account_ID}"&isloggedin=true Request Body: {"offer":"offer_code","basketAction":"AddWithNoConfig"} ``` Example: Add a Product to an Existing Basket. ```nolang Method: POST API: /services/apexrest/vlocity_cmt/catalogs/{catalog_code}/basket/{cart_context_key}?context={"accountId":"{account_ID}"&isloggedin=true Request Body: {"offer":"offer_code","basketAction":"AddWithNoConfig"} ``` Example: Create Basket with AddAfterConfig. The payload for AddAfterConfig is a response of GetOfferDetails API inside 'productConfigNode'. If you have the response of offer details, you can add it for AddAfterConfig as follows: ```nolang { "basketAction":"AddAfterConfig", "productConfig": "offerDetails": } ``` Example: Convert Asset to Basket. The following example shows how to convert an asset to a basket. The example assumes you know the asset ID you wish to convert to a basket, and also the account of the user. Format the request as follows: ```nolang Method: POST API: /services/apexrest/vlocity_cmt/v3/catalogs/{catalog_code}/basket?context={accountId":"{account_ID}"&isloggedin=true Request POST Body: {"rootAssetIds":"xxxxxxxxxxxxxx", "basketAction":"AssetToBasket", "RequestDateTime":"2019-12-22T00:00:00.000Z"} ``` To convert more than one asset, you can specify more than one root asset ID in the body of the API call. Separate asset IDs with a comma: ```nolang {"rootAssetIds":"asset_1","asset_2","asset_3" "basketAction":"AssetToBasket", "RequestDateTime":"2019-12-22T00:00:00.000Z"} ``` Be sure to note the cartContextKey, the lineItemKey, and the bundleContextKey if you intend to change or configure the offer. # Create Cart Create an opportunity, order, or quote based on the header object. ```nolang POST /v2/carts ``` ## Remote Method ```nolang createCart ``` ## REST Handler ```nolang CpqCreateCartActionV2 ``` ## Apex Remote Service ```nolang CpqAppHandler ``` ## Apex Remote Input Maps **note:** Opportunity ```nolang { "methodName": "createCart", "objectType": "Opportunity" "inputFields": [{ "Name": "TestOpportunity" }, { "StageName": "Prospecting" }, { "CloseDate": "3/19/2020" }, { "AccountId": "00141000009erCBAAY" }], "subaction": "createOppty", "fields": "Id,Name,StageName" } ``` **note:** Order ```nolang { "methodName": "createCart", "objectType": "Order", "inputFields": [{ "effectivedate": "12/7/2019" }, { "status": "Draft" }, { "Name": "Telco" }, { "AccountId": "00141000009erCBAAY" }], "subaction": "createOrder", "fields": "Id,Name,EffectiveDate" } ``` **note:** Quote ```nolang { "methodName": "createCart", "objectType": "Quote", "inputFields": [{ "OpportunityId": "6DG678HD234" }, { "Name": "Telco" }, { "AccountId": "00141000009erCBAAY" }], "subaction": "createQuote", "fields": "Id,Name" } ``` ## Package Communication (vlocity_cmt) ## API Parameters and response format For API parameter names and descriptions, see [Industries Configure, Price, Quote Web APIs v2 Documentation](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). By default, you can only create carts for active accounts. If the account is in a status besides active, add this filter to your request: `"filters": "Account.vlocity_cmt__Status__c:Inactive_Active_Pending"`. ## Resource Information | Response Format | JSON | | --------------- | ----------------------------------------- | | Resource URL | `/services/apexrest/{namespace}/v2/carts` | ## Example Requests **note:** Opportunity In this example, the status of the account isn't Active. Therefore, we also specify `"filters": "Account.vlocity_cmt__Status__c:Inactive_Active_Pending"` in the request. ```nolang POST /services/apexrest/vlocity_cmt/v2/carts Body: { "inputFields": [ { "Name": "Headless CPQ Oppty" }, { "StageName": "Prospecting" }, { "CloseDate": "6/19/2020" }, { "AccountId": "0011U00000W6H9p" } ], "filters": "Account.vlocity_cmt__Status__c:Inactive_Active_Pending", "subaction": "createOppty", "fields": "Id,Name,StageName" } ``` **note:** Order ```nolang POST /services/apexrest/vlocity_cmt/v2/carts Body: { "methodName": "createCart", "objectType": "Order", "inputFields": [ { "effectivedate": "12/03/2019" }, { "status": "Draft" }, { "Name": "Headless CPQ Order" }, { "AccountId": "0011U00000W6GvB" } ], "subaction": "createOrder", "fields": "Id,Name,EffectiveDate" } ``` **note:** Quote ```nolang POST /services/apexrest/vlocity_cmt/v2/carts Body: { "methodName": "createCart", "objectType": "Quote", "inputFields": [ { "OpportunityId": "0061U000008fIUK" }, { "Name": "Headless CPQ Quote" } ], "subaction": "createQuote", "fields": "Id,Name" } ``` **note:** Asset to Order ```nolang POST /services/apexrest/vlocity_cmt/v2/carts Body: { "subaction":"assetToOrder", "id":"01t36000000pfcKAAQ,02i6A000000YEXN", "accountId":"0016A0000072D3y", "requestDate":"2019-12-01" } ``` **See Also** - [Create Cart (assetToOrder)](https://developer.salesforce.com/docs/industries/cme/guide/comms-create-cart__assettoorder-.md) # Create Cart Create an opportunity, order, or quote based on the header object. ```nolang POST /v2/carts ``` ## Remote Method ```nolang createCart ``` ## REST Handler ```nolang CpqCreateCartActionV2 ``` ## Apex Remote Service ```nolang CpqAppHandler ``` ## Apex Remote Input Maps **note:** Opportunity ```nolang { "methodName": "createCart", "objectType": "Opportunity" "inputFields": [{ "Name": "TestOpportunity" }, { "StageName": "Prospecting" }, { "CloseDate": "3/19/2020" }, { "AccountId": "00141000009erCBAAY" }], "subaction": "createOppty", "fields": "Id,Name,StageName" } ``` **note:** Order ```nolang { "methodName": "createCart", "objectType": "Order", "inputFields": [{ "effectivedate": "12/7/2019" }, { "status": "Draft" }, { "Name": "Telco" }, { "AccountId": "00141000009erCBAAY" }], "subaction": "createOrder", "fields": "Id,Name,EffectiveDate" } ``` **note:** Quote ```nolang { "methodName": "createCart", "objectType": "Quote", "inputFields": [{ "OpportunityId": "6DG678HD234" }, { "Name": "Telco" }, { "AccountId": "00141000009erCBAAY" }], "subaction": "createQuote", "fields": "Id,Name" } ``` ## Package Communication (vlocity\_\_cmt) ## API Parameters and response format By default, you can only create carts for active accounts. If the account is in a status besides active, add this filter to your request: `"filters": "Account.vlocity_cmt__Status__c:Inactive_Active_Pending"`. ## Resource Information | Response Format | JSON | | --------------- | ----------------------------------------- | | Resource URL | `/services/apexrest/{namespace}/v2/carts` | ## Example Requests **note:** Opportunity In this example, the status of the account isn't Active. Therefore, we also specify `"filters": "Account.vlocity_cmt__Status__c:Inactive_Active_Pending"` in the request. ```nolang POST /services/apexrest/vlocity_cmt/v2/carts Body: { "inputFields": [ { "Name": "Headless CPQ Oppty" }, { "StageName": "Prospecting" }, { "CloseDate": "6/19/2020" }, { "AccountId": "0011U00000W6H9p" } ], "filters": "Account.vlocity_cmt__Status__c:Inactive_Active_Pending", "subaction": "createOppty", "fields": "Id,Name,StageName" } ``` **note:** Order ```nolang POST /services/apexrest/vlocity_cmt/v2/carts Body: { "methodName": "createCart", "objectType": "Order", "inputFields": [ { "effectivedate": "12/03/2019" }, { "status": "Draft" }, { "Name": "Headless CPQ Order" }, { "AccountId": "0011U00000W6GvB" } ], "subaction": "createOrder", "fields": "Id,Name,EffectiveDate" } ``` **note:** Quote ```nolang POST /services/apexrest/vlocity_cmt/v2/carts Body: { "methodName": "createCart", "objectType": "Quote", "inputFields": [ { "OpportunityId": "0061U000008fIUK" }, { "Name": "Headless CPQ Quote" } ], "subaction": "createQuote", "fields": "Id,Name" } ``` **note:** Asset to Order ```nolang POST /services/apexrest/vlocity_cmt/v2/carts Body: { "subaction":"assetToOrder", "id":"01t36000000pfcKAAQ,02i6A000000YEXN", "accountId":"0016A0000072D3y", "requestDate":"2019-12-01" } ``` **See Also** - [Create Cart (assetToOrder)](https://developer.salesforce.com/docs/industries/cme/comms-create-cart__assettoorder-.md) # Create Cart (assetToOrder) Create orders from existing assets by performing move, add, change, and delete (MACD) actions. Use assetToOrder only for Future Dated Orders. **note:** - The inputFields is not supported for AssetToOrder (subaction as assetToOrder). - This API only accepts dates in the format `YYYY-MM-DDTHH:MM:SS.sss.000+0000`. For example, `2023-01-24T11:13:33.000+0000`. ```nolang POST /v2/carts ``` ## Remote Method ```nolang assetToOrder ``` ## REST Handler ```nolang APICreateCartsCpqV2 ``` ## Apex Remote Service ```nolang CpqAppHandler ``` ## Apex Remote Input Map ```nolang { "methodName":"assetToOrder", "id":"02i3O000006PrKSQA0,02i3O000006PrKSQB0", "accountId":"801360000008eNU", "requestDateTime":"2021-10-7" } ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | ----------------------------------------- | | Resource URL | `/services/apexrest/{namespace}/v2/carts` | ## Example Request To raise a Change Order for a specific time and date: ```nolang { "subaction": "assetToOrder", "id": "02i3O000006PrKSQA0", "accountId": "0013O00000N6TEN", "requestDateTime": "2021-11-10 10:24:04" } ``` To raise a Change Order on the current time and date: ```nolang { "methodName":"assetToOrder", "id":"02i3O000006PrKSQA0,02i3O000006PrKSQB0", "accountId":"801360000008eNU", "requestDateTime":"2021-10-7" } ``` ## Example Response ```nolang { "error": "OK", "errorCode": "INVOKE-200", "result": { "actions": "0x6be19049", "data": "0x7988afe5", "messages": "0x1c660bd", "records": "0x37796bf6", "totalSize": 0 } } ``` # Create Cart (assetToOrder) Create orders from existing assets by performing move, add, change, and delete (MACD) actions. Use assetToOrder only for Future Dated Orders. **note:** - The inputFields is not supported for AssetToOrder (subaction as assetToOrder). - This API supports following Date and DateTime formats. - `yyyy-MM-dd` - `yyyy-MM-dd'T'HH:mm:ss.SSS'Z'` - `yyyy-MM-dd'T'HH:mm:ss.SSSZ` - `yyyy-MM-dd'T'HH:mm:ss.SSSX` - `yyyy-MM-dd'T'HH:mm:ssXXX` - `yyyy-MM-dd'T'HH:mm:ss'Z'` - `yyyy-MM-dd HH:mm:ss` - `YYYY-MM-DDTHH:MM:SS.sss.000+0000` Date format example: - `2025-06-01` DateTime format examples: - `2026-01-24T11:13:33.000Z` - `2026-01-24T11:13:33.000+0000` - `2026-06-01T12:34:56.789Z` - `2026-06-01T12:34:56+00:00` - `2026-06-01T12:34:56Z` - `2026-06-01 12:34:56` - Standard Cart APIs parse these ISO date and date-time formats and do not use the running user's Salesforce locale. Classic Cart APIs parse date fields with locale-based `Date.parse()`, so values such as `dd/mm/yyyy` can succeed for day-first locales. Send ISO values (`yyyy-MM-dd` or `yyyy-MM-dd'T'HH:mm:ss'Z'`) so the same payload works when Standard Cart APIs are enabled or disabled. ```nolang POST /v2/carts ``` ## Remote Method ```nolang assetToOrder ``` ## REST Handler ```nolang APICreateCartsCpqV2 ``` ## Apex Remote Service ```nolang CpqAppHandler ``` ## Apex Remote Input Map ```nolang { "methodName":"assetToOrder", "id":"02i3O000006PrKSQA0,02i3O000006PrKSQB0", "accountId":"801360000008eNU", "requestDateTime":"2021-10-07" } ``` ## Apex Sample ```nolang String methodName = 'assetToOrder'; String assetId = '02iS80000040exdIAA'; String accountId = '001du000002PciXAAS'; String requestDateTime = '2025-06-06T07:19:14.174Z'; Map inputMap = new Map(); Map outputMap = new Map(); Map optionsMap = new Map(); inputMap.put('subaction', methodName); inputMap.put('id', assetId); inputMap.put('accountId', accountId); inputMap.put('requestDateTime',requestDateTime); vlocity_cmt.CpqAppHandler cpqAppHandlerService = new vlocity_cmt.CpqAppHandler(); cpqAppHandlerService.invokeMethod(methodName, inputMap, outputMap, optionsMap); ``` ## Package Communication (vlocity\_\_cmt) ## Resource Information Resource URL: `/services/apexrest/{namespace}/v2/carts` Response Format: JSON ## Example Request While performing AssetToOrder we can create Order of specific RecordType by RecordTypeId in the request payload ```nolang { "subaction": "assetToOrder", "id": "02ixx0000004HROAA2", "inputFields": [ { "RecordTypeId": "012xx0000005pgzAAA" } ], "accountId": "001xx000003GfGdAAK", "requestDateTime": "2024-09-30 19:24:04" } ``` To raise a Change Order on the current time and date: ```nolang { "subaction":"assetToOrder", "id":"02i3O000006PrKSQA0,02i3O000006PrKSQB0", "accountId":"801360000008eNU", "requestDateTime":"2021-10-07" } ``` ## Example Response ```nolang { "messages":[], "records":[ { "messages":[], "cartId":"801xx000003GfgxAAC", "displaySequence":-1 } ], "totalSize":0 } ``` # Create Cart from Basket The Create Cart API provides the ability to create a cart after items have been added to a basket. The API provides the ability to convert the basket into a corresponding order and order line item. ```nolang POST /v3/carts ``` First, offers are configured without a cart, then this API is called to add the basket contents to the cart (order and order line items) before submitting. The API creates a new cart. The API will validate and price the cart after adding the items and returns a link to the full cart contents. Beginning with the Summer 2019 release, the CacheAPI.CreateCartFromContextKey configuration setting can be used to determine the behavior of the Create Cart API. If set to true, the Create Cart API uses the cartContextKey passed in the input to create the cart. If set to false or not specified, the JSON result from the Basket API must be passed in the request body of the Create Cart API to create the cart. The API requires the user account, catalog code, and cartItems in the body of the request. You can create multiple carts with a single Create Cart API call. See [Create Cart from Basket](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-create-cart-from-basket.md) for an example. You can batch process multiple carts at one time. See [Create Cart from Basket](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-create-cart-from-basket.md) for an example. You can submit an order when the cart is created. See [Create Cart from Basket](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-create-cart-from-basket.md) for an example. You can pass additional order capture information when creating an order from a basket. See [Create Cart from Basket](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-create-cart-from-basket.md) for an example. ## Rules Supported - [Context Eligibility Rules for Pricing](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-context-eligibility-rules.md) - Pricing Interface (see [pricing plans](https://help.salesforce.com/s/articleView?id=ind.comms_setting_up_attribute_based_pricing_using_pricing_plans.htm), such as [ABP](https://help.salesforce.com/s/articleView?id=ind.comms_attribute_based_pricing.htm)) - [Attribute-Based Pricing](https://help.salesforce.com/s/articleView?id=ind.comms_attribute_based_pricing.htm) - For known users, product validation rules are applied. ## Prerequisites - Run the [Load API Metadata](https://help.salesforce.com/s/articleView?id=ind.comms_load_api_metadata.htm) job (Vlocity CMT Administration > Cacheable API Jobs > Load API Metadata). - Run all of the jobs under the Populate API Cache window. - The [CacheAPIFields](https://help.salesforce.com/s/articleView?id=ind.comms_t_cpq_configuration_settings_reference_148927.htm) custom setting must be set to true for versions prior to CME 103.1.14. - See [Create Cart from Basket](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-create-cart-from-basket.md) for additional recommendations. ## API Parameters and Response Format For API parameter names and descriptions, see [Digital Commerce REST API](https://developer.salesforce.com/docs/industries/cme/references/dc-rest1?meta=Summary). ## Example First, create a basket. To create a basket, first run the Basket API. Then, use the output of the Basket API as input for the Cart API. Be sure to add the catalogCode and accountId parameters. The body should resemble the following (note that JSONResult has been truncated for clarity): ```nolang {"JSONResult" : "{\"totalSize..."productCategories\":{\"totalSize\":0}}]}}]}","catalogCode" : "catalog_code","accountId" : "account_ID"} ``` Now call the API: ```nolang https://{salesforce_domain}/services/apexrest/vlocity_cmt/v3/carts ``` The response includes the order number and order ID. ## Batch Processing Example 1 You can create multiple carts with a single API call by specifying the multipleCartContext parameter in the header. **note:** By default, pricing and basket validation are turned off when using the Create Cart API for bulk processing. ```nolang URL: /services/apexrest/featurehvo/v3/carts?validate=false&price=false&validatebasket=false Header: {"multipleCartContext":[ {"accountId": "0016g000005GhgS", "catalogCode": "Phones", "cartContextKey": "03e2574d420baabe40c2210970afc837", "orderItemFields": [ { "bundleContextKey": "12b2d2fbbd91fab9b62c3689caf7e5a3", "lineItemKey": "12b2d2fbbd91fab9b62c3689caf7e5a3", "Description": "iphone 4" } ],"orderFields": { "Description": "iphone 4"} }, { "accountId": "0016g00000LxUPf", "catalogCode": "Phones", "cartContextKey": "248c981213da8d58650d9c50ca578aff", "orderItemFields": [ { "bundleContextKey": "fcec25cc2013eca9f73db00b35020c29", "lineItemKey": "fcec25cc2013eca9f73db00b35020c29", "Description": "iphone 5"}], "orderFields": {"Description": "iphone 5"} }, {"accountId": "0016g00000LxUPL", "catalogCode": "Phones", "cartContextKey": "4ca6c995e66d71c163f509302566f7d6", "orderItemFields": [ {"bundleContextKey": "d61e242102fb4329e8a6acf273316159", "lineItemKey": "d61e242102fb4329e8a6acf273316159", "Description": "iphone 5s"}], "orderFields": { "Description": "iphone 5s" } } ] } ``` Output: ![Batch Processing output](https://developer.salesforce.com/docs/media/creat4ecart_ex1.png) ## Batch Processing Example 2 You can batch process multiple carts at one time. ```nolang URL: /services/apexrest/featurehvo/v3/carts?validate=false&price=false&validatebasket=false Header {"multipleCartContext":[ {"accountId": "0016g000005GhgS", "catalogCode": "Phones", "cartContextKey": "03e2574d420baabe40c2210970afc837", "orderItemFields": [ {"bundleContextKey": "12b2d2fbbd91fab9b62c3689caf7e5a3", "lineItemKey": "12b2d2fbbd91fab9b62c3689caf7e5a3", "Description": "iphone 4" } ], "orderFields": { "Description": "iphone 4" } }, {"accountId": "0016g00000LxUPf", "catalogCode": "Phones", "cartContextKey": "248c981213da8d58650d9c50ca578aff", "orderItemFields": [ { "bundleContextKey": "fcec25cc2013eca9f73db00b35020c29", "lineItemKey": "fcec25cc2013eca9f73db00b35020c29", "Description": "iphone 5" } ], "orderFields": { "Description": "iphone 5" } }, { "accountId": "0016g00000LxUPL", "catalogCode": "Phones", "cartContextKey": "4ca6c995e66d71c163f509302566f7d6", "orderItemFields": [ { "bundleContextKey": "d61e242102fb4329e8a6acf273316159", "lineItemKey": "d61e242102fb4329e8a6acf273316159", "Description": "iphone 5s" } ], "orderFields": { "Description": "iphone 5s"} }, {"accountId": "0016g00000LxUPa", "catalogCode": "Phones", "cartContextKey": "2a060ccffb639df16448388fb944937c", "orderItemFields": [ { "bundleContextKey": "3d2e9657bb10e96ef663669e5cd9f8e2", "lineItemKey": "3d2e9657bb10e96ef663669e5cd9f8e2", "Description": "iphone 6"}], "orderFields": { "Description": "iphone 6" } }, { "accountId": "0016g00000LyRtK", "catalogCode": "Phones", "cartContextKey": "6eadc50ae768c46cb5a24847918cd84e", "orderItemFields": [ { "bundleContextKey": "90801bc3d3ca1f1211fd7eff9fc576d9", "lineItemKey": "90801bc3d3ca1f1211fd7eff9fc576d9", "Description": "iphone 7" } ],"orderFields": { "Description": "iphone 7" } } ] } ``` Output: ![Batch Processing output](https://developer.salesforce.com/docs/media/createcart_ex2.png) ## Example to Create Cart and Submit Order You can submit an order when the cart is created. **note:** Creating assets using the CreateCart API can only be used with a single Create Cart API call. ```nolang URL: /services/apexrest/featurehvo/v3/carts?createAsset=true Header: {    "accountId": "0014R00002k5vPG",    "catalogCode": "Phones",    "cartContextKey": "1b42e612a401a072324c7ca026bc4e2f" } ``` Output: ![Create Cart and Submit Order output](https://developer.salesforce.com/docs/media/createcart_ex3.png) ## Example Showing Passing Additional Parameters You can pass additional order capture information when creating an order from a basket. After a Basket has been created, and the user is ready to check out, you can pass additional information in the order header and order Line Items. For example, you might want to pass an updated billing address or an external Order Management system ID. ```nolang URL: /services/apexrest/featurehvo/v3/carts Header: {    "accountId": "0016g000005GhgS",    "catalogCode": "Phones",    "cartContextKey": "03e2574d420baabe40c2210970afc837",    "orderItemFields": [        {            "bundleContextKey": "a561caa70bd9e2343a3066ed316bdec8",            "lineItemKey": "a561caa70bd9e2343a3066ed316bdec8",            "Description": "new iphone 4",            "featurehvo__ItemName__c": "iphone4"        }      ], "orderFields": {     "Description": "Apple Products",     "featurehvo__Email__c": "johndoe@gmail.com"    } } ``` Output: ![Example Showing Passing Additional Parameters](https://developer.salesforce.com/docs/media/createcart_ex4.png) To prevent inadvertently updating a field that may invalidate ancillary operations, by default, the Create Cart API is restricted to updating only the following Order and OrderItem fields: Order Item: - Line Description - Description - Item Name - vlocity_cmt**ItemName**c - Billing Account - vlocity_cmt**BillingAccountId**c - Service Account - vlocity_cmt**ServiceAccountId**c - Service Point - vlocity_cmt**ServicePointId**c Order: - Description - Description - Order Name - Name - Order Reference Number - OrderReferenceNumber - Order Type - Type - Delivery Installation Status - vlocity_cmt**Delivery_Installation_Status**c - Email - vlocity_cmt**Email**c - Lead Source - vlocity_cmt**LeadSource**c - Billing Account - vlocity_cmt**DefaultBillingAccountId**c - Service Account - vlocity_cmt**DefaultServiceAccountId**c - Service Point - vlocity_cmt**DefaultServicePointId**c To update any fields other than the fields in the preceding list, you can create a fieldset on Orders for Order field updates and OrderProducts for OrderItem field updates. The fieldset name and label should match CartAllowedFieldSet for both Orders and OrderProducts. By default, the Create Cart API is restricted to updating only the following Quote and QuoteItem fields: Quote: - Description: Description - Quote Name: Name - Lead Source: vlocity_cmt**LeadSource**c - Billing Account: vlocity_cmt**DefaultBillingAccountId**c - Service Account: vlocity_cmt**DefaultServiceAccountId**c - Service Point: vlocity_cmt**DefaultServicePointId**c QuoteItem: - Description: Description - QuoteItem Name: ItemName\_\_c - Billing Account: vlocity_cmt**BillingAccountId**c - Service Account: vlocity_cmt**ServiceAccountId**c - Service Point: vlocity_cmt**ServicePointId**c ## Custom Settings and Query Parameter Recommendations The following settings are recommended to increase performance when using the Create Cart API. These settings are appropriate when creating either single or multiple carts. | Setting | Type | Value | | ----------------------------------- | ----------------------- | ------------------------- | | CachedQueryMode | CPQ Configuration Setup | True | | CacheEnabled | CPQ Configuration Setup | True | | checkContextAuthenticity | query parameter | false | | contextKey | query parameter | contextKey from getOffers | | price | query parameter | false | | returnOrderNumber | query parameter | false | | UseAssetReferenceIdForParentAndRoot | CPQ Configuration Setup | True | | validate | query parameter | false | | validatebasket | query parameter | false | **See Also** - [About Field Sets](https://help.salesforce.com/articleView?id=sf.fields_about_field_sets.htm) # Create Follow-on Order API In CPQ, you can create and submit a follow-on order for Order Management to fulfill. The follow-on order captures changes with respect to the order it is following. The changes can be: - Add a new order item, product, or promotion. - Remove an existing product or promotion. - Modify an order item that was part of the previous order, such as changes to an attribute. - Change an existing product line item, such as configuration, price, adjustments, and promotions. - Modify the order header data. - Disconnect the order item that was added or modified in the original order. A follow-on order is queued until the original order is fulfilled (activated), then automatically submitted. The actual submission of the follow-on order happens through the Apex job that is scheduled from the Queued Orders tab. The createFollowOnOrder API is only invoked for orders, not quotes or opportunities. ## Invocation REST calls for this API are not supported. There are no REST API endpoints for this API. ## Remote Method This method is available through the standard remote endpoint. ## Apex This API is exposed from the CpqAppHandler class. For example: ```nolang Id ordId = '8016g000000L4yG'; String methodName = 'createFollowOnOrder'; Map inputMap = new Map { 'cartId' => ordId }; Map outputMap = new Map(); Map optionsMap = new Map(); CpqAppHandler handler = new CpqAppHandler(); handler.invokeMethod(methodName, inputMap, outputMap, optionsMap); ``` ## Example Request ```nolang { "methodName": "createFollowOnOrder", "cartId": "8016g000000L59EAAS" } ``` ## Example Response ```nolang { "result": { "totalSize": 1, "records": [ { "uiStates": { }, "nameResult": { }, "messages": [ ], "fields": { "followOnOrderId": "8015e000000pLAfAAM", "Id": "8015e000000p0j7AAA" }, "displaySequence": -1, "actions": { } } ], "name": null, "messages": [ ] } } ``` # Create Hooks for MultiServiceAppHandler The Multisite APIs provide an option to write custom pre- and post-hooks for each API to implement custom logic. A pre-hook is run before the actual API runs. A post-hook runs after the actual API runs. 1. Write the custom class to implement the pre and post hook. Example code: ```nolang 1 global with sharing class MSCustomHookImplementation implements vlocity_cmt.VlocityOpenInterface 2 { 3 global Boolean invokeMethod(String methodName, Map input, Map output, Map options) 4 { 5 if( methodName.equalsIgnoreCase('getGroups.PreInvoke')) 6 { 7 getGroups_PreInvoke(methodName, input, output,options); 8 return true; 9 } 10 11 if( methodName.equalsIgnoreCase('getGroups.PostInvoke')) 12 { 13 getGroups_PostInvoke(methodName, input, output,options); 14 return true; 15 } 16 17 return false; 18 } 19 20 private void getGroups_PreInvoke(String methodName, Map input, Map output, Map options) 21 { 22 //This method gets called before getGroups 23 } 24 private void getGroups_PostInvoke(String methodName, Map input, Map output, Map options) 25 { 26 //This method gets called after getGroups 27 } ``` 2. Create the interface implementation. 1. From the App Launcher, click **Interface Implementations**. 2. Click **New**. 3. In the New Interface Implementation dialog, enter the following: - **Interface Name:** MSAppHandlerHookInterface - **Active Implementation Class:** MSCustomHookImplementation (Name of Custom Class) 4. Click **Save**. 3. Create a new Interface Implementation Detail for the interface created above. 1. On the Related tab for your new custom interface implementation, click **New**. 2. In the New Interface Implementation Detail dialog, enter MSCustomHookImplementation for **Available Implementation**. 3. Click **Active** to make this implementation the active implementation. 4. Click **Save**. # Create New Account for Current Site Create a new account for the current site. ```nolang POST /v2/cpq/carts/{cart_ID}/sites ``` ## Remote Method ```nolang newSite ``` ## REST Handler ```nolang APISitesCartsCpqV2 ``` ## Apex Remote Service ```nolang CpqAppHandler ``` ## Apex Remote Input Map ```nolang { "methodName": "newSite", "cartId": "801360000008eNU", "objectType":"Account" "inputFields":[{"value":"Test1234","fieldName":"name"}], "fields":"Name,vlocity_cmt__Active__c" } ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | ----------------------------------------------------------- | | Resource URL | /services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/sites | ## Example Request ```nolang POST { "objectType": "Account", "inputFields": [{ "value": "Test1234", "fieldName": "name" }], "fields": "Name,vlocity_cmt__Active__c" } ``` ## Example Response ```nolang { "totalSize" => 1, "messages" => [], "records" => [{ "messages" => [], "displaySequence" => -1, "Name" => "Test1234" }] } ``` # Create Picklist Items Create picklist items in Vlocity Product Console by specifying them in the request body. ```nolang POST /v2/epc/picklists/{picklist_ID}/items ``` ## Remote Method ```nolang createPicklistValue ``` ## REST Handler ```nolang APIPicklistItemRestHandler ``` ## Apex Remote Service ```nolang PCAppHandler ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see the [Swagger (OpenAPI) reference documentation for Industries EPC REST APIs](https://developer.salesforce.com/docs/industries/cme/references/epc?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | --------------------------------------------------------------------- | | Resource URL | `/services/apexrest/{namespace}/v2/epc/picklists/{picklist_ID}/items` | ## Example Request ```nolang POST /v2/epc/picklists/a313h000000rqfbAAA/items { "epcRequest": { "entity": { "vlocity_cmt__TextValue__c": "Bangalore", "Name": "Bangalore", "vlocity_cmt__Code__c": "Bangalore", "vlocity_cmt__Abbreviation__c": "Bangalore", "vlocity_cmt__Sequence__c": 1, "vlocity_cmt__IsActive__c": true, "vlocity_cmt__PicklistId__c": "a2u4T000003xGYQQA2" } } } ``` ## Example Result ``` { "epcResponse": { "entities": [ { "entity": { "attributes": { "type": "vlocity_cmt__Picklist__c", "url": "/services/data/v52.0/sobjects/vlocity_cmt__Picklist__c/a313h000000rqfbAAA" }, "Id": "a313h000000rqfbAAA", "OwnerId": "0053h000002UGCUAA4", "IsDeleted": false, "Name": "Bangalore", "CurrencyIsoCode": "USD", "CreatedDate": "2021-09-02T10:05:16.000+0000", "CreatedById": "0053h000002UGCUAA4", "LastModifiedDate": "2021-09-02T10:05:16.000+0000", "LastModifiedById": "0053h000002UGCUAA4", "SystemModstamp": "2021-09-02T10:05:16.000+0000", "LastViewedDate": "2021-09-02T10:05:16.000+0000", "LastReferencedDate": "2021-09-02T10:05:16.000+0000", "vlocity_cmt__DataType__c": "Text", "vlocity_cmt__GlobalGroupKey__c": "51af4c1a-995f-2fff-c25d-c6badf1ebd63", "vlocity_cmt__GlobalKey__c": "6f776181-87c4-517e-ba72-5bc8e7b985fc", "vlocity_cmt__IsActive__c": true, "vlocity_cmt__IsShared__c": false, "vlocity_cmt__LifecycleStatus__c": "Draft" } } ], "overallResult": "success" } } ``` # Create Picklists Create picklists in Vlocity Product Console by specifying them in the request body. ```nolang POST /v2/epc/picklists ``` ## Remote Method ```nolang createPicklist ``` ## REST Handler ```nolang APIPicklistRestHandler ``` ## Apex Remote Service ```nolang PCAppHandler ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see the [Swagger (OpenAPI) reference documentation for Industries EPC REST APIs](https://developer.salesforce.com/docs/industries/cme/references/epc?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | ------------------------------------------------- | | Resource URL | `/services/apexrest/{namespace}/v2/epc/picklists` | ## Example Request ```nolang POST /v2/epc/picklists { "epcRequest": { "entity": { "Name": "Picklist-Example", "vlocity_cmt__Code__c": "Picklist-Example", "vlocity_cmt__VersionLabel__c": "Version-1", "vlocity_cmt__DataType__c": "Text", "vlocity_cmt__LifecycleStatus__c": "Draft", "vlocity_cmt__IsActive__c": true } } } ``` ## Example Result ``` { "epcResponse": { "entities": [ { "entity": { "attributes": { "type": "vlocity_cmt__Picklist__c", "url": "/services/data/v52.0/sobjects/vlocity_cmt__Picklist__c/a313h000000rqfRAAQ" }, "Id": "a313h000000rqfRAAQ", "OwnerId": "0053h000002UGCUAA4", "IsDeleted": false, "Name": "Picklist-Example", "CurrencyIsoCode": "USD", "CreatedDate": "2021-09-02T07:37:46.000+0000", "CreatedById": "0053h000002UGCUAA4", "LastModifiedDate": "2021-09-02T07:37:46.000+0000", "LastModifiedById": "0053h000002UGCUAA4", "SystemModstamp": "2021-09-02T07:37:46.000+0000", "LastViewedDate": "2021-09-02T07:37:46.000+0000", "LastReferencedDate": "2021-09-02T07:37:46.000+0000", "vlocity_cmt__Code__c": "Picklist-Example", "vlocity_cmt__DataType__c": "Text", "vlocity_cmt__GlobalGroupKey__c": "66b60d23-8a58-397e-30fb-f1b0fe85ad92", "vlocity_cmt__GlobalKey__c": "cdbe7a6f-0cb8-b239-43a4-a13780fdf702", "vlocity_cmt__IsActive__c": true, "vlocity_cmt__IsShared__c": false, "vlocity_cmt__LifecycleStatus__c": "Draft", "vlocity_cmt__VersionLabel__c": "Version-1" } } ], "overallResult": "success" } } ``` # Create Product Child Items Product child items (PCIs) are products associated with a bundle of products or services. A product can have one or more PCIs. Add PCIs using the `productchilditems` API call. Ensure that product and their child products are in the same price list. ```nolang POST /v2/epc/productchilditems ``` ## Remote Method ```nolang createPCI ``` ## REST Handler ```nolang APIProductChildItemRestHandler ``` ## Apex Remote Service ```nolang PCAppHandler ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see the [Swagger (OpenAPI) reference documentation for Industries EPC REST APIs](https://developer.salesforce.com/docs/industries/cme/references/epc?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | --------------------------------------------------------- | | Resource URL | `/services/apexrest/{namespace}/v2/epc/productchilditems` | ## Example Request ```nolang POST /v2/epc/productchilditems { "epcRequest": { "entity": { "vlocity_cmt__ParentProductId__c": "01t3h000002TDJQAA4", "vlocity_cmt__ChildProductId__c": "01t3h000002Stj3AAC", "vlocity_cmt__RelationshipType__c": "Child", "vlocity_cmt__ChildLineNumber__c": "1" } } } ``` ## Example Result ``` { "epcResponse": { "entities": [ { "entity": { "attributes": { "type": "vlocity_cmt__ProductChildItem__c", "url": "/services/data/v53.0/sobjects/vlocity_cmt__ProductChildItem__c/a3C3h000000Je8oEAC" }, "Id": "a3C3h000000Je8oEAC" } } ], "overallResult": "success" } } ``` # Create Product Objects Create products in Vlocity Product Console by specifying them in the request body. ```nolang POST /v2/epc/products ``` ## Remote Method ```nolang createProduct2 ``` ## REST Handler ```nolang APIProductRestHandler ``` ## Apex Remote Service ```nolang PCAppHandler ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see the [Swagger (OpenAPI) reference documentation for Industries EPC REST APIs](https://developer.salesforce.com/docs/industries/cme/references/epc?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | ------------------------------------------------ | | Resource URL | `/services/apexrest/{namespace}/v2/epc/products` | ## Example Request ```nolang POST { "epcRequest": { "entity": { "vlocity_cmt__LifecycleStatus__c": "Draft", "Name": "Product-0004", "ProductCode": "Product-0004", "Description": "Product-0004", "vlocity_cmt__SpecificationType__c": "Offer", "vlocity_cmt__SpecificationSubType__c": "Bundle", "vlocity_cmt__Status__c": "Draft", "vlocity_cmt__IsOrderable__c": true, "vlocity_cmt__VersionLabel__c": "Version-1", "IsActive": true, "vlocity_cmt__EndOfLifeDate__c": 1769797800000 } } } ``` ## Example Result ``` { "epcResponse": { "entities": [ { "entity": { "attributes": { "type": "Product2", "url": "/services/data/v52.0/sobjects/Product2/01t3h000001gyCFAAY" }, "vlocity_cmt__VersionLabel__c": "Version-1", "Name": "Product-0004", "ProductCode": "Product-0004", "vlocity_cmt__SpecificationType__c": "Offer", "vlocity_cmt__SpecificationSubType__c": "Bundle", "vlocity_cmt__LifecycleStatus__c": "Draft", "vlocity_cmt__GlobalGroupKey__c": "a4096cc5-8bbb-cfd5-7b93-869a7c2b4caf", "RecordTypeId": "0123h000000slEnAAI", "Id": "01t3h000001gyCFAAY", "RecordType": { "attributes": { "type": "RecordType", "url": "/services/data/v52.0/sobjects/RecordType/0123h000000slEnAAI" }, "Id": "0123h000000slEnAAI", "Name": "Product" } } } ], "overallResult": "success" } } ``` # Create Products and a Catalog Before you can use the Populate Cache APIs, product offerings and a sales catalog must exist in your org. 1. Use the Product Designer to create product offerings. See [Create Offerings in the Product Designer](https://help.salesforce.com/s/articleView?id=ind.comms_create_offerings_in_the_product_designer.htm&type=5). 2. Create a sales catalog for the product offerings. See [Create Sales Catalogs](https://help.salesforce.com/s/articleView?id=ind.comms_create_sales_catalogs.htm&type=5). [Download the Postman Environment and Collection Files](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-download-the-postman-environment-and-collection-files.md) # Create Promotion Items Create promotion items in Vlocity Product Console by specifying them in the request body. ```nolang POST /v2/epc/promotions/items ``` ## Remote Method ```nolang addPromotionItem ``` ## REST Handler ```nolang APIPromotionItemRestHandler ``` ## Apex Remote Service ```nolang PCAppHandler ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see the [Swagger (OpenAPI) reference documentation for Industries EPC REST APIs](https://developer.salesforce.com/docs/industries/cme/references/epc?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | -------------------------------------------------------- | | Resource URL | `/services/apexrest/{namespace}/v2/epc/promotions/items` | ## Example Request ```nolang POST v2/epc/promotions/items { "epcRequest": { "entity": { "vlocity_cmt__PromotionId__c": "a3K3h0000006Aj3EAE", "vlocity_cmt__Description__c": "", "vlocity_cmt__ProductId__c": "01t3h000002TMciAAG", "vlocity_cmt__IsActive__c": true, "vlocity_cmt__ActionType__c": "Add", "vlocity_cmt__MaxQuantity__c": 10, "vlocity_cmt__MinQuantity__c": 1, "vlocity_cmt__Quantity__c": 1, "vlocity_cmt__UpdateScope__c": "Update Item Only", "vlocity_cmt__ContextProductId__c": "" } } } ``` ## Example Result ``` { "epcResponse": { "entities": [ { "entity": { "attributes": { "type": "vlocity_cmt__PromotionItem__c", "url": "/services/data/v52.0/sobjects/vlocity_cmt__PromotionItem__c/a3J3h000000I4KKEA0" }, "Id": "a3J3h000000I4KKEA0", "IsDeleted": false, "Name": "a3J3h000000I4KK", "CurrencyIsoCode": "USD", "CreatedDate": "2021-09-07T06:36:09.000+0000", "CreatedById": "0053h000002UGCUAA4", "LastModifiedDate": "2021-09-07T06:36:09.000+0000", "LastModifiedById": "0053h000002UGCUAA4", "SystemModstamp": "2021-09-07T06:36:09.000+0000", "vlocity_cmt__PromotionId__c": "a3K3h0000006Aj3EAE", "vlocity_cmt__ActionType__c": "Add", "vlocity_cmt__IsActive__c": true, "vlocity_cmt__IsUndoable__c": false, "vlocity_cmt__MaxQuantity__c": 10.00, "vlocity_cmt__MinQuantity__c": 1.00, "vlocity_cmt__ProductHierarchyGlobalKeyPath__c": "20b3380d-5c42-f7db-4508-beff916feee1", "vlocity_cmt__ProductHierarchyGroupKeyPath__c": "f4a0d9e2-d6cd-59f8-8c20-c14298a2f4f2", "vlocity_cmt__ProductHierarchyPath__c": "01t3h000002TMciAAG", "vlocity_cmt__ProductId__c": "01t3h000002TMciAAG", "vlocity_cmt__Quantity__c": 1.00, "vlocity_cmt__UpdateScope__c": "Update Item Only", "vlocity_cmt__GlobalGroupKey__c": "4c1abba7-2ab2-872a-26dc-93bfba985894", "vlocity_cmt__ProductId__r": { "attributes": { "type": "Product2", "url": "/services/data/v52.0/sobjects/Product2/01t3h000002TMciAAG" }, "Id": "01t3h000002TMciAAG", "Name": "India V1.1", "ProductCode": "India V1.1", "vlocity_cmt__VersionLabel__c": "Version - V1.1" }, "vlocity_cmt__PromotionId__r": { "attributes": { "type": "vlocity_cmt__Promotion__c", "url": "/services/data/v52.0/sobjects/vlocity_cmt__Promotion__c/a3K3h0000006Aj3EAE" }, "Id": "a3K3h0000006Aj3EAE", "Name": "Promotion-Example", "vlocity_cmt__PriceListId__c": "a343h000001ACXFAA4", "vlocity_cmt__PriceListId__r": { "attributes": { "type": "vlocity_cmt__PriceList__c", "url": "/services/data/v52.0/sobjects/vlocity_cmt__PriceList__c/a343h000001ACXFAA4" }, "Id": "a343h000001ACXFAA4", "Name": "ShamPriceList" } } } } ], "overallResult": "success" } } ``` # Create Promotions Create promotions in Vlocity Product Console by specifying them in the request body. ```nolang POST /v2/epc/promotions ``` ## Remote Method ```nolang addPromotion ``` ## REST Handler ```nolang APIPromotionRestHandler ``` ## Apex Remote Service ```nolang PCAppHandler ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see the [Swagger (OpenAPI) reference documentation for Industries EPC REST APIs](https://developer.salesforce.com/docs/industries/cme/references/epc?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | ------------------------------------------------ | | Resource URL | /services/apexrest/{namespace}/v2/epc/promotions | ## Example Request ```nolang POST /v2/epc/promotions { "epcRequest": { "entity": { "Name": "Promotion-Example", "vlocity_cmt__PriceListId__c": "a343h000001ACXFAA4", "vlocity_cmt__Code__c": "Promotion-Example", "vlocity_cmt__Description__c": "Promotion-Example", "vlocity_cmt__IsOrderable__c": true, "vlocity_cmt__EnableAutoAddProducts__c": false, "vlocity_cmt__IsActive__c": true } } } ``` ## Example Result ``` { "epcResponse": { "entities": [ { "numberOfProduct": 0, "entity": { "attributes": { "type": "vlocity_cmt__Promotion__c", "url": "/services/data/v52.0/sobjects/vlocity_cmt__Promotion__c/a3K3h0000006AiyEAE" }, "Id": "a3K3h0000006AiyEAE", "OwnerId": "0053h000002UGCUAA4", "IsDeleted": false, "Name": "Promotion-Example", "CurrencyIsoCode": "USD", "RecordTypeId": "0123h000000slErAAI", "CreatedDate": "2021-09-07T05:50:02.000+0000", "CreatedById": "0053h000002UGCUAA4", "LastModifiedDate": "2021-09-07T05:50:02.000+0000", "LastModifiedById": "0053h000002UGCUAA4", "SystemModstamp": "2021-09-07T05:50:02.000+0000", "LastViewedDate": "2021-09-07T05:50:02.000+0000", "LastReferencedDate": "2021-09-07T05:50:02.000+0000", "vlocity_cmt__AppliesToAllItems__c": false, "vlocity_cmt__CannotBeCombined__c": false, "vlocity_cmt__Code__c": "Promotion-Example", "vlocity_cmt__Description__c": "Promotion-Example", "vlocity_cmt__DurationUnitOfMeasure__c": "Month", "vlocity_cmt__EnableAutoAddProducts__c": false, "vlocity_cmt__EnableAutoApplyPromotion__c": true, "vlocity_cmt__GlobalKey__c": "a74dff32-15da-f94a-9769-d58c6685d0cb", "vlocity_cmt__IsActive__c": true, "vlocity_cmt__IsLimitedQuantity__c": true, "vlocity_cmt__IsOrderable__c": true, "vlocity_cmt__PriceListId__c": "a343h000001ACXFAA4", "vlocity_cmt__ServiceContinuation__c": "Not Applicable", "vlocity_cmt__PriceListId__r": { "attributes": { "type": "vlocity_cmt__PriceList__c", "url": "/services/data/v52.0/sobjects/vlocity_cmt__PriceList__c/a343h000001ACXFAA4" }, "Id": "a343h000001ACXFAA4", "Name": "TestPriceList" } } } ], "overallResult": "success" } } ``` # Create String Translations Add translations for strings. ```nolang POST /v2/stringtranslations/ ``` ## Apex Remote Service Handles the API request and finds the implementation for the request. ```nolang APIHandler ``` ## Remote Method ```nolang createStringTranslations ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Example POST Body ```nolang [ { "vlocity_cmt_promotion__Translation__c": "addon-child2-24540_fr", "vlocity_cmt_promotion__StringId__c": "a4E41000000TqVy", "vlocity_cmt_promotion__LocaleCode__c": "fr" }, { "vlocity_cmt_promotion__Translation__c": "addon-child2-24540_de", "vlocity_cmt_promotion__StringId__c": "a4E41000000TqVy", "vlocity_cmt_promotion__LocaleCode__c": "de" } ] ``` ## Example Response ```nolang { "totalSize": 0, "messages": [{ "code": "904", "severity": "INFO", "message": "Saved successfully." }] } ``` # Create Supplemental Order For CME Winter '20 and later releases, a supplemental order can be created to amend or cancel the previous order. For releases prior to CME Winter '20, any supplemental order is treated as an order cancellation. See [In-Flight Order Cancellation](https://help.salesforce.com/s/articleView?id=ind.comms_cancel_an_in_flight_order.htm&type=5). ```nolang POST /v2/cpq/carts/{order_ID}/cancel ``` 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 ```nolang createSupplementalOrder ``` ## Apex Method Use this CpqAppHandler method with the following inputs to create a supplemental order for an order that is already in a frozen state. - currentOrdId: The ID of the current order - intentForSupplement: A string indicating the reason for creating the supplemental order, which can be `Cancel` (the default) or `Amend`. If the intent is not specified, `Cancel` is used. ```nolang public static Id createSupplementalOrder(Id currentOrdId, String intentForSupplement) { final String methodName = 'createSupplementalOrder'; Map inputMap = new Map { 'cartId' => currentOrdId, 'intent' => intentForSupplement, 'methodName' => methodName }; Map outputMap = new Map(); Map optionsMap = new Map(); vlocity_cmt.CpqAppHandler handler = new vlocity_cmt.CpqAppHandler(); handler.invokeMethod(methodName, inputMap, outputMap, optionsMap); // traverse the result that was returned, to find the supplemental order id. vlocity_cmt.JSONResult result = (vlocity_cmt.JSONResult) outputMap.get('result'); vlocity_cmt.JSONRecord record = result.records[0]; Id supplementalOrderId = (Id) record.fields.get('supplementalOrderId'); return supplementalOrderId; } ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | --------------------------------------------------------------- | | Resource URL | `/services/apexrest/{namespace}/v2/cpq/carts/{order_ID}/cancel` | ## Example Request ```nolang POST /services/apexrest/v2/cpq/carts/{order_ID}/cancel ``` ## Example Request Body ```nolang { "cartId": "order_ID", "subaction": "createSupplementalOrder", "intent": "Amend" } ``` ## Message Codes | Code | Description | | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | SUPPLEMENT-1101 | The createSupplementalOrder API accepts the intent parameter and its valid values: `Amend` and `Cancel` (the default). If no value is passed, it is defaulted to `Cancel`. If an invalid value is passed, this error code is returned. | | SUPPLEMENT-1102 | An internal error occurred during the createSupplementalOrder API call. | | SUPPLEMENT-1103 | When the createSupplementalOrder API is invoked on an original order and the IsChangesAllowed flag is set to false, this code is returned. | | SUPPLEMENT-1104 | When the createSupplementalOrder API is invoked on an order that is in a state other than In Progress, this error code is returned. | | SUPPLEMENT-1105 | When the createSupplementalOrder API is invoked on an order that requires pricing and pricing implementation errors out, then this code is returned. | | SUPPLEMENT-1106 | When the createSupplementalOrder API is invoked on an original order that already has a supplemental order, this code is returned. | **See Also** - [Cancel Order](https://developer.salesforce.com/docs/industries/cme/guide/comms-cancel-order.md) # Create the CpqAppHandlerHook Implementation In this task, Felix needs to create the interface implementation hook. The hook interface provides a hook to the implementation method for pre-invoke and post-invoke handling. 1. Navigate to the **Interface Implementations** tab in the Industries CPQ app. 2. Click **New**. 3. In the **Interface Name** field, type `CpqAppHandlerHook`. **note:** The maximum length for a hook interface name is 36 characters. 4. In the Active Implementation Class field, type `CpqAppHandlerHookImplementation`. ![](https://developer.salesforce.com/docs/media/image91.png) 5. Click **Save**. 6. From the Related tab, click **New** next to **Interface Implementation Detail (0)**. 7. In the New Interface Implementation Detail window, type `CpqAppHandlerHookImplementation` in the **Available Implementation** field. 8. Check the **Active** and **Default** box and **Save**. ![](https://developer.salesforce.com/docs/media/image92.png) See [Add a New Column to Industries CPQ Cart](https://developer.salesforce.com/docs/industries/cme/guide/comms-add-a-new-column-to-industries-cpq-cart.md). # Create Versions of Picklists Create versions of picklists in Vlocity Product Console by specifying the ID of the picklist and the version label in the request body. ```nolang POST /v2/epc/picklists/{picklist-ID}/versions ``` ## Remote Method ```nolang createVersionPicklist ``` ## REST Handler ```nolang APIPicklistVersionRestHandler ``` ## Apex Remote Service ```nolang PCAppHandler ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see the [Swagger (OpenAPI) reference documentation for Industries EPC REST APIs](https://developer.salesforce.com/docs/industries/cme/references/epc?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | ----------------------------------------------------------------------- | | Resource URL | /services/apexrest/{namespace}/v2/epc/picklists/{picklists-ID}/versions | ## Example Request ```nolang POST /v2/epc/picklists/01t3h00000214uLAAQ/versions { "epcRequest": { "entity": { "Id": "a313h000000rtuJAAQ", "vlocity_cmt__VersionLabel__c": "Version-2" } } } ``` ## Example Result ``` { "epcResponse": { "entities": [ { "entity": { "attributes": { "type": "vlocity_cmt__Picklist__c", "url": "/services/data/v53.0/sobjects/vlocity_cmt__Picklist__c/a313h000000rtuOAAQ" }, "CurrencyIsoCode": "USD", "IsDeleted": false, "LastReferencedDate": "2021-11-12T10:32:15.000+0000", "LastViewedDate": "2021-11-12T10:32:15.000+0000", "Name": "Picklist-Example-02", "OwnerId": "0053h000002UGCUAA4", "SystemModstamp": "2021-11-12T10:32:15.000+0000", "vlocity_cmt__Code__c": "Picklist-Example-02", "vlocity_cmt__DataType__c": "Text", "vlocity_cmt__GlobalGroupKey__c": "090c692b-e78a-d460-2786-f423ff08af94", "vlocity_cmt__GlobalKey__c": "969fcdfc-c2d5-dabd-93b3-bd82194b435b", "vlocity_cmt__IsActive__c": true, "vlocity_cmt__IsShared__c": false, "vlocity_cmt__LifecycleStatus__c": "Draft", "vlocity_cmt__VersionLabel__c": "Version-2", "Id": "a313h000000rtuOAAQ" } } ], "overallResult": "success" } } ``` # Create Versions of Products Create versions of products in Vlocity Product Console by specifying the ID of the product and the version label in the request body. ```nolang POST /v2/epc/products/{product-ID}/versions ``` ## Remote Method ```nolang createVersionProduct2 ``` ## REST Handler ```nolang APIProductVersionRestHandler ``` ## Apex Remote Service ```nolang PCAppHandler ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see the [Swagger (OpenAPI) reference documentation for Industries EPC REST APIs](https://developer.salesforce.com/docs/industries/cme/references/epc?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | ---------------------------------------------------------------------- | | Resource URL | `/services/apexrest/{namespace}/v2/epc/products/{product-ID}/versions` | ## Example Request ```nolang POST /v2/epc/products/01t3h00000214uLAAQ/versions { "epcRequest": { "entity": { "Id" : "01t3h00000214uLAAQ", "vlocity_cmt__VersionLabel__c": "Version-2" } } } ``` ## Example Result ``` { "epcResponse": { "entities": [ { "entity": { "attributes": { "type": "Product2", "url": "/services/data/v52.0/sobjects/Product2/01t3h000001h1v2AAA" }, "CanUseQuantitySchedule": false, "CanUseRevenueSchedule": false, "CurrencyIsoCode": "USD", "Description": "Product created by Ashish to test Update", "IsActive": true, "IsArchived": false, "IsDeleted": false, "Name": "Product-Ashish", "ProductCode": "Product-Ashish", "RecordTypeId": "0123h000000slEnAAI", "SystemModstamp": "2021-09-14T07:39:48.000+0000", "vlocity_cmt__EndDate__c": "2026-01-31", "vlocity_cmt__EndOfLifeDate__c": "2026-01-30T18:30:00.000+0000", "vlocity_cmt__GlobalGroupKey__c": "a4096cc5-8bbb-cfd5-7b93-869a7c2b4caf", "vlocity_cmt__GlobalKey__c": null, "vlocity_cmt__IsConfigurable__c": false, "vlocity_cmt__IsCustomerSubscription__c": false, "vlocity_cmt__IsLocationDependent__c": false, "vlocity_cmt__IsNotAssetizable__c": false, "vlocity_cmt__IsOrderable__c": true, "vlocity_cmt__JeopardySafetyIntervalUnit__c": "Seconds", "vlocity_cmt__LifecycleStatus__c": "Draft", "vlocity_cmt__Scope__c": "Order Item", "vlocity_cmt__SellingEndDate__c": "2026-01-30T18:30:00.000+0000", "vlocity_cmt__SpecificationSubType__c": "Bundle", "vlocity_cmt__SpecificationType__c": "Offer", "vlocity_cmt__Status__c": "Draft", "vlocity_cmt__SubType__c": "None", "vlocity_cmt__TrackAsAgreement__c": false, "vlocity_cmt__Type__c": "None", "vlocity_cmt__VersionLabel__c": "Version-2", "vlocity_cmt__VersionStartDateTime__c": null, "vlocity_cmt__VersionEndDateTime__c": null, "Id": "01t3h00000214uLAAQ" } } ], "overallResult": "success" } } ``` # createNewGroup Method Creates a new (Quote or Order)-group with or without the corresponding Group Quote or Group Order record. ## Class ## Input Parameters | Parameter | Required | Description | | ------------------------- | ---------------------------------- | ------------------------------------------------------------------- | | parentId | Required | Opportunity ID. | | contextId | Required | Parent cart Id (Master/Enterprise Quote/Order Id) | | groupName | Required | Name for the group. | | groupDescription | Optional | Description of the group. | | cartType | Optional: Defaults to Quote | Quote or Order. | | memberType | Optional: Defaults to ServicePoint | CPQ Group Member Type Name. For example: ServicePoint. | | isGroupAssociatedWithCart | Optional: Defaults to true | True value will create the corresponding Group-Cart record as well. | ## Output Parameters | Parameter | Description | | --------- | --------------------------------------------------------------------------------------------------------------------------- | | groupId | Group ID of the created record. | | groupInfo | All details related to a group. This contains groupCart, parentId, contextId, groupCartId, and groupName. See sample output | | message | In case of any error. | ## Example Input Data ``` {"groupName":"South Group","groupDescription":"All south region","parentId":"0060b00000vGbYbAAK","contextId":"0Q00b000000znTYCAY","memberType":"ServicePoint","isGroupAssociatedWithCart":true,"cartType":"Quote"}"parentId":"0060b00000vGbYbAAK","contextId":"0Q00b000000znTYCAY","pageSize":20,"offset":0,"memberType":"ServicePoint","cartType":"Quote"} ``` ## Example Output Data ``` {"groupInfo":{"groupCart":{"attributes":{"type":"Quote","url":"/services/data/v49.0/sobjects/Quote/0Q00b000000znU2CAI"},"Name":"South Group","OpportunityId":"0060b00000vGbYbAAK","RecordTypeId":"0120b000000hxEhAAI","Pricebook2Id":null,"h_cpq_ecomm__PriceListId__c":null,"h_cpq_ecomm__DefaultServiceAccountId__c":"0010b00002ccljKAAQ","h_cpq_ecomm__DefaultBillingAccountId__c":"0010b00002ccljKAAQ","h_cpq_ecomm__ParentQuoteId__c":"0Q00b000000znTYCAY","h_cpq_ecomm__NumberOfContractedMonths__c":null,"Status":"Draft","Id":"0Q00b000000znU2CAI","h_cpq_ecomm__QuoteGroupId__c":"a4M0b000002CWMaEAO"},"groupCartURL":"apex/h_cpq_ecomm__MultiServiceHybridCPQ?id=0Q00b000000znU2CAI&parentId=0060b00000vGbYbAAK&groupCart=true&groupId=a4M0b000002CWMaEAO&contextId=0Q00b000000znTYCAY&cartType=Quote","groupCartId":"0Q00b000000znU2CAI","parentId":"0060b00000vGbYbAAK","contextId":"0Q00b000000znTYCAY","groupId":"a4M0b000002CWMaEAO","groupName":"South Group"},"groupId":"a4M0b000002CWMaEAO","error":"OK"} ``` # createOrderAndSubmit Method Starts the checkout batch job for a group. ## Class ## Input Parameters | Parameter | Required | Description | | -------------- | ---------------------------- | ------------------ | | opportunityId | Required | Opportunity ID. | | cartType | Optional: Defaults to Quote. | Quote or Order. | | groupId | Required | Group ID. | | groupIds | Optional | List of Group Ids. | | CheckoutIPName | Optional | Procedure Name. | | batchSize | Optional: Defaults to 1. | Batch Size. | ## Output Parameters | Parameter | Description | | ------------ | ------------------------ | | isJobStarted | Returns a boolean value. | | message | In case of any error. | ## Example Input Data ``` {"opportunityId":'0063t00000tPCmM", "cartType": "Quote", "groupId": "a3O3t000003ADvG"} ``` ## Example Output Data ``` {"isJobStarted":true} ``` # Custom Flow for Pricing Variable Calculation You can implement custom flow for pricing variable calculation with Standard Cart APIs. The process involves 2 steps: 1. Setting Up the Interface 2. Using the Existing Data ## Setting Up the Interface 1. Create a custom apex class as follows: ![Custome Apex Class](https://developer.salesforce.com/docs/media/custom_apex_class.png "Custom Apex Class") Ensure to add the namespace of the org before class and method names in the managed orgs. 2. Create an interface as follows: ![Create an Interface](https://developer.salesforce.com/docs/media/create_interface.png "Create an Interface") 3. Run EPC Compile job. ## Using the Existing data The data passed in the input and output map of the `calculate` method is as follows: ### Input Map: - String `objectType`: This field stores the type of object passed like orderItem. It can be fetched using `get` operator. - Boolean `isRoot`: This value represents if the item being calculated is the bundle's root. It can be fetched using `get` operator. - Double `effectiveQuantity`: This field stores the quantity of the item passed. It can be fetched using `get` operator. - Map `pricingVariableCodeValueMap`: This map stores values of relevant pricing variables mapped to its code. It can be fetched using `get` operator. ![Input Map](https://developer.salesforce.com/docs/media/input_map.png "Input Map") - Map `pricingVariableCodeToRoundingScale`: This has the map for rounding scale to pricing variable code. It can be fetched using `get` operator. - Map `pricingVariableCodeToFieldBindingLabels`: This has the map for field binding labels to pricing variable code. It can be fetched using `get` operator. - String `isCostAndMarginFeatureEnabled`: This value represents if Cost and Margin feature is enabled. It can be fetched using `get` operator. - String `marginCalculationType`: This field stores margin calculation type which is information relevant to cost and margin feature. It can be fetched using `get` operator. - CartDocument `cartDocument`: This is a custom-type map that stores extensive information about the current cart. This cannot be extracted directly using `get` operator. Please use methods specifically designed for CartDocument to get relevant information. For more information, see [Use Cart Documents](https://developer.salesforce.com/docs/industries/cme/guides/use-cart-document-cpq.md). - String `itemId`: This stores the itemId for the current lineitem that is being processed. Depending on the org GUID (`UseAssetReferenceIdForParentAndRoot` CPQ Config) value, it can be salesforceId or assetreferenceId. It can be fetched using `get` operator. **NOTE:** Please do not try using debug statements that serialize the input map. `System.debug('debug post input: '+json.serialize(input));` Input map contains an object for CartDocument, which is a custom Java type and cannot be serialized directly by the apex layer. Please use methods specifically designed for CartDocument to get relevant information. ### Output Map: - Map `calculatedPricingLogData`: This stores the pricing information for pricing variables of the processed item. It can be fetched using `get` operator. ![Output Map](https://developer.salesforce.com/docs/media/output_map.png "Output Map") ## Sample Code: ``` private void calculatePostInvoke(Map input,Map output) { System.debug('debug post invoke'); Map pricingVariableCodeToValueMap = (Map)input.get('pricingVariableCodeValueMap'); System.debug('post invoke price data: '+json.serialize(pricingVariableCodeToValueMap)); //Getting the cart document instance vlocity_digital.CpqCartDocument cart = (vlocity_digital.CpqCartDocument)input.get('cartDocument'); //method to get all the line items Map outputMap = cart.call('getAllItems', new Map{'hierarchyLevel'=>-1}); Map allItemsMap = (Map) outputMap.get('result'); String currentItemId = (String)input.get('itemId'); System.debug('debug currentItemId:'+currentItemId); //Getting the cartDocumentItem having id as currentItemId vlocity_digital.CpqCartDocumentItem currentItem = allItemsMap.get(currentItemId); System.debug('debug post output: '+json.serialize(output)); //getting the line item fields Map testOTMap = currentItem.call('getItemField', new Map{'field'=>'vlocity_digital__OneTimeCharge__c'}); System.debug('debug post otc from cartdoc : '+json.serialize(testOTMap)); } ``` - Based on the itemId (salesforceId or GUID) in the input map, additional queries can be written to find out more details about the item including relational fields. ![Fields](https://developer.salesforce.com/docs/media/relational_fields.png "Releational Fields") - Query to get the GUID status of the org: ``` SELECT Name, vlocity_digital__SetupValue__c FROM vlocity_digital__CpqConfigurationSetup__c WHERE Name = 'UseAssetReferenceIdForParentAndRoot' ``` - To get the XLI custom field values without doing an additional SOQL call, we can use the ‘fields’ param in the getCartItems API. This would populate this custom field response in cartDocument in case it is a non-null value. ``` GET: /services/apexrest/vlocity_digital/v2/cpq/carts//items?fields=OLI_customfield ``` # Dark Deployments in Standard Digital Commerce With Standard Digital Commerce, you can now perform dark deployments. Dark deployments allow you to provide almost no downtime when changing the product catalog. Almost all Commerce Websites are always on. The websites are active 24hrs a day, 7 days a week, 365 days a year. Therefore, application downtime is expensive. It reduces Net Promoter Score (NPS) and increases customer dissatisfaction. Most enterprises work hard to minimize or eliminate the need to bring the application down or force users to refresh their commerce website. As an organization starts to automate business processes to production more often, avoiding downtime evolves from a "nice-to-have" into something critical for the business. With dark deployments, you can ensure that your customers have almost no downtime while using your application. After you update the product catalog, run the Generate Catalog Definitions jobs to update the catalog for the APIs. With this feature, if your users are using the basket APIs while you run the jobs, your users' carts or other operations aren't affected. To prevent this, Standard Digital Commerce reconciles the differences between the catalog and the API operations. Benefits: - Increase NPS: Keep your website up-and-running while refreshing and updating your product catalog. - Increase customer satisfaction: Ensure that your users' carts aren't interrupted when pushing catalog changes. - Increase the agility of Basket APIs: Design API-first applications that meet your needs with improved error handling and messaging. # Data Model The following is the complete set of 29 objects that make up the Orders object domain. - [Account](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_account.htm): Standard CRM object representing a company, organization, or individual involved with your business; the anchor record for the account hierarchy and account-based pricing/ordering features. See Account in the Object Reference for the Salesforce Platform. - [AccountAccountRelation](https://developer.salesforce.com/docs/atlas.en-us.automotive_cloud.meta/automotive_cloud/sforce_api_objects_accountaccountrelation.htm): Represents a relationship (parent, child, or peer) between two Account records, used to model business-partner networks and account hierarchies. See AccountAccountRelation in the Automotive Cloud Developer Guide. - [AccountFlattenedHierarchy](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/account-flattened-hierarchy.md): A flattened, denormalized view of an account's ancestor chain, so queries can filter or group by any level of the hierarchy without recursion. - [AccountInternalOrgUnit](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/account-internal-org-unit.md): Junction object associating an Account with an InternalOrganizationUnit, carrying business-unit-specific account settings. - [AccountRole](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/account-role.md): Defines a functional role (Billing Account, Delivery Recipient, Payer, Retail Store, etc.) an account plays within a given internal organization unit. - [AssociatedLocation](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/associated-location.md): Represents a location associated with a parent record (currently Account) over a defined active date range. - [Assortment](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/assortment.md): A defined collection or grouping of products used to control which products are available, orderable, or assigned to a given context. - [AssortmentProduct](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/assortment-product.md): A single product's membership within an Assortment, including product-specific attributes and active date range. - [AssortmentSpec](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/assortment-spec.md): A reusable template/specification used to generate Assortment records. - [InternalOrganizationUnit](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_internalorganizationunit.htm): An internal or external business unit within a company's organizational structure. See InternalOrganizationUnit in the Object Reference for the Salesforce Platform. - [InternalOrgUnitUser](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/internal-org-unit-user.md): Assignment of a User to an InternalOrganizationUnit, with mobile/field-service preferences for that unit. - [Location](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/location.md): A physical or virtual place of business (warehouse, plant, store, site, delivery vehicle); locations can form a hierarchy. - [LocationAssortment](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/location-assortment.md): Assignment of an Assortment to a specific Location, indicating which products that location can sell, stock, or order. - [Order](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/order.md): Standard object representing a customer's commitment to buy products or services; extended for Advanced Orders via OrderSpecId. - [OrderItem](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/order-item.md): Standard line-item object on an Order; extended for Advanced Orders with a link to an OrderItemSpec. - [OrderItemSpec](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/order-item-spec.md): An Advanced Orders line-item specification template governing how a product/product family can be ordered under an OrderSpec. - [OrderItemSpecRule](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/order-item-spec-rule.md): A pricing/scope rule attached to an OrderItemSpec, defining scope and pricing impact when matched. - [OrderSpec](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/order-spec.md): A top-level Advanced Orders template defining order behavior — allowed order types, pricing recalculation, delivery/lead time, inventory, promotions, and authorization lists. - [OrderSpecOrderItemSpec](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/order-spec-order-item-spec.md): Junction object linking an OrderSpec to its valid OrderItemSpec records, including default and active date range. - [PartyRoleRelation](https://developer.salesforce.com/docs/atlas.en-us.automotive_cloud.meta/automotive_cloud/sforce_api_objects_partyrolerelation.htm): A role-based relationship between two party records (e.g., "Bill To" or "Delivery Recipient"), with support for the inverse relationship. See PartyRoleRelation in the Automotive Cloud Developer Guide. - [Product2](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_product2.htm): The standard product object at the center of the Manufacturing/Automotive/Consumer Goods product model. See Product2 in the Object Reference for the Salesforce Platform. - [ProductCatalog](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/product-catalog.md): A top-level catalog grouping related product categories and products for a sales channel or process. - [ProductCatalogQual](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/product-catalog-qual.md): A qualification rule determining whether a product catalog applies to a given internal organization unit. - [ProductCategory](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/product-category.md): A category used to organize products within a catalog; categories can nest to form a hierarchy. - [ProductCategoryProduct](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/product-category-product.md): Junction object associating a Product2 with a ProductCategory, including primary-category designation. - [ProductInternalOrgUnit](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/product-internal-org-unit.md): Assignment of a product to an internal organization unit, tracking lifecycle phase and planning/sales dates for that unit. - [ProductUnitOfMeasure](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/product-unit-of-measure.md): A unit of measure available for a specific product, including base/default-order-unit flags and physical dimensions. - [StoreAssortment](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/store-assortment.md): Assignment of an assortment to a specific retail store/account/location group, used by Consumer Goods Cloud retail execution. - [UnitofMeasure](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/unit-of-measure.md): Standard unit of measure (each, case, pallet, kilogram, liter, etc.) with conversion factor, scale, and rounding behavior. # Data Model The following is the complete set of 19 objects that make up the Pricing object domain. - [Account](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_account.htm): Standard CRM object representing a company, organization, or individual involved with your business; the anchor record for the account hierarchy and account-based pricing/ordering features. See Account in the Object Reference for the Salesforce Platform. - [AccountAccountRelation](https://developer.salesforce.com/docs/atlas.en-us.automotive_cloud.meta/automotive_cloud/sforce_api_objects_accountaccountrelation.htm): Represents a relationship (parent, child, or peer) between two Account records, used to model business-partner networks and account hierarchies. See AccountAccountRelation in the Automotive Cloud Developer Guide. - [AccountFlattenedHierarchy](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/penny-perfect-pricing-objects/standard-objects/account-flattened-hierarchy.md): A flattened, denormalized view of an account's ancestor chain, so queries can filter or group by any level of the hierarchy without recursion. - [AccountInternalOrgUnit](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/penny-perfect-pricing-objects/standard-objects/account-internal-org-unit.md): Junction object associating an Account with an InternalOrganizationUnit, carrying business-unit-specific account settings. - [AccountRole](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/penny-perfect-pricing-objects/standard-objects/account-role.md): Defines a functional role (Billing Account, Delivery Recipient, Payer, Retail Store, etc.) an account plays within a given internal organization unit. - [ExternalPricingKeyValTier](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/penny-perfect-pricing-objects/standard-objects/external-pricing-key-val-tier.md): A single volume/quantity tier within an ExternalPricingKeyValue record, supporting tiered/scale pricing. - [ExternalPricingKeyValue](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/penny-perfect-pricing-objects/standard-objects/external-pricing-key-value.md): A resolved pricing condition record in the Penny Perfect Pricing engine, a specific, priced combination of key attribute values. - [InternalOrganizationUnit](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_internalorganizationunit.htm): An internal or external business unit within a company's organizational structure. See InternalOrganizationUnit in the Object Reference for the Salesforce Platform. - [InternalOrgUnitUser](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/penny-perfect-pricing-objects/standard-objects/internal-org-unit-user.md): Assignment of a User to an InternalOrganizationUnit, with mobile/field-service preferences for that unit. - [PartyRoleRelation](https://developer.salesforce.com/docs/atlas.en-us.automotive_cloud.meta/automotive_cloud/sforce_api_objects_partyrolerelation.htm): A role-based relationship between two party records (e.g., "Bill To" or "Delivery Recipient"), with support for the inverse relationship. See PartyRoleRelation in the Automotive Cloud Developer Guide. - [Product2](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_product2.htm): The standard product object at the center of the Manufacturing/Automotive/Consumer Goods product model. See Product2 in the Object Reference for the Salesforce Platform. - [TrdeMobPrcCalcSchm](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/penny-perfect-pricing-objects/standard-objects/trde-mob-prc-calc-schm.md): Pricing Calculation Schema, the top-level record defining an ordered set of calculation steps used to compute prices. - [TrdeMobPrcCalcSchmDter](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/penny-perfect-pricing-objects/standard-objects/trde-mob-prc-calc-schm-dter.md): Pricing Calculation Schema Determination, a rule selecting which schema and pricing specification apply for a given context. - [TrdeMobPrcCalcSchmStep](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/penny-perfect-pricing-objects/standard-objects/trde-mob-prc-calc-schm-step.md): Pricing Calculation Schema Step, a single ordered step within a calculation schema's sequence. - [TrdeMobPrcKeyAttribute](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/penny-perfect-pricing-objects/standard-objects/trde-mob-prc-key-attribute.md): Pricing Key Attribute, a single field/attribute usable as a matching key within a Pricing Key Type. - [TrdeMobPrcKeyType](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/penny-perfect-pricing-objects/standard-objects/trde-mob-prc-key-type.md): Pricing Key Type, a named combination of up to 10 Pricing Key Attributes forming a lookup key for price determination. - [TrdeMobPrcSpec](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/penny-perfect-pricing-objects/standard-objects/trde-mob-prc-spec.md): Pricing Specification (Pricing Condition Template), the top-level record defining a type of pricing condition and how it's calculated. - [TrdeMobPrcSrchStrategy](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/penny-perfect-pricing-objects/standard-objects/trde-mob-prc-srch-strategy.md): Pricing Search Strategy, a named, ordered sequence of steps determining how the pricing engine looks up matching pricing specifications. - [TrdeMobPrcSrchStrtgyStp](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/penny-perfect-pricing-objects/standard-objects/trde-mob-prc-srch-strtgy-stp.md): Pricing Search Strategy Step, a single ordered step within a search strategy, specifying a key type and hierarchy levels to match. # DCG Connected App Setup This topic guides you through the creation of a Salesforce Connected Application to be used by the Digital Commerce Gateway (also known as DCG application, formerly known as Vlocity Digital Commerce Tier - VDCT). **note:** The documentation in this section applies only to customers who have purchased the Digital Commerce Gateway license. The instructions provided don't work without the Digital Commerce Gateway license. The DCG Connected App Setup process is required during these events: - Initial DCG setup. - Integration of an existing DCG environment with a different Salesforce organization. - Re-integration after a sandbox refresh where the connected application must be recreated. ## Prerequisites To create the connected application, you must have an admin account within the Salesforce organization. The callback URL to configure in the connected application will differ depending on the type of Salesforce instance used (test or standard), - For sandbox / test instances: https://test.salesforce.com/services/oauth2/success - For production / standard instances: https://login.salesforce.com/services/oauth2/success The DCG application relies on the OAuth2.0 JWT Bearer Token authentication flow which requires a private key and certificate to work. Vlocity creates them and provides you with the public certificate to add to the connected application at a later stage. You do not need this certificate to create the connected application. DCG requires a dedicated user who is authorized to use the connected application. The user must be assigned to a Profile with sufficient permissions for the DCG application to work. The “System Administrator” profile is the recommended one for DCG; however, its permissiveness is generally not recommended for production environments. ## Creating the application To create the connected application, see [Create a Connected App](https://help.salesforce.com/articleView?id=connected_app_create.htm). After you reach the application creation page, configure it as follows: - Provide a name for the application similar to: “Digital Commerce Application - {ENV}” (replacing {ENV} with the appropriate environment name / nickname). - Provide an email address where you can receive notifications related to the connected application. - Check **Enable OAuth settings**. - Fill in the Callback URL (refer to the Prerequisites section above for possible values). - For now, skip setting **Use digital signatures** until after setup when Vlocity has sent you the connected application certificate. - Add the following Oauth Scopes (or permissions) to the **Selected Oauth Scopes**: - API - refresh_token, offline_access For example: ![DCG Connected App Setup](https://developer.salesforce.com/docs/media/dcg_connected1.png) ![DCG Connected App Setup - Configure](https://developer.salesforce.com/docs/media/dcg_connected2.png) ## Authorize the User to Access the Connected Application DCG requires a user who is authorized to use the connected application. This user must be assigned to a Profile with sufficient permissions for the DCG application to work. The “System Administrator” profile is the most commonly used. ## Send the Connected Application Information to Vlocity Update the ticket with the following required information from the Connected Application: - The Salesforce username authorized in the application - The Connected Application API Oauth Consumer Key **note:** It is not necessary to send either the Salesforce password for the username or the Connected Application API Oauth Consumer Secret. ## Upload the Public Certificate to the Connected Application After Salesforce has finalized the creation of your environment and has sent you the public certificate, proceed with the post-setup instructions here. The public certificate may be sent to you in PEM or DER format. Both are accepted by Salesforce Connected Applications. When the certificate is nearing expiration, a new one is generated and provided to you by Salesforce. To add or replace the certificate, follow these steps: 1. Log in to the Salesforce Org and navigate to **Setup** 2. Navigate to **Menu > Create > Apps > Connected Apps**. 3. Locate the app you created for this environment. 4. Click on the **Edit** link for your App 5. Locate and check the setting **Use digital signatures** in the API section. 6. Click **Browse…** and upload the public certificate file you received from Salesforce. 7. Click **Save**. ![Upload the public certificate to the connected application](https://developer.salesforce.com/docs/media/dcg_6.png) You can display the certificate’s properties using the following command (subject, issuer and expiration date): ```nolang > openssl x509 -in myenv-connected-app-public-certificate.pem -subject -dates -issuer -noout Example output: subject=C=US, ST=CA, L=SANFRANSISCO, O=Devops, OU=IT Department, CN=myenv.vlocity.salesforce.com notBefore=Apr 15 16:36:15 2022 GMT notAfter=Apr 15 16:36:15 2023 GMT issuer=C=US, ST=CA, L=SANFRANSISCO, O=Devops, OU=IT Department, CN=myenv.vlocity.salesforce.com ``` # DCG External Client App Setup This topic guides you through the creation of an external client app to be used by the Digital Commerce Gateway (also known as DCG application, formerly known as Vlocity Digital Commerce Tier - VDCT). **note:** The documentation in this section applies only to customers who have purchased the Digital Commerce Gateway license. The instructions provided don't work without the Digital Commerce Gateway license. The DCG External Client App Setup process is required during these events: - Initial DCG setup. - Integration of an existing DCG environment with a different Salesforce organization. - Re-integration after a sandbox refresh where the external client app must be recreated. ## Prerequisites To create the external client app, you must have an admin account within the Salesforce organization. The callback URL to configure in the connected application will differ depending on the type of Salesforce instance used (test or standard). - For sandbox / test instances: https://test.salesforce.com/services/oauth2/success - For production / standard instances: https://login.salesforce.com/services/oauth2/success The DCG application relies on the OAuth 2.0 JWT Bearer Token authentication flow which requires a private key and certificate to work. Vlocity creates them and provides you with the public certificate to add to the external client app at a later stage. You do not need this certificate to create the external client app. DCG requires a dedicated user who is authorized to use the external client app. The user must be assigned to a Profile with sufficient permissions for the DCG application to work. The “System Administrator” profile is the recommended one for DCG; however, its permissiveness is generally not recommended for production environments. ## Creating the application To create the external client app, see [Create an External Client App](https://help.salesforce.com/s/articleView?id=xcloud.create_a_local_external_client_app.htm&type=5). After you reach the external client app creation page, configure it as follows: - Provide a name for the application similar to: “Digital Commerce Application - {ENV}” (replacing {ENV} with the appropriate environment name / nickname). - Provide an email address where you can receive notifications related to the connected application. - Expand API (Enable OAuth Settings) and check **Enable OAuth**. - Fill in the Callback URL (refer to the Prerequisites section above for possible values). - Add the following Oauth Scopes (or permissions) to the **Selected Oauth Scopes**: - Manage user data via APIs (api) - Perform requests at any time (refresh_token, offline_access) ![DCG OAuth](https://developer.salesforce.com/docs/media/dcg_oauth2_new1.png) ## Authorize the User to Access the External Client App DCG requires a user who is authorized to use the external client app. This user must be assigned to a Profile with sufficient permissions for the DCG application to work. The “System Administrator” profile is the most commonly used. ![DCG Policy](https://developer.salesforce.com/docs/media/dcg_app_policies_new1.png) ![DCG Plugin](https://developer.salesforce.com/docs/media/dcg_plugin_new1.png) ## Send the External Client App Information to Vlocity Update the ticket with the following required information from the external client app: - The Salesforce username authorized in the application - The external client app API Oauth Consumer Key **note:** It is not necessary to send either the Salesforce password for the username or the Connected Application API Oauth Consumer Secret. ## Upload the Public Certificate to the External Client App After Salesforce has finalized the creation of your environment and has sent you the public certificate, proceed with the post-setup instructions here. The public certificate may be sent to you in PEM or DER format. Both are accepted by external client apps. When the certificate is nearing expiration, a new one is generated and provided to you by Salesforce. To add or replace the certificate, follow these steps: 1. Log in to the Salesforce Org and navigate to **Setup** 2. From Setup, in the Quick Find box, enter _App_, and then select **External Client App Manager**. ![DCG External App](https://developer.salesforce.com/docs/media/dcg_external_app_new1.png) 3. Locate the app you created for this environment and open it. 4. On the settings tab click **Edit**. 5. Locate and check the setting Enable JWT Bearer Flow in the API section. ![DCG Flow](https://developer.salesforce.com/docs/media/dcg_flow3_new.png) 6. Click **Upload Files** and upload the public certificate file you received from Salesforce. 7. Click **Save**. You can display the certificate’s properties using the following command (subject, issuer and expiration date): ```nolang > openssl x509 -in myenv-external-client-app-public-certificate.pem -subject -dates -issuer -noout Example output: subject=C=US, ST=CA, L=SANFRANSISCO, O=Devops, OU=IT Department, CN=myenv.vlocity.salesforce.com notBefore=Apr 15 16:36:15 2022 GMT notAfter=Apr 15 16:36:15 2023 GMT issuer=C=US, ST=CA, L=SANFRANSISCO, O=Devops, OU=IT Department, CN=myenv.vlocity.salesforce.com ``` # DCG OAuth2 Setup and Usage This topic provides a general overview and a technical explanation of OAuth2 authentication for the Digital Commerce Gateway. **note:** The documentation in this section applies only to customers who have purchased the Digital Commerce Gateway license. The instructions provided don't work without the Digital Commerce Gateway license. ## Prerequisites To use the information in this document, you must have previously requested and obtained a DCG environment. After the environment is provisioned, Salesforce sends you the following information: - The DCG Endpoint - Format: `api.{myenv}.{customername}.dc.vloc-dev.com` or `api.{myenv}.{customername}.dc.vloc-prod.com` - The OAuth2 Server - Format: `vlocity-dc-{customername}-{platform}.auth.{region}.awscognito.com.com` - Four sets of OAuth2 credentials for this environment: - admin - cmig - ops - user ## List of the DCG endpoints and associated scopes You will find the mapping between app clients, scopes, and endpoints below. For each endpoint, you will find the list of methods authorized with which app client and scopes. ```nolang # App clients and matching scopes access oauth2-{env}-admin = [admin, ops, user, cmig] oauth2-{env}-cmig  = [cmig] oauth2-{env}-ops   = [ops, user] oauth2-{env}-user  = [user]   # Scopes  - admin   - cmig   - ops   - user ``` ```nolang # Digital Commerce /dc/app-status     OPTIONS no-auth (AWS Mock 200)     ANY     oauth2-{env}:[admin, ops] /dc/app-diagnostic     OPTIONS no-auth (AWS Mock 200)     ANY     oauth2-{env}:[admin, ops] /dc/{proxy}+     OPTIONS no-auth (AWS Mock 200)     DELETE  oauth2-{env}:[admin, ops]     PATCH   oauth2-{env}:[admin, ops]     ANY     oauth2-{env}:[admin, ops, user]  # Cache Migration /cm/app-status     OPTIONS no-auth (AWS Mock 200)     ANY     oauth2-{env}: [admin, ops] /cm/app-diagnostic     OPTIONS no-auth (AWS Mock 200)     ANY     oauth2-{env}: [admin, ops] /cm/{proxy}+     OPTIONS no-auth (AWS Mock 200)     DELETE  oauth2-{env}: [admin, cmig]     PATCH   oauth2-{env}: [admin, cmig]     ANY     oauth2-{env}: [admin, cmig, ops]  # Cache Administration /admin/cache/status     OPTIONS no-auth (AWS Mock 200)     GET     oauth2-{env}: [admin, ops]  /admin/cache/list     OPTIONS no-auth (AWS Mock 200)     GET     oauth2-{env}: [admin, ops]  /admin/cache/flush     OPTIONS no-auth (AWS Mock 200)     POST    oauth2-{env}: [admin, ops] ``` ## OAuth2 Description “Cognito Application Clients” customer keys and secrets are: ![OAuth2 description](https://developer.salesforce.com/docs/media/oauthclientcred.png) - Used to request an OAuth2 JWT to the AWS Cognito OAuth2 server. - Generated by Salesforce and provided to the customer. - Specific to each environment. OAuth2 JWT (JSON Web Token): - The OAuth2 JWT are temporary authorization code used to access the DCG API Endpoints. - These are obtained from the AWS Cognito OAuth2 server by a trusted client application. - The DCG OAuth2 JWT can be reused multiple times until its expiration date and can be shared by several application clients to connect to the same API. - The expiration time of the JWT is 3600 seconds (1 hour) and cannot be changed at the moment (AWS Cognito constraint). The JSON Web Token or Bearer Token received from the OAuth2 server (also known as the AWS Cognito server) contains the following (among other things): - A string identifying the customer application used to deliver the token - A timestamp and expiration date - A scope or list of scopes that this token grants access to - A signature (to prevent JWT forgery) You can find more information about OAuth2 JWT here: [https://oauth.net/2/jwt/](https://oauth.net/2/jwt/). DCG uses OAuth2 Scopes to control access to the protected resource. Each Application Client is granted a list of scopes represented by arbitrary strings. The protected resources are assigned one or more scopes for specific paths. The scope, being part of the JWT content, the protected resource can validate whether the client has access to and/or requested access to this specific resource. ## Implementation of OAuth2 for Digital Commerce Below is a sample procedure with example calls to obtain and consequently use an OAuth2 JWT token against a sample test deployment. - Obtain an OAuth2 JWT access token: Obtaining an OAuth2 JWT access token requires making a POST HTTPS request to the AWS OAuth2 Cognito endpoint using a specific set of credentials which Salesforce has created and provided. These credentials are referred to as _customer application secrets_. Multiple sets of secrets with different access levels are provided. ```nolang # "Cognito Application Clients": customer application secrets customer_app_key="6gi8...imprk" customer_app_secret="1dh9t...4iu2rn"   # cognito_oauth2_server (provided by Salesforce, below is an example) cognito_oauth2_server="vl-dc-test.auth.eu-central-1.amazoncognito.com"   # Template curl call to retrieve an oauth2 token curl -s -X POST --user "${customer_app_key}:${customer_app_secret}" \     -H 'Content-Type: application/x-www-form-urlencoded' \      "https://${cognito_oauth2_server}/oauth2/token?grant_type=client_credentials"   # Response template: {   "access_token": "[...]",   "expires_in": 3600,   "token_type": "Bearer"}   # Example call curl -s -X POST --user "6gi88ku...9imprk:1dh9to...0j4iu2rn" \     -H 'Content-Type: application/x-www-form-urlencoded' \ "https://vl-dc-test.auth.eu-central-1.amazoncognito.com/oauth2/token?grant_type=client_credentials"   # Example response:{"access_token":"eyJraWQiOiJQbGkyTkJcL3NBczBabkVWaXdPS0ZhQ0JsbWpHcUxXblFOMlo0RmE1d09Ecz0iLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiI2Z2k4OGt1bmdkbmI0NDB0OWdpYzlpbXByayIsInRva2VuX3VzZSI6ImFjY2VzcyIsInNjb3BlIjoiZGMtdGVzdC1hcGlcL2FkbWluIGRjLXRlc3QtYXBpXC9yZWFkIGRjLXRlc3QtYXBpXC93cml0ZSIsImF1dGhfdGltZSI6MTU2MzM3NjMxNiwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLmV1LWNlbnRyYWwtMS5hbWF6b25hd3MuY29tXC9ldS1jZW50cmFsLTFfelJHb2dweHc4IiwiZXhwIjoxNTYzMzc5OTE2LCJpYXQiOjE1NjMzNzYzMTYsInZlcnNpb24iOjIsImp0aSI6IjFmYTU5YWQ1LTIwNDEtNDAyZS04NGIxLTExNjFjMWIxMmQ1YyIsImNsaWVudF9pZCI6IjZnaTg4a3VuZ2RuYjQ0MHQ5Z2ljOWltcHJrIn0.awj5M4AvLXbL7TJrPIQguEUv2ifFurmZnqZraoNy5g9UP365_vknj-hJrgFzZ4OtOYlopQTdMgD-8m1n7vVqwUPfywr8qK2bJHOS8Dm9WycNypnsiFYC4eIDHjLd2526-G63w6shTj4B53QmtpCzJF8lIvB9rGcsiQgxIlRNK9ZRSmc0opHZSLnts0xeLUvHCW5eb5Uys7eIY_MPtc6GAMca0A6AObxADdklHMYLLagvEZdPPtj-A-HG04jLuNCwcS3lpuhtmw7W0F0hgGhIIuI0ZQez7TxzdeaV2B3v9_P_dLPe18-3mD1BV0kZyjYqcZYqFo4nHSg-UT33FLByWg","expires_in":3600,"token_type":"Bearer"}  ``` - Use an OAuth2 JWT: The resource protected by OAuth2 tokens can be accessed after you have retrieved a valid OAuth2 bearer token (also known as a JWT): ```nolang # Obtain the FQDN of the resource to access / protect (in this case the DCG API)api_fqdn="api-test-cognito.platform.customer.dc.vloc-dev.com"   # Example of URL path of the resource to be accessed url_path="/dc/app-status" url_path="/dc/v3/catalogs/CATALOG_CODE/offers"   # The OAuth2 response from cognito is stored in the oauth2_cognito_response oauth2_cognito_response='{"access_token":"[...]","expires_in":3600,"token_type":"Bearer"}'   # The OAuth2 token is stored in the variable oauth2_token # Example of extraction of the access_token from oauth2_cognito_response via Python’s jq tool oauth2_token="$(echo -e "$oauth2_cognito_response"  | jq -r .access_token )"   # Template for calls made to the protected resource: curl -s -i -X GET -H "authorization: Bearer ${oauth2_token}" \     -H "Content-Type: application/json; charset=UTF-8" \     "https://${api_fqdn}${url_path}" ; echo -e "\n\nCurl returned $?" ``` ```nolang # Example: #  - Setting variables and contextapi_fqdn="api-test-cognito.platform.customer.dc.vloc-dev.com"   url_path="/dc/app-status"   oauth2_token="eyJraWQiOiJQbGkyTkJcL3NBczBabkVWaXdPS0ZhQ0JsbWpHcUxXblFOMlo0RmE1d09Ecz0iLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiI2Z2k4OGt1bmdkbmI0NDB0OWdpYzlpbXByayIsInRva2VuX3VzZSI6ImFjY2VzcyIsInNjb3BlIjoiZGMtdGVzdC1hcGlcL2FkbWluIGRjLXRlc3QtYXBpXC9yZWFkIGRjLXRlc3QtYXBpXC93cml0ZSIsImF1dGhfdGltZSI6MTU2MzM3NjMxNiwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLmV1LWNlbnRyYWwtMS5hbWF6b25hd3MuY29tXC9ldS1jZW50cmFsLTFfelJHb2dweHc4IiwiZXhwIjoxNTYzMzc5OTE2LCJpYXQiOjE1NjMzNzYzMTYsInZlcnNpb24iOjIsImp0aSI6IjFmYTU5YWQ1LTIwNDEtNDAyZS04NGIxLTExNjFjMWIxMmQ1YyIsImNsaWVudF9pZCI6IjZnaTg4a3VuZ2RuYjQ0MHQ5Z2ljOWltcHJrIn0.awj5M4AvLXbL7TJrPIQguEUv2ifFurmZnqZraoNy5g9UP365_vknj-hJrgFzZ4OtOYlopQTdMgD-8m1n7vVqwUPfywr8qK2bJHOS8Dm9WycNypnsiFYC4eIDHjLd2526-G63w6shTj4B53QmtpCzJF8lIvB9rGcsiQgxIlRNK9ZRSmc0opHZSLnts0xeLUvHCW5eb5Uys7eIY_MPtc6GAMca0A6AObxADdklHMYLLagvEZdPPtj-A-HG04jLuNCwcS3lpuhtmw7W0F0hgGhIIuI0ZQez7TxzdeaV2B3v9_P_dLPe18-3mD1BV0kZyjYqcZYqFo4nHSg-UT33FLByWg" ``` ```nolang #  - Running the command curl -s -i -X GET -H "authorization: Bearer ${oauth2_token}" \     -H "Content-Type: application/json; charset=UTF-8" \     "https://${api_fqdn}${url_path}" ; echo -e "\n\nCurl returned $?"   #  - Received response HTTP/2 200  date: Mon, 10 Aug 2020 15:36:32 GMT content-type: application/vnd.spring-boot.actuator.v2+json;charset=UTF-8 content-length: 586 x-amzn-requestid: 4c427148-f29e-4d34-b909-00594a31728d x-amz-apigw-id: RD1r8GTePHcF4Yw= x-amzn-lambda-integration-tag: 457b37f4-324c-4ba3-a405-e87945962669 vloc-op-cache: NOT_APPLICABLE x-amzn-trace-id: Root=1-5f31697f-895fde273e05332417fd3f41  {"status":"UP","details":{"health":{"status":"UP","details":{"app_name":"Vlocity V3 Edge API","version":"1.0-SNAPSHOT","build_time":"2020-06-11T14:03:37Z","build_info":{"commit":"f925489","buildInfo":"tblanchard@tblanchard","branch":"v17","date":"2020-06-11T14:03:37Z"},"salesforce_last_contact":"","app_start_time":"2020-08-10T15:09:58.058Z","jks_expire_ms":"2022-03-22T09:16:52+0000"}},"redis":{"status":"UP","details":{"redis":"UP","hits":55516102,"misses":7363576,"evicted":0,"expired":178034,"hit_ratio":0.88,"con_active":0,"con_idle":0,"con_wait":0,"redis_pool_size":8}}}}  ``` - Scopes with different endpoints and app-clients: The resource protected by OAuth2 tokens can be accessed once we have retrieved a valid oauth2 bearer token. Not all app-clients give access to all resources; this allows you to share or use different app clients depending on your users. You will find the complete list of endpoints and scope access in the next section. The following is an example with the following 2 app clients ```nolang oauth2-myenv-ops   scope access: ops and user oauth2-myenv-user  scope access: user ``` The URL path `/dc/app-status` is accessible by all scopes (admin, ops, user). The URL path `/dc/v3/catalogs/CATALOG_CODE/offers` is accessible only by the admin and ops scopes. To set up different endpoints and app-clients: ```nolang cognito_oauth2_server="vl-dc-test.auth.eu-central-1.amazoncognito.com"   # We’ve created a second "Cognito Application Clients" with different scopes # Retrieve and store a different JWT with each set of credentials # Template curl call to retrieve an oauth2 token curl -s -X POST --user "${customer_app_key}:${customer_app_secret}" -H 'Content-Type: application/x-www-form-urlencoded' "https://${cognito_oauth2_server}/oauth2/token?grant_type=client_credentials"   # "Cognito Application Clients" oauth2-myenv-ops with ops and user scopes customer_app_key="6gi88ku...9imprk" customer_app_secret="1dh9to...0j4iu2rn"   oauth2_token_ops=[...]   # "Cognito Application Clients" oauth2-myenv-user with only user scope customer_app_key="7j2o4n...4u97ri" customer_app_secret="10m997...inlejh"   oauth2_token_user=[...]  ``` Responses received using the oauth2_token_user JWT from the  oauth2-myenv-user app client: - /dc/v3/catalogs/CATALOG_CODE/offers should return 200 unauthorized - /dc/app-status should return 401 ```nolang api_fqdn="api-test-cognito.platform.customer.dc.vloc-dev.com"   url_path="/dc/v3/catalogs/CATALOG_CODE/offers" curl -s -i -X GET -H "authorization: Bearer ${oauth2_token_user}" -H "Content-Type: application/json; charset=UTF-8" "https://${api_fqdn}${url_path}"  HTTP/2 200  date: Mon, 22 Jul 2019 14:13:38 GMT content-type: application/json;charset=ISO-8859-1 content-length: 12332 x-amzn-requestid: e65a90de-ac8a-11e9-93cd-9d8d58cb662d x-amzn-remapped-content-length: 12332x-amz-apigw-id: dOum1EZeFiAFg8Q= x-amzn-trace-id: Root=1-5d35c492-6dbf677d7c12525a746c90fe;Sampled=0   [...body...]   api_fqdn="api-test-cognito.platform.customer.dc.vloc-dev.com" url_path="/dc/app-status" curl -s -i -X GET -H "authorization: Bearer ${oauth2_token_user}" -H "Content-Type: application/json; charset=UTF-8" "https://${api_fqdn}${url_path}"   HTTP/2 401  date: Mon, 22 Jul 2019 14:13:32 GMT content-type: application/json content-length: 26 x-amzn-requestid: e2bf9017-ac8a-11e9-b915-3f49f14f8dec x-amzn-errortype: UnauthorizedException x-amz-apigw-id: dOul5H4YFiAFsxQ=   {"message":"Unauthorized"}  ``` Responses received using the oauth2_token_ops JWT from the  oauth2-myenv-ops app client: - /dc/v3/catalogs/CATALOG_CODE/offers should return 200 - /dc/app-status should return 200 ```nolang api_fqdn="api-test-cognito.platform.customer.dc.vloc-dev.com"   url_path="" curl -s -i -X GET -H "authorization: Bearer ${oauth2_token_ops}" -H "Content-Type: application/json; charset=UTF-8" "https://${api_fqdn}${url_path}"   HTTP/2 200  date: Mon, 22 Jul 2019 14:30:16 GMT content-type: application/json content-length: 19 x-amzn-requestid: 3929aeba-ac8d-11e9-b4cd-11d6a4139ed9 x-amz-apigw-id: dOxCwFxMliAFZkw=   {"statusCode": 200}   api_fqdn="api-test-cognito.platform.customer.dc.vloc-dev.com" url_path="/dc/app-status" curl -s -i -X GET -H "authorization: Bearer ${oauth2_token_user}" -H "Content-Type: application/json; charset=UTF-8" "https://${api_fqdn}${url_path}"   HTTP/2 200  date: Mon, 22 Jul 2019 14:32:38 GMT content-type: application/json;charset=ISO-8859-1 content-length: 697 x-amzn-requestid: 8e0c7ccc-ac8d-11e9-b742-815dfc2c8abc x-amzn-remapped-content-length: 697x-amz-apigw-id: dOxZBGEXliAFheg= x-amzn-trace-id: Root=1-5d35c906-d3704ba9ad66385d1f8c14c6;Sampled=0 ``` ## Troubleshooting If the application returns an HTTP status code other than 200 or 401, it may not be related to OAuth2 setup. For example, 403, 404, and 500 HTTP status codes are generally not related with OAuth2 setup or usage. - Error code 401: Access denied, see next section “Common 401 HTTP status code and errors returned by oauth2 auth“ for the different scenarios. - Error code 403: If you receive a code 403 from the DCG application, it generally means that there is a problem with the configuration of your client. It can be any of the following: - Wrong URL or path. - Missing or misspelled headers. - Client IP outside access list when allow list has been configured (endpoints are opened to the world by default). - Error code 5xx: These errors generally indicate an issue with the DC API request itself or the data sets retrieved. Please get in touch with Customer Support or Professional Services to solve them. - Common 401 HTTP status code and errors returned by oauth2 auth: - Expired token: ```nolang #  - declaring an expired token oauth2_token="eyJraWQiOiJQbGkyTkJcL3NBczBabkVWaXdPS0ZhQ0JsbWpHcUxXblFOMlo0RmE1d09Ecz0iLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiI2Z2k4OGt1bmdkbmI0NDB0OWdpYzlpbXByayIsInRva2VuX3VzZSI6ImFjY2VzcyIsInNjb3BlIjoiZGMtdGVzdC1hcGlcL2FkbWluIGRjLXRlc3QtYXBpXC9yZWFkIGRjLXRlc3QtYXBpXC93cml0ZSIsImF1dGhfdGltZSI6MTU2MzM3NjMxNiwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLmV1LWNlbnRyYWwtMS5hbWF6b25hd3MuY29tXC9ldS1jZW50cmFsLTFfelJHb2dweHc4IiwiZXhwIjoxNTYzMzc5OTE2LCJpYXQiOjE1NjMzNzYzMTYsInZlcnNpb24iOjIsImp0aSI6IjFmYTU5YWQ1LTIwNDEtNDAyZS04NGIxLTExNjFjMWIxMmQ1YyIsImNsaWVudF9pZCI6IjZnaTg4a3VuZ2RuYjQ0MHQ5Z2ljOWltcHJrIn0.awj5M4AvLXbL7TJrPIQguEUv2ifFurmZnqZraoNy5g9UP365_vknj-hJrgFzZ4OtOYlopQTdMgD-8m1n7vVqwUPfywr8qK2bJHOS8Dm9WycNypnsiFYC4eIDHjLd2526-G63w6shTj4B53QmtpCzJF8lIvB9rGcsiQgxIlRNK9ZRSmc0opHZSLnts0xeLUvHCW5eb5Uys7eIY_MPtc6GAMca0A6AObxADdklHMYLLagvEZdPPtj-A-HG04jLuNCwcS3lpuhtmw7W0F0hgGhIIuI0ZQez7TxzdeaV2B3v9_P_dLPe18-3mD1BV0kZyjYqcZYqFo4nHSg-UT33FLByWg"   #  - Running the command curl -s -i -X GET -H "authorization: Bearer ${oauth2_token}" -H "Content-Type: application/json; charset=UTF-8" "https://${api_fqdn}${url_path}" ; echo -e "\n\nCurl returned $?"   #  - Received response HTTP/2 401  date: Thu, 04 Jul 2019 12:35:15 GMT content-type: application/json content-length: 44 x-amzn-requestid: 2cd359f0-9e58-11e9-a702-3b62603f614d x-amzn-errortype: UnauthorizedException x-amz-apigw-id: cTLUlGjdliAFbig=  {"message":"The incoming token has expired"}  ``` - Malformed token: In the following example, remove some characters from the end of the base64 oauth2 token, in effect corrupting the signature. ```nolang #  - Received response HTTP/2 403  date: Mon, 22 Jul 2019 13:39:21 GMT content-type: application/json content-length: 27 x-amzn-requestid: 1c7a8f4b-ac86-11e9-b10d-e70db1458280 x-amzn-errortype: AccessDeniedException x-amz-apigw-id: dOpleEcSFiAFdxg=   {"Message":"Access Denied"}  ``` - Invalid token: The token is not authorized to access this request (e.g. the scope of the Application Client does not grant access to a specific resource). ```nolang #  - Received response HTTP/2 401 date: Wed, 03 Jul 2019 15:00:06 GMT content-type: application/json content-length: 26 x-amzn-requestid: 3ec26cce-9da3-11e9-8211-2d7edd287f91 x-amzn-errortype: UnauthorizedException x-amz-apigw-id: cQNmlFoEFiAFppA=  {"message":"Unauthorized"} ``` **See Also** - [https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization) - [https://oauth.net/2/bearer-tokens/](https://oauth.net/2/bearer-tokens/) - [https://swagger.io/docs/specification/authentication/bearer-authentication/](https://swagger.io/docs/specification/authentication/bearer-authentication/) - [https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-using-tokens-with-identity-providers.html](https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-using-tokens-with-identity-providers.html) - [https://docs.aws.amazon.com/cognito/latest/developerguide/token-endpoint.html](https://docs.aws.amazon.com/cognito/latest/developerguide/token-endpoint.html) # DCG Troubleshooting Troubleshooting helps you resolve errors you can encounter while using the Digital Commerce Gateway. **note:** The documentation in this section applies only to customers who have purchased the Digital Commerce Gateway license. The instructions provided don't work without the Digital Commerce Gateway license. ## Health check endpoints used for validation and troubleshooting ```nolang # Digital Commerce application /dc/app-status /dc/app-diagnostic # Cache Migration application /cm/app-status /cm/app-diagnostic # Cache Management /admin/cache/status ``` ## Troubleshooting Steps Attempt to reproduce your call with a simple client, such as Curl or Postman. The following example uses the Curl client on the command line (Mac OS X). Ensure you can successfully connect to the application. **note:** To obtain the OAuth2 JWT, review the DCG Oauth2 Guide[DCG OAuth2 Setup and Usage](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-dcg-oauth2-setup-and-usage.md). ```nolang auth_header=(obtain OAuth2 JWT) curl -si -H "Content-Type: application/json; charset=UTF-8" \ -H "authorization: Bearer ${auth_header}" \ "https://api.envName.{customer}.dc.vloc-dev.com/dc/app-status" HTTP/2 200 date: Thu, 04 Feb 2021 13:20:56 GMT content-type: application/json content-length: 754 x-amzn-requestid: f54bddd7-7974-4130-8ee9-85c26ede1d99 access-control-allow-origin: * access-control-allow-headers: Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token x-amz-apigw-id: aOMsrHPKFiAFh-g= access-control-allow-methods: DELETE,GET,HEAD,OPTIONS,PATCH,POST,PUT x-amzn-trace-id: Root=1-601bf4b7-190d8465428dce9b6de9e065;Sampled=0 ``` ## HTTP Status Codes and Meanings Depending on the returned HTTP status code, the error can result from the client configuration, the DCG deployment, or the data itself. ## HTTP Status Code 200 The DCG application is properly configured and working. If the body contains an error, then the issue lies in the configuration of products, offers, and other products in Salesforce. ## Error Status Code 401 Access denied. The credentials are invalid for this endpoint. Refer to the [DCG OAuth2 Setup and Usage](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-dcg-oauth2-setup-and-usage.md), ## Error Status Code 403 If you receive code 403 from the DCG application, it generally means that there’s a problem with the configuration of your client. It can be one of the following: - Wrong URL / path - Missing or misspelled headers - Client IP outside access list when allow list has been configured (endpoints are opened to the world by default). ```nolang {"message":"Authorization header requires 'Credential' parameter. Authorization header requires 'Signature' parameter. Authorization header requires 'SignedHeaders' parameter. Authorization header requires existence of either a 'X-Amz-Date' or a 'Date' header. Authorization=..."} ``` ## Error Status Code 429 HTTP error code 429 is linked to a specific use case of DCG where the exact same call is made multiple times in parallel (same payload, method, and URL within 20 seconds) and the data is not cached on the DCG platform. When this situation happens, only the first request is processed and forwarded to the Salesforce Org. The other requests are put in _waiting_ mode. If the forwarded request to Salesforce fails, it returns an HTTP error code 500 with the description of the error in the body. The other waiting requests, however, do not have access to the error context except for data still missing from the cache. At this point, the requests return Error Code 429 with the message, "Retry after some time". The waiting time is no more than 20 seconds for each waiting request. To solve this issue, it is necessary to identify and correct the initial request that returns the HTTP error code 500 (see the section below on Error Code 500). Once this request is fixed and returns a 200, then the requests returning Error Code 429 cease. ## Error Status Code 412 These codes generally indicate an issue with the DC API request itself or the data sets retrieved. The following sections describe the most common setup-related error messages with typical resolution actions. If the error message isn’t listed, and the issue isn’t self-explanatory, feel free to contact Customer Support or Professional Services. - case: **`{"message":null}`**: There’s an issue with DCG setup. contact Salesforce Customer Support. - case: **`invalid_client - invalid client credentials`**: The JWT public certificate in the Salesforce Connected Application doesn’t match the private key used by DCG. Solution: Ensure you’ve uploaded the correct public certificate for the environment (check issuer and expiration date). You can ask Customer Support to resend you the public certificate if you’re not sure. ```nolang {"timestamp":1550215547892,"status":500,"error":"Internal Server Error","message":"V3 API Exception : \"SFDC-Client: getOfferDetails API Error\" error_description: \"V3 API Exception : \"invalid_client\" error_description: \"invalid client credentials\"\"","path":"/dc/v3/catalogs/CATALOG_ID/offers/OFFER_ID"} ``` - case: **`invalid_grant - invalid assertion`**: The JWT public certificate is missing from the Salesforce Connected Application. Retrieve the public certificate sent by the Salesforce Customer Support team and add it to the connected application. Refer to the DCG Setup guide. Sample Message: ```nolang {"timestamp":1557490004994,"status":500,"error":"Internal Server Error","message":"V3 API Exception : \"SFDC-Client: getOffers API Error \" error_description: \"V3 API Exception : \"invalid_grant\" error_description: \"invalid assertion\"\"","path":"/dc/v3/catalogs/PHONES/offers"} ``` - case: **`invalid_grant - user hasn't approved this consumer`**. This error can have one of the following causes: - The Salesforce User username is invalid (for example, a typo in the username or spaces in the username) or the Salesforce Org type is incorrect (sandbox/test vs standard/login). Ensure the username and Salesforce Org type communicated are correct. - The Connected Application hasn’t been properly configured. See: [Preferred method: OAuth policy configuration for the Connected App](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-preferred-methodoauth-policy-configuration-for-the-connectedapp.md). Sample Message: ```nolang {"timestamp":1570183058235,"status":500,"error":"Internal Server Error","message":"V3 API Exception : \"SFDC-Client: getOffers API Error\" error_description: \"V3 API Exception : \"invalid_grant\" error_description: \"user hasn't approved this consumer\"\"","path":"/dc/v3/catalogs/PHONES/offers"} ``` - case: **`invalid_grant - audience is invalid`**: The OAuth2 JWT server URL is incorrect: contact Customer Support to confirm the Salesforce Org type and domain configuration. Also, see: - [OAuth 2.0 Authorization Errors](https://help.salesforce.com/articleView?id=remoteaccess_oauth_flow_errors.htm) - [How to determine the correct 'audience' and 'uri' when using OAuth 2.0 JSON Web Token (JWT) Bearer Token Flow](https://salesforce.stackexchange.com/questions/214850/how-to-determine-the-correct-audience-and-uri-when-using-oauth-2-0-json-web) on StackExchange Sample Message: ```nolang {..."invalid_grant" error_description: "audience is invalid"} ``` - case: **`invalid_client_id - client identifier invalid`**: This situation may occur after Salesforce Org Sandbox Refresh. If you performed a refresh, follow the instructions in [DCG Connected App Setup](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-dcg-connected-app-setup.md) and open a ticket with the Salesforce Industries support team to request the full reintegration. Other than an org refresh, this case means there is an internal issue with the DCG applications configuration, so contact customer support. Sample Message: ```nolang {..."status_api_message":"V3 API Exception : \"invalid_client_id\" error_description: \"client identifier invalid\""} ``` - case: **`invalid_grant authentication failure`**: the integration username is deactivated, expired or generally invalid. - Ensure the DCG integration username provided to the Salesforce Industries team for DCG integration with the SF Org is still valid. - Alternatively, raise a case with the salesforce support to re-integrate the environment using a new service account or user account for integration. Refer to the page [Digital Commerce Gateway Setup](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-dcg-setup.md) - If you don't know which integration username is in use, raise a case with the salesforce support ```nolang { "message": "invalid_grant authentication failure ", "status": 500, "error": "BAD_GATEWAY", "timestamp": 1720673080750 } ``` - case: **`HTTP ERROR 404 - Could not find a match for URL`**: The DCG and CME applications are misconfigured. Contact Customer Support to review the CME package installation method, the Salesforce Organization type, and the configured catalogs. Sample Message: ```nolang {"timestamp":1570717059452,"status":500,"error":"Internal Server Error","message":"V3 API Exception : \"SFDC-Client: getOffers API Error\" error_description: \"HTTP ERROR : Status Code: HTTP/1.1 404 Not Found, Response: [{\"errorCode\":\"NOT_FOUND\",\"message\":\"Could not find a match for URL\"}]\"","path":"/dc/v3/catalogs/SAMPLE_CATALOG/offers"} ``` ## DCG Application Timeout The DCG application is bound by multiple timeouts. The main one is the API Request Timeout of 29 seconds. No request to the DCG API takes more than 29 seconds to complete (whether successful or not). The other timeouts to be aware of are described in the following table. | Timeout | Description | | -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | API Request Timeout | The API Request Timeout is 29 seconds and can’t currently be changed for the DCG endpoints. | | Salesforce query timeout | The Salesforce query timeout from the Salesforce org side is 120 seconds (**`SOQL QUERY_TIMEOUT`**). It can’t be modified. The Salesforce query timeout from the DCG side is 25 seconds by default and can be changed by filing a ticket with Customer Success. | | Request processing timeout | For production (or other performance-optimized) API environments, the timeout of the processing of a request is 30 seconds. For non-production API environments, the timeout for processing of a request is 299 seconds (~5 minutes). Even if an API request times out at 29 seconds, the processing of that request can continue. But it's bound by the Salesforce query timeout. | # Defining Advanced Rules Using Attribute Configuration Type You can define advanced rules using the product configuration procedure and you can use advanced rules to create entity filters. Consider the following use case: You have an Apple iPhone 11 with two attributes: Color and Capacity. - Color = red, blue, or green. - Capacity = 128GB, or 256GB, or 512GB. However, the color red only comes in 256GB and not the other two capacities (128GB and 512GB). To satisfy the requirement of getting a red Apple iPhone 11 with 256GB: 1. Create Product Configuration Procedures: 1. Click App Launcher. 2. Search for Product Configuration Procedures and click the link. For more information on Product Configuration Procedures, see [Create Action Parameter JSON with Product Configuration Procedure](https://help.salesforce.com/s/articleView?id=ind.comms_create_action_parameter_json_with_product_configuration_procedure.htm). 3. Click New. 4. Do the following: - Enter a Configuration Procedure Name. - Select a product (optional). - Select an attribute and click the + icon to add it. ![Product Configuration Procedures](https://developer.salesforce.com/docs/media/dc_prodcfgproc.png) 5. Click Add Action and select ASSIGN from the list. 6. Click Select Options and select an option. ![Product Configuration Procedures - options](https://developer.salesforce.com/docs/media/dc_prodcfgproc_option.png) When the product configuration rule runs, you can apply these actions. 7. Add more actions as needed. 8. When finished, save your changes. 2. Create a Vlocity rule: 1. From the **App Launcher**, click Vlocity Rules. For more information, see [Accessing the Vlocity Rule Builder](https://help.salesforce.com/s/articleView?id=ind.comms_accessing_the_vlocity_rule_builder.htm). 2. Click New. 3. Click Edit Mode. 4. Enter a rule name and a description. 5. In the first field, select Attributes Configuration. 6. In the second field, select Order\. In the case of advanced rules, order items only apply to the header objects, which means order, quote, or opportunity. For a given basket, the Rule Builder goes through every line item and tries to match the chosen product. If there is a match, it applies the attribute you have selected as part of the Product Configuration Procedure. 7. Set the rule to Active. 8. Click Filters and click Add to Rule Filter to add any entity filters that add the attributes on the order object. 9. Click Actions. The name of the Product Configuration Procedure you created appears in the list of actions you can apply for your rule. When you run the Basket APIs and validation rules are triggered, those rules apply the actions you have in the **Filters and Actions**list for each line item in the order. For example, if you choose the Apple iPhone 11 in red, then it comes with 256GB capacity. 10. Repeat the above steps to add more conditions and actions. 11. When finished, save your changes. 3. Run the Cacheable API jobs. For more information, see [Running Cacheable API Jobs](https://help.salesforce.com/s/articleView?id=ind.comms_running_cacheable_api_jobs.htm). 4. Add the offer to the basket: 1. In your API platform, set the HTTP method to POST and add the offer to the basket: Post Basket API request: `/services/apexrest/vlocity_digital/v3/catalogs/catalogCode/basket` Post body: `{"basketAction":"addWithNoConfig","offer": "p1"}` The response will return the cart context ID. When you add the offer, the actions you defined in Vlocity Rule Builder are applied. 2. Add the bundle context to the request body, which includes the red color Apple iPhone 11 with 256GB capacity. The response should include the details about that product offering. # Defining Advanced Rules Using Configuration Type Use configuration type advanced rules to create product compatibility rules based on a condition. Compatibility rules determine if a product combination is valid. Using Compatibility Rules, you can define that, when a product is added to the cart, related products are added with it. You can also automatically add, automatically remove, or recommend products based on other products in the cart. For example, if you add more than one Samsung Galaxy S10e to the cart, then a Samsung Galaxy S20e is automatically added to the cart at no additional cost. You can also add another condition where if you purchase a modem or a mobile phone, such as a Samsung Galaxy S20e, then you get a six-month Internet plan. To define advanced rules using Configuration type: 1. Set up an interface implementation named ProductValidationInterface. For more information, see [Interfaces, Implementations, and Services](https://help.salesforce.com/s/articleView?id=ind.v_dev_t_interfacesimplementationsand_services_651813.htm) and [Adding a New Interface Implementation](https://help.salesforce.com/s/articleView?id=ind.v_dev_t_adding_a_new_interface_implementation_658122.htm). Set the default interface/Active Implementation Class to **ValidationRulesImplementation**. The interface implementation should point to Product Relationships. ![Product Validation Interface](https://developer.salesforce.com/docs/media/dc_interfaceimplement.png) 2. Create a product relationship. For more information, see [Product Relationships Overview](https://help.salesforce.com/s/articleView?id=ind.comms_product_relationships_overview.htm). ![Product relationship](https://developer.salesforce.com/docs/media/dc_productrelation.png) - Set the **Relation Type** to Auto-Add. - Set the **AddMode** to `asRoot`. The Samsung Galaxy S10e is the root. 3. Set up an Entity Filter. For more information, see [Create a Compatibility Rule](https://help.salesforce.com/s/articleView?id=ind.comms_create_a_compatibility_rule.htm). ![Set up an Entity Filter](https://developer.salesforce.com/docs/media/dc_entityfilter.png) - Make sure the quantity is greater than 1 so the **Auto-Add** works. - For **Entity Filter Conditions**, the Field/Attribute/Related Object list is populated according to your selection in the **Filter On Object Name** field. 4. From the App Launcher, click Vlocity Rules. For more information, see [Accessing the Vlocity Rule Builder](https://help.salesforce.com/s/articleView?id=ind.comms_accessing_the_vlocity_rule_builder.htm). 5. Click New. 6. Click Edit Mode. 7. Enter a rule name and a description. 8. In the first field, select Configuration. 9. In the second field, use Order Product\. Opportunity and Quote are not applicable. 10. Set the rule to Active. ![Customer SLA Rule Set](https://developer.salesforce.com/docs/media/dc_vlocityrulebuilder.png) 11. Expand the FILTERS AND ACTIONS list and click the Filters button. 12. Click Add to Rule Filter and specify the conditions to satisfy. 13. Click the Actions button and specify the action to execute to satisfy that condition. For example, if you have an order line item with Samsung Galaxy S10e, then the Samsung Galaxy S20e will be automatically added as the action to satisfy the condition. 14. Repeat the above steps to add more conditions and actions. 15. Click Save. 16. In your API platform, set the HTTP method to POST. 17. Add the Samsung Galaxy S10e product to an empty basket: `/services/apexrest/vlocity_digital/v3/catalogs/catalogCode/basket` ![Add product to an empty basket](https://developer.salesforce.com/docs/media/dc_addproduct.png) The default quantity of the Samsung Galaxy S10e is 1. The Samsung Galaxy S20e has not yet been auto-added because the condition states that the Samsung Galaxy S10e product equals 1. Once the quantity of Samsung Galaxy S10e is greater than 1, then the Samsung Galaxy S20e is automatically added. 18. Add the bundle context to the request body, which upgrades the line item quantity to 2. ![Add the bundle context to the request body](https://developer.salesforce.com/docs/media/dc_addbundlecontext.png) The Samsung Galaxy S20e is automatically added. You can update fields that are related to the cart line items/order items. Based on those fields, you can write the entity filter. You can not use any fields on the order unless they are related to the order contract. Logged-in users can pass all the entity filters that are related to Account ID and Contract ID as part of the orders. Anonymous users do not get those additional entity filters. # Defining Context Eligibility Rules The instructions in this topics explain how to apply context eligibility rules. Configure anonymous and known-user browsing for the [anonymous and known-user browsing use case](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-anonymous-and-known-user-browsing.html?q=Anonymous) Perform the following steps to create the context dimension. 1. Click App Launcher. 2. Search for **Vlocity Product Console** and click the link. 3. Click **Dashboard**, then click **Rules**, then click **Context Dimension**. 4. Click **New**. 5. Enter the required information for anonymous users or logged-in users. You do not set different context dimensions for anonymous and logged-in users. One contextdimension works for both, for example: | Field | Description | | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Name | DC_RULE_FIBER | | Code | DC_RULE_FIBER
Code must be the same as Name. | | Data Type | Text | | Domain Type | Type in | | Cacheable Mode | Enable this field | | Default Value | TRUE | | Values for caching | True, False
When you run the Populate API Cache job,these values are part of pre-warming the cache. This means the API will return all the products for the defined rule and warm the cache so whenever you get a request that says DC_RULE_FIBER=True, the response is readily available because you ran the Populate API Cache job.
If false, the response will also be readily available.
If values for caching are provided when running the Populate API Cache job, then records are created in the cache response object.
If there are no values in the Values for caching field, there is a cache miss, and when the rule is executed, the response is subsequently created. The values will then be in the cache so there will be a cache hit the next time the API GET request is made. | 6. Click Save. 7. Click the Context Mapping facet to identify Context Scope. 8. Click New Context Mapping. 9. Enter the following required information. For anonymous users (example): | Field | Description | | --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Context Scope | AccountScope.
NOTE: Context Mappings with InitializationType as Type In only work with AnyScope or AccountScope ContextScopes. | | Initialization Policy | Always Reinitialize | | Always Reinitialize | Type in
For anonymous browsing, you specify the rule criteria by defining a context dimension name.The dimension name does not need to be a field on the account record. To do this, selectType in, which allows the user to pass any context dimension value as part of the criteria to satisfy the rule condition.
If you want to use that criterion as part of a known-user scenario, for example, the customer's location, then identify the field on the context scope object, in this case, the account object. | | TypeIn Value | DC_RULE_FIBER
It is recommended that you give the TypeIn Value the same name as the ContextDimension.
The **TypeIn Value** must be a constant value that you want the context dimension to hold.
Context Mappings with Initialisation Type as TypeIn only work with AnyScope or AccountScope Context Scopes. | | Sequence | 1 | For logged-in users (example): | Field | Description | | --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Context Scope | AccountScope.
NOTE: Context Mappings with InitializationType as Type In only work with AnyScope or AccountScope Context Scopes. | | Initialization Policy | Always Reinitialize | | Initialization Type | Source Expression | | Source Expression | DC_RULE_MEMBER_STATUS\_\_c
This identifies the logged-in user contextcondition.
For known users, the Rule Engine looks for a field named DC_RULE_MEMBER_STATUS\_\_c on the Account Object to request context information about the user. For example, the logged-in user who is browsing products has a Gold-member SLA. "DC_RULE_MEMBER_STATUS" is the ContextDimension and "Gold" is the Context Value that is passed as part of the API Request. | | Sequence | 1 | 10. Click Save. Perform the following steps to create the context rule. 1. Click App Launcher. 2. Search for **Vlocity Product Console** and click the link. 3. Click **+** icon next to the **Rules** item in the menu. 4. Enter the following required information. For anonymous users (example): | Field | Description | | --------------- | ----------------------- | | Name | DC_RULE_FIBER_AVAILABLE | | Code | DC_RULE_FIBER_AVAILABLE | | Expression Mode | or | For logged-in users (example): | Field | Description | | --------------- | --------------------- | | Name | DC_RULE_MEMBER_STATUS | | Code | DC_RULE_MEMBER_STATUS | | Expression Mode | or | 5. Click Save. 6. Click Rule Condition. 7. Click Add Condition. 8. Enter the following required information. For anonymous users (example): | Field | Description | | ------------------------ | ---------------------------- | | Code | DC_RULE_FIBER_AVAILABLE_COND | | Context Dimension | DC_RULE_FIBER | | Operator | == | | Value | TRUE | | Default Expression Value | Enable this setting. | For logged-in users (example): | Field | Description | | ------------------------ | -------------------------- | | Code | DC_RULE_MEMBER_STATUS_COND | | Context Dimension | DC_RULE_MEMBER_STATUS | | Operator | == | | Value | Gold | | Default Expression Value | Enable this setting. | 9. Click Save. Perform the following steps to create rule set. 1. Click App Launcher. 2. Search for **Vlocity Product Console** and click the link. 3. Click **+** icon next to the **Rules Set** item in the menu. 4. Enter the following required information. For anonymous users (example): | Field | Description | | --------------- | ----------------------- | | Name | DC_RULE_FIBER_AVAILABLE | | Rule Type | Qualification | | Rule Purpose | Eligibility | | Expression Mode | or | For logged-in users (example): | Field | Description | | --------------- | --------------------- | | Name | DC_RULE_MEMBER_STATUS | | Rule Type | Qualification | | Rule Purpose | Eligibility | | Expression Mode | or | You can create a single rule set by combining rules for Fiber and MemberStatus by applying expression mode or and executing it using a URI to pass two different context parameters separated by a comma. For an anonymous user, an example is: `/services/apexrest/vlocity_cmt/v3/catalogs/MOBILE/offers?context={"DC_RULE_MEMBER_STATUS":"Gold","DC_RULE_FIBER_AVAILABLE":"True"}`. You can pass two or more dimension parameters as part of the API request. You can also create a rule set that calls two different rules that point to two different context dimensions, in this case, Fiber and Member Status. When you call the URI, you could pass only one dimension name, Fiber, and not Member Status, andthat will satisfy the rule. If you have two or more context dimensions defined with an OR condition but you pass just one of them in the request body, then the defined default value is used for the other context dimension. If you write a URI for Member Status and Fiber Available = True, but there is no value for Member Status, then do not include the parameter value so Digital Commerce does not try to process the null value. Instead, Digital Commerce uses the specified default value for the context dimension value. If you have defined the default value for DC_RULE_FIBER_AVAILABLE as True, then the request URI skips passing the DC_RULE_FIBER parameter. 5. Click Save. 6. Click the Children Rules facet. 7. Click New Child Rule. 8. Add the rule and the sequence. 9. Click Save. 10. Add more child rules as necessary according to the previous steps. Perform the following steps to apply the rule set to the product. 1. Click App Launcher. 2. Search for Vlocity Product Console and click the link. 3. Click the Search icon next to the Product item in the menu. 4. Search for Fiber Broadband 100 and open it. 5. Click Context Rules. 6. Click Add Rule Set and search for the DC_RULE_FIBER_AVAILABLE rule. 7. Repeat the above steps for the DC_RULE_MEMBER_STATUS rule. 8. Click Save. ## Test the Cacheable GetOffer API with Context Rule. Before testing the API, you must first run the Populate API Cache job or run theRegenerate Cached API Records job if you are making changes to an existing productcatalog. Perform the following steps to test the API. 1. Navigate to Postman. 2. Check to Agree to terms of service. 3. Click login with Salesforce. 4. Select Utilities→REST Explorer in the top menu. 5. Leave GET as HTTP selected method. 6. Enter the following URL for anonymous users (example). `/services/apexrest/vlocity_cmt/v3/calatogs/FIBER/offers?context={"DC_RULE_FIBER":"true"}` Here accountStatus and AccountSLA have an OR condition with each other, so wecan pass either one of these parameters or both. `/services/apexrest/vlocity_cmt/v3/calatogs/FIBER/offers?context={"AccountStatus":"Active"}` `/services/apexrest/vlocity_cmt/v3/calatogs/FIBER/offers?context={"AccountSLA":"Gold"}` `/services/apexrest/vlocity_cmt/v3/calatogs/FIBER/offers?context={"AccountStatus":"Active","AccountSLA":"Gold"}` The default value is chosen if you create a rule set with two rules pointing to two different dimension names and only one dimension parameter is passed when invoking the API. For logged-in users (example): `/services/apexrest/vlocity_cmt/v3/calatogs/FIBER/offers?context={“AccountID”:“xxxxx”}&isloggedin=true` `/services/apexrest/vlocity_cmt/v3/calatogs/FIBER/offers?context={“AccountID”:“xxxxx”,"AssetStatus":"Active"}&isloggedin=true` You are specifying the context map in the URL. 7. Click Execute. If fiber technology is available, the API returns a list of products including the Fiber Broadband 100 product and a special reduction in price that is only available for known users who are Gold members. **important:** Similar to the way in which we have created rules to determine the eligibility of products, you can also determine the eligibility of a promotion or qualify for specific price list entries by applying a context eligibility rule. However, applying acontext eligibility rule for a price list entry is only available for known user browsing specific to the getOfferDetails API and the price list entry is returned as part of the results. # Delete Adjustment Delete an applied price adjustment for a line item in the cart, such as a discount, mark up, or override. The PricingElementServiceImplementation supports this API. ```nolang POST /v2/cpq/carts/{cart_ID}/items/{ID}/pricing/{adjustment_ID} ``` **note:** Prior to the Fall '20 release, the deleteAjustment API included a call to getCartsItems. However, from the Fall '20 release, this API no longer calls getCartsItems. If you call this API directly in custom code, ensure that you add a call to getCartLineItemPrices in your code, after calling the deleteAdjustment API. The response from this API has been updated to include the itempricesupdated action to make a call to the next API. 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 ```nolang deleteAdjustment ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | -------------------------------------------------------------------------------------- | | Resource URL | /services/apexrest/{namespace}/v2/cpq/carts/{cartId}/items/{id}/pricing/{adjustmentId} | ## Example Request ```nolang POST /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000iJIZAA2/items/80246000000iuDbAAI/pricing/a2H46000000hj2ZEAQ { "adjustments": [ { "AdjustmentValue": -10, "AdjustmentMethod": "Absolute", "DetailType": "ADJUSTMENT", "Field": "nv_cmt_dev__OneTimeCharge__c" } ] } ``` ## Example result **note:** This example has been truncated. ```nolang { "totalSize": 1, "messages": [], "records": [ { "messages": [], "actions": { "addtocart": { "rest": { "params": { "items": [ { "quantity": 1, "parentId": "80246000000hhNzAAI", "itemId": "01u46000001Z8aCAAS" } ], "cartId": "80146000000h5jmAAA", "price": true, "validate": true, "includeAttachment": false, "pagesize": 20, "lastRecordId": null, "query": null }, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items" }, "remote": { "params": { "methodName": "postCartsItems", "items": [ { "quantity": 1, "parentId": "80246000000hhNzAAI", "itemId": "01u46000001Z8aCAAS" } ], "cartId": "80146000000h5jmAAA", "price": true, "validate": true, "includeAttachment": false, "pagesize": 20, "lastRecordId": null, "query": null } }, "client": { "params": {} } }, "updateitems": { "rest": { "params": { "items": [ { "itemId": "80246000000hhNzAAI" } ], "filters": null, "fields": null, "cartId": "80146000000h5jmAAA", "price": true, "validate": true, "includeAttachment": false, "pagesize": 20, "lastRecordId": null, "query": null }, "method": "PUT", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items" }, "remote": { "params": { "methodName": "putCartsItems", "items": [ { "itemId": "80246000000hhNzAAI" } ], "filters": null, "fields": null, "cartId": "80146000000h5jmAAA", "price": true, "validate": true, "includeAttachment": false, "pagesize": 20, "lastRecordId": null, "query": null } }, "client": { "params": {} } }, "deleteitem": { "rest": { "params": {}, "method": "DELETE", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhNzAAI?pagesize=20&includeAttachment=false&validate=true&price=true&cartId=80146000000h5jmAAA&id=80246000000hhNzAAI" }, "remote": { "params": { "methodName": "deleteCartsItems", "id": "80246000000hhNzAAI", "filters": null, "fields": null, "cartId": "80146000000h5jmAAA", "price": true, "validate": true, "includeAttachment": false, "pagesize": 20, "lastRecordId": null, "query": null } }, "client": { "params": {} } }, "cloneitem": { "rest": { "params": { "items": [ { "itemId": "80246000000hhNzAAI" } ], "id": "80246000000hhNzAAI", "cartId": "80146000000h5jmAAA" }, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/clone" }, "remote": { "params": { "methodName": "cloneItems", "items": [ { "itemId": "80246000000hhNzAAI" } ], "id": "80246000000hhNzAAI", "cartId": "80146000000h5jmAAA" } }, "client": { "params": {} } }, "modifyattributes": { "rest": { "params": { "items": [ { "itemId": "80246000000hhNzAAI" } ], "filters": null, "id": "80246000000hhNzAAI", "cartId": "80146000000h5jmAAA" }, "method": "PUT", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/items/80246000000hhNzAAI/itemAttributes" }, "remote": { "params": { "methodName": "putItemAttributes", "items": [ { "itemId": "80246000000hhNzAAI" } ], "filters": null, "id": "80246000000hhNzAAI", "cartId": "80146000000h5jmAAA" } }, "client": { "params": {} } }, "getpromodetails": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000h5jmAAA/promotions?cartId=80146000000h5jmAAA&id=80246000000hhNzAAI&promotionIds=a2F46000000kmtNEAQ&subaction=promodetails" }, "remote": { "params": { "methodName": "getPromotionDetails", "subaction": "promodetails", "promotionIds": "a2F46000000kmtNEAQ", "id": "80246000000hhNzAAI", "cartId": "80146000000h5jmAAA" } }, "client": { "params": {} } } }, "displaySequence": -1, "Id": { "value": "80246000000hhNzAAI", "previousValue": null, "originalValue": null, "messages": [], "label": "Order Product ID", "hidden": false, "fieldName": "Id", "editable": false, "dataType": "ID", "actions": {} }, "Pricebook2Id": "01s46000003EDDHAA4", "Product2Id": "01t46000000Lo2mAAC", "ProductCode": "BUNDLE_A", "UnitPrice": { "value": 0, "previousValue": null, "originalValue": null, "messages": [], "label": "Unit Price", "hidden": true, "fieldName": "UnitPrice", "editable": false, "dataType": "CURRENCY", "actions": {} }, "Name": "Bundle A", "vlocity_cmt__RecurringPrice__c": 0, "IsActive": true, "Product2": { "attributes": { "type": "Product2", "url": "/services/data/v39.0/sobjects/Product2/01t46000000Lo2mAAC" }, "Id": "01t46000000Lo2mAAC", "Description": "Bundle A", "Name": "Bundle A", "vlocity_cmt__IsConfigurable__c": false, "vlocity_cmt__Type__c": "None", "vlocity_cmt__SubType__c": "None", "RecordTypeId": "01246000000hFtZAAU", "vlocity_cmt__JSONAttribute__c": null }, ``` # Delete Applied Promo Items Delete applied promotion items from cart. ```nolang DELETE /v2/cpq/carts/{cart_ID}/promotions ``` 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. For additional information, ​see [UserSecurity Class](https://help.salesforce.com/s/articleView?id=ind.v_admin_usersecurity_class_28364.htm&type=5) and [CPQ and Digital Commerce Changes for Guest Users](https://help.salesforce.com/s/articleView?id=ind.v_admin_cpq_and_digital_commerce_changes_for_guest_users_27958.htm&type=5). **NOTE:** - This API runs eligibility check against all promotions added to the cart during the deletion of a selected promotion. - When the applied promotion is Cancelled/Disconnected before the expiration date, ensure to parallely maintain the following fields. - `vlocity_cmt__CommitmentEndDate__c` for Order Applied Promotion with end-dated - `vlocity_cmt__EstimatedEndDate__c` for Order Pricing with end-dated ## Remote Method ```nolang deletePromotionItems ``` ## REST Handler ```nolang APIPromotionsCartsCpqV2 ``` ## Apex Remote Service ```nolang CpqAppHandler ``` ## Apex Remote Input Map ```nolang { "id": "a2Lf40000008nL5EAI", "cartId": "801f40000012NEIAA2", "methodName": "deleteAppliedPromoItems", "price": true, "validate": true } ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | ------------------------------------------------------------------ | | Resource URL | `/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/promotions` | ## Example Request ```nolang DELETE /services/apexrest/vlocity_cmt/v2/cpq/carts/801f40000012NEIAA2/promotions Request Body: { "id": "a2Lf40000008nL5EAI", "cartId": "801f40000012NEIAA2", "methodName": "deleteAppliedPromoItems", "price": true, "validate": true } ``` ## Example Response ```nolang { "totalSize": 0, "messages": [ { "severity": "INFO", "messageId": null, "message": "Successfully deleted.", "code": "152", "bundleId": null, "actions": {} } ], "actions": { "itemdeleted": { "rest": { "params": {}, "method": null, "link": null }, "remote": { "params": {} }, "client": { "params": { "items": [ { "message": "add TestProd-12 bundle has been deleted from the cart.", "Id": "a2Lf40000008nL5EAI" } ] } } } } } ``` ### Add with noResponseNeeded=true ```nolang { "totalSize": 0, "messages": [ { "code": "150", "severity": "INFO", "message": "Successfully added." } ], "actions": { "itempricesupdated": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/801xx000003H4WlAAK/price?price=false&cartId=801xx000003H4WlAAK" }, "remote": { "params": {} }, "client": { "params": {} } } } } ``` # Delete Applied Promo Items ## Overview The Delete Applied Promotion API is a one-stop call that cleanly removes a promotion, and anything it added to the cart, in a single, safe step. Why it matters - All-in-one cleanup – The moment the promotion is deleted, the API can also delete any free or discounted products the promo injected. - Automatic price correction – It immediately re-calculates totals, taxes, and recurring fees so the cart shows the real price after the promo is removed. - Rule protection – It re-runs the same product-compatibility and bundle rules that run at checkout, catching problems (like bundle-quantity minimums). - Atomic safety – Everything happens in one transaction. If any step fails, nothing is saved, so the cart is never left in a half-updated state. What you send and what you get back - You pass the cart Id, the promotion Id (or a comma-separated list), and a few simple flags—price and validate—that say whether you want the system to re-price and re-validate right away.
- The response tells you: 1. Whether the delete succeeded 2. Any follow-up actions (like "prices updated") 3. A structured list of info/warning/error messages ``` DELETE /v2/cpq/carts/{cart_Id}/promotions?id={PROMOTION_ID} ``` 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. ## Rest Handler ``` APIPromotionsCartsCpqV2 ``` ## Rest Method ``` deletePromotionItems ``` ## Remote Service ``` CpqAppHandler ``` ## Remote Method ``` deleteAppliedPromoItems ``` ## Apex Remote Input Map ``` Map inputMap = new Map{ 'cartId' => '{CART_ID}', 'id' => '{PROMOTION_ID}', 'validate' => true, 'price' => true }; Map outputMap = new Map(); Map optionsMap = new Map(); CpqAppHandler handler = new CpqAppHandler(); handler.invokeMethod('deleteAppliedPromoItems', inputMap, outputMap, optionsMap); ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | ------------------------------------------------------------------ | | Resource URL | `/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/promotions` | ## Example Request ``` DELETE /services/apexrest/vlocity_cmt/v2/cpq/carts/801xx000003H0D1AAK/promotions?id=a35xx000000rOLhAAM&price=true&validate=true ``` ## Example Response ``` { "totalSize": 0, "messages": [ { "code": "152", "severity": "INFO", "message": "Successfully deleted." } ], "actions": { "itempricesupdated": { "rest": { "params": { }, "method": null, "link": null }, "remote": { "params": { "cartId": "801xx000003H0JTAA0", "price": false, "methodName": "getCartLineItemPrices" } }, "client": { "params": { } } }, "itemdeleted": { "rest": { "params": { }, "method": null, "link": null }, "remote": { "params": { "items": [ { "message": "Test_Promo has been deleted from the cart.", "Id": "a35xx000000rOLhAAM" } ] } }, "client": { "params": { "items": [ { "message": "Test_Promo has been deleted from the cart.", "Id": "a35xx000000rOLhAAM" } ] } } } } } ``` # Delete Discount from a Cart The deleteCartDiscount is a core transactional API in Salesforce Industries CPQ that removes a discount (Account / Contract / Order Type) from a cart, then automatically re-prices the cart and re-validates it against cardinality rules. This functionality is available only through the remote Apex entry point `CpqAppHandler.deleteCartDiscount` and is not exposed via any REST endpoint. **Functional Summary** - Removes the discount line(s) referenced by the input `id` parameter from the cart identified by `cartId`. - Cascades re‑price & cardinality validation – invoke the pricing pipeline and the validation pipeline so recurring, one‑off and usage charges remain accurate and bundle constraints stay intact. - Returns a structured `actions` map (`itempricesupdated`, `itemdeleted`) plus `messages[]`, enabling user‑interfaces to refresh prices and display toast notifications with no additional queries. **Preconditions** - The cart is in an editable state (Draft/In‑Progress). - `id` belongs to a discount that is already linked to the cart. - Caller has Delete permission on the discount object (enforced by CRUD/FLS checks within service layer). **Post-Conditions** - Target discount rows and dependent price adjustment records are deleted. - Cart price totals are recalculated and persisted. - Cardinality checks pass; otherwise the entire transaction rolls back. - Client receives `actions` + `messages` for immediate UI refresh. **Transactional Guarantees & Error Handling** - Entire flow executes in a single Apex transaction – any unhandled exception rolls back cart changes. - Error payload follows the Standard Cart API schema (`code`, `severity`, `message`). ## Apex Remote Service ```nolang CpqAppHandler ``` ## Remote Method ```nolang deleteCartDiscount ``` ## Apex Remote Input Map ```nolang Map inputMap = new Map{ 'methodName' => 'deleteCartDiscount', 'id' => '{DISCOUNT_ID}', 'cartId' => '{CART_ID}', 'price' => {BOOLEAN} }; Map outputMap = new Map(); Map optionsMap = new Map(); CpqAppHandler handler = new CpqAppHandler(); handler.invokeMethod('deleteCartDiscount', inputMap, outputMap, optionsMap); ``` | Parameter | Type | Description | Required | Default Value | | --------- | ------- | ---------------------------------------------------------------------------------------------- | -------- | ------------- | | id | String | Salesforce Id of the discount to be removed. | Yes | | | cartId | String | Salesforce Id of the cart (Opportunity/Quote/Order) from which the discount has to be removed. | Yes | | | price | Boolean | Indicates whether to run the pricing engine (true) or not (false). | | TRUE | ## Package Communication (vlocity_cmt) ## Example Request ```nolang Map inputMap = new Map{ 'methodName' => 'deleteCartDiscount', 'id' => 'a5Txx0000004DjQEAU', 'cartId' => '801xx000003GzLnAAK', 'price' => true }; Map outputMap = new Map(); Map optionsMap = new Map(); CpqAppHandler handler = new CpqAppHandler(); handler.invokeMethod('deleteCartDiscount', inputMap, outputMap, optionsMap); ``` ## Example Response ```nolang { "actions": { "itempricesupdated": { "client": { "params": { } }, "remote": { "params": { "cartId": "801xx000003GzLnAAK", "price": false, "methodName": "getCartLineItemPrices" } }, "rest": { "method": null, "link": null, "params": { } } }, "itemdeleted": { "client": { "params": { "methodName": "getCartLineItemPrices", "items": [ { "message": "TestDisc has been deleted from the cart.", "Id": "a5Txx0000004DuiEAE" } ] } }, "remote": { "params": { "items": [ { "message": "TestDisc has been deleted from the cart.", "Id": "a5Txx0000004DuiEAE" } ] } }, "rest": { "method": null, "link": null, "params": { } } } }, "messages": [ { "message": "TestDisc has been deleted from the cart.", "severity": "INFO", "code": "200" } ] } ``` **Response Shape** - **actions.itempricesupdated** – To trigger a follow‑up call to `getCartLineItemPrices` so the UI can redraw totals. - **actions.itemdeleted** – Contains a client‑side toast payload indicating that the discount has been deleted from the cart. - **messages[]** – Top‑level array with readable outcome and HTTP‑style code (200 = success). ## Error Messages and their Descriptions | Message | Description | | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | | Action is invalid | Line Item action is incorrect. | | Changes are not allowed because they cause updates in product(s) {PRODUCT_NAME that is read-only. | If the IsChangesAllowed\_\_c is set to False on the line item, then updating it is not allowed. | | Compiled Data with key '{KEY}' not found | The CachedAPIResponse\_\_c does not contain the '{KEY}' CacheKey for the latest and active ConfigurationSnapshotId. | | CPQInvalidPriceList | No Pricelist associated with the cart. | | CPQUnableToDeleteOrderActivated | Cannot delete discount since the Order is Activated. | | Invalid account id 'CART_ID' . | Empty cartId input parameter or invalid cart type. | | InvalidAccountId | Cart not associated with an Account. | | Invalid attribute values found. | Issue with the AttributeSelectedValues\_\_c. | | No Header Object found. | Invalid Cart Id. | | No product compiled data found. | No data related to the product in transaction has been found in the CachedAPIResponse\_\_c. | | Not able to query - {SOBJECT} | Error while performing a query on the SObject. | | PricebookEntry not found for product : {PRODUCT_ID} with globalGroupKey {PRODUCT_GGK} | PricebookEntry information of the product in transaction is not found in the CartDocument. | | This line item has been deleted already | When the delete discount is being performed on a disconnected line item. | | Unable to Delete Discount | Discount was not deleted due to an issue. | | Unable to populate selected attribute values | Error while populating the Selected Attribute Values in the CartDocument. | # Delete From Basket The delete from basket API deletes a root product, child product, or a promotion from the basket. The root product deletion could either be through a bundle number or by passing the bundle context key in the input with action as deleteFrom basket. ## Delete by Bundle Number The core services include the version information in their key computation. The system gets the basket from the cartContextKey passed in the input, removes the bundle corresponding to the bundle number, and computes the cache key. If the cache is found against that key, it is returned. If it is not found, then order line items are created by cloning the bundles from the existing basket and running validation and pricing with today’s reference dates. The response is cached with the effectivity as a subset of the timeslices of the offer bundles present in the basket. ![Delete from Basket - Delete by Bundle Number](https://developer.salesforce.com/docs/media/dc_deletebybundleno_api.png) ## Delete Product The other variation of delete product from the basket takes the bundle context and line item key in the input body. The request parameters can be found in the deleteFrombasket action on the line item. If the bundle context key and line item key are the same, then the root product is deleted. If the bundle context key and line item key are different, then the child product is deleted. With versioning enabled, the core flow of _delete product_ remains the same. The underlying services of the cart context key computation and validations take the version information and reference dates of the root product addition. Basket creation includes validation, pricing, and caching services. The new basket, after removing the child product, is cached with the same effectivity as that of the existing basket. However, if the action was removal of the root product, then the cache effectivity is recalculated and the basket is cached with the new cache effectivity dates. ![Delete From Basket - Delete Product](https://developer.salesforce.com/docs/media/dc_deleteproduct_api.png) ## Delete Promotion This Delete Promotion API deletes the promotion in the bundle. The API operates in two modes when the delete services function is enabled. The promotional products are also deleted along with the promotion. If the delete service custom setting is false, only the promotion is removed. Validation, pricing, response generation, and caching services include: - Versioning information. - Caching of the response with recomputed time slices effectivity. - Additional fields in the basket response. - Caching the basket creation. - Root item addition dates. - Passing of the reference dates in the pricing and validation services. ![Delete From Basket - Delete Promotion](https://developer.salesforce.com/docs/media/dc_deletepromotion_api.png) ## Update Product The Update Existing Basket API is a PUT operation and is used to update the product in an existing basket. The API can be used to update the quantity, attributes values, or other custom fields of a product. While validating the basket, the offer’s version is validated. Other processes, such as generating keys, pricing, and validating the updated basket consider the version information. In case of a cache miss, while storing the details in the cache, the cache effectivity dates will depend on the product type being updated. The cache effectivity dates of the old basket are used. ![Delete From Basket - Update Product](https://developer.salesforce.com/docs/media/dc_updateproduct_api.png) # Delete Picklist Items Delete picklist items in Vlocity Product Console by specifying them in the URI. ```nolang DEL /v2/epc/picklists/{picklist_ID}/items/{item_ID} ``` ## Remote Method ```nolang deletePicklistValue ``` ## REST Handler ```nolang APIPicklistItemRestHandler ``` ## Apex Remote Service ```nolang PCAppHandler ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see the [Swagger (OpenAPI) reference documentation for Industries EPC REST APIs](https://developer.salesforce.com/docs/industries/cme/references/epc?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | --------------------------------------------------------------------- | | Resource URL | `/services/apexrest/{namespace}/v2/epc/{picklist_ID}/items/{item_ID}` | ## Example Request ```nolang DELETE /v2/epc/picklists/a313h000000rqfbAAA/items/a313h000000rqfRAAQ ``` ## Example Result ``` { "epcResponse": { "entities": [ { "entity": { "attributes": { "type": "vlocity_cmt__Picklist__c", "url": "/services/data/v52.0/sobjects/vlocity_cmt__Picklist__c/a313h000000rqfbAAA" }, "Id": "a313h000000rqfbAAA" } } ], "overallResult": "success" } } ``` # Delete Picklists Delete picklists in Vlocity Product Console by specifying them in the URI. ```nolang DEL /v2/epc/picklists/{picklist_ID} ``` ## Remote Method ```nolang deletePicklist ``` ## REST Handler ```nolang APIPicklistRestHandler ``` ## Apex Remote Service ```nolang PCAppHandler ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see the [Swagger (OpenAPI) reference documentation for Industries EPC REST APIs](https://developer.salesforce.com/docs/industries/cme/references/epc?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | --------------------------------------------------------------- | | Resource URL | `/services/apexrest/{namespace}/v2/epc/picklists/{picklist_ID}` | ## Example Request ```nolang DELETE /v2/epc/picklists/a313h000000rqfRAAQ ``` ## Example Result ``` { "epcResponse": { "entities": [ { "entity": { "attributes": { "type": "vlocity_cmt__Picklist__c", "url": "/services/data/v52.0/sobjects/vlocity_cmt__Picklist__c/a313h000000rqfRAAQ" }, "Id": "a313h000000rqfRAAQ" } } ], "overallResult": "success" } } ``` # Delete Product Child Items Product child items (PCIs) are products associated with a bundle of products or services. A product can have one or more PCIs. Delete PCIs using the `productchilditems` API call. - ```nolang DEL v2/epc/productchilditems?ids={productchilditem-ID} ``` ```` - ```nolang DEL v2/epc/productchilditems/{productchilditem-ID} ```` ## Remote Method ```nolang deletePCI ``` ::include{src="../../shared/section_4123cb1a26ff504194c817523bc07586.md"} ::include{src="../../shared/section_e19c74036499bf2a717d7fc5a0852bcd.md"} ::include{src="../../shared/section_0fcf481610065fd34ff442609bf2bba9.md"} ::include{src="../../shared/section_8dbb11b5b7cb6e771157050052d6eeed.md"} ## Resource Information | Response Format | JSON | | --------------- | ----------------------------------------------------------------------------------- | | Resource URL | `/services/apexrest/{namespace}/v2/epc/productchilditems?ids={productchilditem-ID}` | ## Example Requests ```nolang DELETE v2/epc/productchilditems?ids=01t3h000002uJVSAA2 ``` ```nolang DEL v2/epc/productchilditems/01t3h000002uJVSAA2 ``` ## Example Result ``` [ { "epcResponse": { "entities": [], "pageInfo": {}, "overallResult": "success", "warningMessage": [] } } ] ``` # Delete Product Objects Delete products in Vlocity Product Console by specifying them in the request body. - ```nolang DEL /v2/epc/products?ids={product-ID} ``` ```` - ```nolang DEL /v2/epc/products/{product-ID} ```` ## Remote Method ```nolang deleteProduct2 ``` ::include{src="../../shared/section_a928218bc856553066f3327382143bf4.md"} ::include{src="../../shared/section_e19c74036499bf2a717d7fc5a0852bcd.md"} ::include{src="../../shared/section_0fcf481610065fd34ff442609bf2bba9.md"} ::include{src="../../shared/section_8dbb11b5b7cb6e771157050052d6eeed.md"} ## Resource Information | Response Format | JSON | | --------------- | ----------------------------------------------------------------- | | Resource URL | `/services/apexrest/{namespace}/v2/epc/products?ids={product-ID}` | ## Example Requests - ```nolang DELETE v2/epc/products?ids=01t3h000002uJVSAA2 ``` ```` - ```nolang DELETE v2/epc/products/01t3h000002uJVSAA2 ```` ## Example Result ``` { "epcResponse": { "entities": [ { "entity": { "attributes": { "type": "Product2", "url": "/services/data/v52.0/sobjects/Product2/01t3h000001h1mYAAQ" }, "Id": "01t3h000001h1mYAAQ", "vlocity_cmt__GlobalGroupKey__c": "359f10d7-cd58-d516-4ef2-e40958e6a403" } } ], "overallResult": "success" } } ``` # Delete Promotion Items Delete promotion items in Vlocity Product Console by specifying them in the URI. ```nolang DEL /v2/epc/promotions/{promotion_ID}/items/{item_ID} ``` ## Remote Method ```nolang deletePromotionItem ``` ## REST Handler ```nolang APIPromotionItemRestHandler ``` ## Apex Remote Service ```nolang PCAppHandler ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see the [Swagger (OpenAPI) reference documentation for Industries EPC REST APIs](https://developer.salesforce.com/docs/industries/cme/references/epc?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | --------------------------------------------------------------------------------- | | Resource URL | `/services/apexrest/{namespace}/v2/epc/promotions/{promotion_ID}/items/{item_ID}` | ## Example Request ```nolang DELETE /v2/epc/promotions/a3K3h0000006Ae0EAE/items/a3J3h000000I4KKEA0 ``` ## Example Result ``` { "epcResponse": { "entities": [ { "entity": { "attributes": { "type": "vlocity_cmt__PromotionItem__c", "url": "/services/data/v52.0/sobjects/vlocity_cmt__PromotionItem__c/a3J3h000000I4KKEA0" }, "Id": "a3J3h000000I4KKEA0" } } ], "overallResult": "success" } } ``` # Delete Promotions Delete promotions in Vlocity Product Console by specifying them in the URI. - ```nolang DEL /v2/epc/promotions?ids={promotions-id} ``` ```` - ```nolang DEL /v2/epc/promotions/{promotions-id} ```` ## Remote Method ```nolang deletePromotion ``` ::include{src="../../shared/section_1b550308f050bdcd217cc8b49d44dd23.md"} ::include{src="../../shared/section_e19c74036499bf2a717d7fc5a0852bcd.md"} ::include{src="../../shared/section_0fcf481610065fd34ff442609bf2bba9.md"} ::include{src="../../shared/section_8dbb11b5b7cb6e771157050052d6eeed.md"} ## Resource Information | Response Format | JSON | | --------------- | ---------------------------------------------------------------------- | | Resource URL | `/services/apexrest/{namespace}/v2/epc/promotions?ids={promotions-id}` | ## Example Request - ```nolang DELETE v2/epc/promotions?ids=a3K3h0000006AiyEAE ``` ```` - ```nolang DELETE v2/epc/promotions/a3K3h0000006AiyEAE ```` ## Example Result ``` { "epcResponse": { "entities": [ { "entity": { "attributes": { "type": "vlocity_cmt__Promotion__c", "url": "/services/data/v52.0/sobjects/vlocity_cmt__Promotion__c/a3K3h0000006AiyEAE" }, "Id": "a3K3h0000006AiyEAE" } } ], "overallResult": "success" } } ``` # Delete String Translations Delete the specified string translation. ```nolang DELETE /v2/stringtranslations/ID ``` ## Apex Remote Service ```nolang APIHandler ``` ## Remote Method ```nolang deleteStringTranslations ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). # Delete Template Deletes a Sales Configuration Template, with an option to also delete the underlying template Quote or Order. ## Resource Information - **Resource URL:** `/services/apexrest//v1/cpq/templates/{templateId}` - **HTTP Method:** DELETE - **Content-Type:** application/json - **Response Format:** JSON ## URL Parameters | Parameter | Type | Required | Description | | -------------------- | ------- | -------- | -------------------------------------------------------------------------------- | | templateId | String | Yes | The SalesConfigTemplate\_\_c record ID. | | deleteTemplateRecord | Boolean | No | If true, also deletes the underlying template Quote or Order and its line items. | | forceDelete | Boolean | No | If true, allows deletion of templates in Approved status. | ## Example REST Request `DELETE /services/apexrest/vlocity_cmt/v1/cpq/templates/a1Bxx0000004XyzDEF?deleteTemplateRecord=true&forceDelete=false` ## Example REST Response Success Response (200): ``` { "success": true, "errorCode": "INVOKE-200", "error": "OK", "result": { "messages": [], "records": [ { "deletedTemplateId": "a1Bxx0000004XyzDEF", "deletedTemplateRecordId": "0Q0xx0000004CabCAE" } ] } } ``` ## Response Parameters | Parameter | Type | Description | | ----------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------ | | deletedTemplateId | String | The ID of the deleted SalesConfigTemplate\_\_c record. | | deletedTemplateRecordId | String | The ID of the deleted underlying Quote or Order (only present when deleteTemplateRecord was true and the record was successfully deleted). | # Delete Template Deletes a Sales Configuration Template, with an option to also delete the underlying template Quote or Order. ## Resource Information - **Resource URL:** `/services/apexrest//v1/cpq/templates/{templateId}` - **HTTP Method:** DELETE - **Content-Type:** application/json - **Response Format:** JSON ## URL Parameters | Parameter | Type | Required | Description | | -------------------- | ------- | -------- | -------------------------------------------------------------------------------- | | templateId | String | Yes | The SalesConfigTemplate\_\_c record ID. | | deleteTemplateRecord | Boolean | No | If true, also deletes the underlying template Quote or Order and its line items. | | forceDelete | Boolean | No | If true, allows deletion of templates in Approved status. | ## Example REST Request `DELETE /services/apexrest/vlocity_cmt/v1/cpq/templates/a1Bxx0000004XyzDEF?deleteTemplateRecord=true&forceDelete=false` ## Example REST Response Success Response (200): ``` { "success": true, "errorCode": "INVOKE-200", "error": "OK", "result": { "messages": [], "records": [ { "deletedTemplateId": "a1Bxx0000004XyzDEF", "deletedTemplateRecordId": "0Q0xx0000004CabCAE" } ] } } ``` ## Response Parameters | Parameter | Type | Description | | ----------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------ | | deletedTemplateId | String | The ID of the deleted SalesConfigTemplate\_\_c record. | | deletedTemplateRecordId | String | The ID of the deleted underlying Quote or Order (only present when deleteTemplateRecord was true and the record was successfully deleted). | # deleteMembers Method Deletes the selected members from one or multiple groups. ## Class ## Input Parameters | Parameter | Required | Description | | ---------- | --------------------------- | ----------------------------------------------------------------------------------------------- | | parentId | Required | Opportunity ID. | | contextId | Required | Parent cart ID (Master or Enterprise Quote or Order ID) | | memberType | Required | CPQ Group Member Type Name. For example: ServicePoint. | | cartType | Optional: Defaults to Quote | Quote or Order | | memberIds | Required | List of Member IDs to delete. These members can belong to different groups of this parent cart. | ## Output Parameters | Parameter | Description | | --------- | --------------------- | | message | In case of any error. | ## Example Input Data ``` {"memberIds":["a4o0b000000VN99AAG","a4o0b000000VN9DAAW"],"memberType":"ServicePoint","parentId":"0060b00000vGbYbAAK","contextId":"0Q00b000000znTYCAY","cartType":"Quote"} ``` ## Example Output Data ``` {"error":"OK"} ``` # Delivery Date Range The delivery date range with the earliest and latest allowed dates in YYYY-MM-DD format. ## JSON example ```json { "earliestDeliveryDate": "2026-09-11", "latestDeliveryDate": "2026-10-09" } ``` ## Properties | Property Name | Type | Description | Filter Group and Version | Available Version | | ---------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------- | ------------------------ | ----------------- | | `earliestDeliveryDate` | String | The earliest allowed delivery date, in YYYY-MM-DD format. | Small, 68.0 | 68.0 | | `latestDeliveryDate` | String | The latest allowed delivery date, in YYYY-MM-DD format. Omitted when no upper bound is configured on the order specification. | Small, 68.0 | 68.0 | # Derive Aggregate Entities The Derive Aggregate Entities batch derives the aggregate entities that are affected by changes made on the listed sObjects. A change can be any of the CRUD operations, where a new entity is created, modified, or deleted from the system. CRUD operations mark the catalogs or the offers affected by this change and derive the type of the affected change. This information is the data set on which the regenerate batches operate. This batch derives the impacted offers and types of cache data affected by the change. Changes are classified into the following categories: - Offer: Any change affecting the profile of an offer is considered an offer type change. These types of changes include changes in description, name, etc. - Hierarchy: Any change in the product structure or product child item is considered a hierarchy change. - Price: Change in the price list entries is a price type change. - Promotion Wapper: The promotional wrapper is by any changes in the promotion or promotional product for a simple promotion type. There are two levels of changes according to the type of cache data populated: - Catalog level change: Affects the cached list of offers under a catalog. For example, if a new product was added to the catalog, then the cached data of the paginated offers list, catalog data profile, and context eligibility lists need regenerating. - Offer level change: Affects the details of an offer. For example, if a price list entry was changed, then the affected cache entry becomes the price of that offer. This batch job has the derivation logic driven by the way cache data is populated in the cached API response objects. Offer level cache data includes itemDetails, priceResults, hierarchy, and catalog level cache data. Catalog level cache data includes contextEligiblityResultItem, item list, etc. A change in an offer impacts the cache data and its ancestors, as well as the promotions or any of its ancestors that are promotional items. This occurs because the offer details are cached against an offer with its full hierarchy, including the details of its children. If any part of the child product model has been modified, the offer details of all the offers that include the child product need to be regenerated. There are changes that could impact the offers listing, such as a product that has been made inactive. In that case, the inactive product needs to be removed from all the listings under the catalog, including the cache for the catalog profile, the eligibility lists for different context combinations, and the Contains Offers sets. With versioning enabled, the product can have different versions with the same offer code in different time frames. Therefore, other than the derivations performed on the basis of the type of sobject that was changed, the Derive Aggregate Entity batch job considers the reference type of the object: - Fixed reference: sObjects that are linked to only one version of the product. - Floating: sObjects that are linked to all the versions of the product. - Hybrid: sObjects that are linked to multiple versions of the product, depending on the use case. The data model change in the cached API response offer includes an offerId column in the cached API change object. When deriving the impact of the change in an object of type fixed reference, the system includes the offerId of only that offer, along with that offer code, in the cached API change table. A snapshot of the cached API change table looks as follows: | Code\_\_c | OfferId\_\_c | CodeType\_\_c | ChangeType\_\_c | isProcessed\_\_c | Description | | --------- | ------------ | ------------- | --------------- | ---------------- | --------------------------------------------------------------------- | | productA | prod1Id | offer | offer | FALSE | Derived entities as the impact of that change | | prod1Id | null | data | offer | TRUE | Entry for change registered while modifying the product A description | If there are changes to the sObjects that are floating references to products, then all the versions of that product are impacted because of that change. In that case, the offerId is null. For example, if the catalog product relationship has been deleted, then all the versions of the product need to be removed from the offers listing, contains offers list, offerdetails. Hierarchy cache data needs to be deactivated. The snapshot of the cached API change table then looks as follows: | Code\_\_c | OfferId\_\_c | CodeType\_\_c | ChangeType\_\_c | isProcessed\_\_c | Description | | ----------------------------- | ------------ | ------------- | --------------- | ---------------- | -------------------------------------------------------------------- | | catalogA | null | catalog | offer | FALSE | Catalog level change, all time slices are affected | | productA | null | offer | price | FALSE | All prices for that offer across all versions are impacted | | productA | null | offer | hierarchy | FALSE | All hierarchies for that offer across all versions are impacted | | productA | null | offer | offer | FALSE | All offer details for that offer across all versions are impacted | | catalogProductrelationshipId1 | null | data | offer | TRUE | Entry for change registered while modifying the productA description | With versioning and time slicing at the catalog level and batch cache population at the offer level, changes in EPC can cause a conflict with time slices, leading to the need to recompile the time slices. Recompile/regeneration of the time slices at the catalog level and the offer level can occur when: - There is a change to the version effectivity date of the child product or the root product. - A new product is added to the catalog with no overlapping time slices. - A new child product is added to the hierarchy of a catalog product. To accommodate the Recompile/regeneration of the time slices in any of the above scenarios, the Derive Aggregate Entity batch job processes the entities impacted by the time slices. The change type TimeSlice is added to the picklist value of the changeType and change objects are populated accordingly. The following table is a database snapshot for the scenario where the version effectivity of the root product is changed: | Code\_\_c | VersionId\_\_c | CodeType\_\_c | ChangeType\_\_c | isProcessed\_\_c | Description | | --------- | -------------- | ------------- | --------------- | ---------------- | -------------------------------------------------------------------- | | catalogA | timesliceKey1 | catalog | offer | FALSE | Catalog level change impacting time slice 1 | | catalogA | timesliceKey2 | catalog | offer | FALSE | Catalog level change impacting time slice 2 | | productA | prod1Id | offer | offer | FALSE | Effectivity of version 1 of productA is impacted | | prod1Id | null | data | offer | TRUE | Entry for change registered while modifying the productA description | In the above scenario, when the start and end date of the root product are changed and published, the type of change populated is still a product2 object. When deriving the impacted entities, the batch job gets the cached version information of that product and matches the current version information. If there is a mismatch, then based on the time slice information generated for that catalog, the batch job determines which time slices are impacted and need regenerating, and marks those time slice changes for the catalog as an impacted entity. That change will be later picked by the catalog level batch and those time slices will be regenerated. When the version effectivity of the child product is changed, the change is still a product2 change. In the cached API change object, the product2Id of the object is registered as the change object. During the derivation step for this child product, the system determines which are the ancestors which are the catalog products, gets the time-slice information for each of them by querying the hierarchyResult type, and gets the effectivity dates. Using those time slice dates and current version dates of the child product, the system determines if any time slice for the product is impacted. If so, the corresponding cache objects are populated. # Derive Change Entities API The Derive Change Entities API derives the scope of the impacted entities from the unprocessed CachedAPIChange Ids received from the [GetCatalog Change](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-get-catalog-change-api.md) API. This API takes the catalog changes as input in the request body and derives the scope of the impacted cache records. For example, if you modified the pricing of an offer due to the PriceListEntry(PLE) change, then the impacted scope entity would be the pricing of the offer to which that PLE is associated and the baskets containing that offer. You can obtain the List\ or cachedAPIChangeIds required in the request body of this API from the cachedAPIChangeIds node in the response body of the [GetCatalog Change](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-get-catalog-change-api.md) API. ## Precondition You must first run the [GetCatalog Change](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-get-catalog-change-api.md) API to obtain the List\ or cachedAPIChangeIds required in the request body of this API. ## URI /services/apexrest/vlocity_cmt/v3/admin/catalogs/regenerate/deriveChange ## HTTP Method POST ## URI Parameters | Parameter | Example | Default | Optional/Required | Notes | | --------------- | ------------------------------------------------------------------------------------------------- | ------- | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------- | | uniqueDeriveIds | /services/apexrest/jk_234_regen_ne/v3/admin/catalogs/regenerate/deriveChange?uniqueDeriveIds=true | True | Optional | This parameter gets the distinct derived IDs from CachedAPIChange objects. Passing the request body in the API request is not required. | ## Request Body Parameters | Parameter | Data type | Description | Optional/Required | | ------------------ | --------- | ----------------------------------------------------------------------------------------------------------------- | ----------------- | | CachedAPIChangeIds | String | Unprocessed cachedAPIChange Ids are the output of the [GetCatalog Change](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-get-catalog-change-api.md) API. | Optional | ## Sample Post Body This is a sample post for cachedAPIChangeIds. ```nolang { "cachedAPIChangeIds": [ "a4Q5g000000Tjj1EAC", "a4Q5g000000TjjBEAS", "a4Q5g000000TjjCEAS" ] } ``` ## Sample Input cachedAPIChangeIds contain the ID of the cached API change object, which could be a list of changes. This is sample input with the ID of the cached API change object. ```nolang { "cachedAPIChangeIds": [ "a4Q5g000000Tjj1EAC", "a4Q5g000000TjjBEAS", "a4Q5g000000TjjCEAS" ] } ``` ## Remote API This is an example of how you invoke the API using Apex: ```nolang String methodName; Map input = new Map(); Map output = new Map(); Map options = new Map(); // Setting remote parameters methodName = 'deriveChangeEntity'; input.put('methodName',methodName);//required input.put('apiName','regenerate'); //requires List cachedAPIChangeMap = new List(); cachedAPIChangeMap.add('a4Q5g000000TmnaEAC'); input.put('cachedAPIChangeIds',cachedAPIChangeMap); //required //remote action invocation jk_232_cam.CpqAppHandler appHandler = new jk_232_cam.CpqAppHandler(); appHandler.invokeMethod(methodName, input, output, options); ``` ## Parallel Invocation You can run this API in parallel for different cachedAPIChangeIds. For example, if there are 100 unprocessed cachedAPIChange entries from GetCatalogChangeAPI (CAC1, CAC2.....CAC100), you can run parallel threads of the Derive Change API with each individual cachedAPIChangeIds. ```nolang THREAD1 - POST /services/apexrest/vlocity_cmt/v3/admin/catalogs/regenerate/deriveChange Body : {"cachedAPIChangeIds":CAC1} THREAD2 - POST /services/apexrest/vlocity_cmt/v3/admin/catalogs/regenerate/deriveChange Body : {"cachedAPIChangeIds":CAC2} THREAD3 - POST /services/apexrest/vlocity_cmt/v3/admin/catalogs/regenerate/deriveChange Body : {"cachedAPIChangeIds":CAC3} . . . . THREAD100 - POST /services/apexrest/vlocity_cmt/v3/admin/catalogs/regenerate/deriveChange Body : {"cachedAPIChangeIds":CAC100} ``` If you are executing APIs in parallel using an orchestrator, you must use the uniqueDeriveIds parameter. This parameter ensures that duplicate records are not created and processed. For example: ```nolang POST /services/apexrest/vlocity_cmt/v3/admin/catalogs/regenerate/deriveChange?uniqueDeriveIds=true ``` ## HTTP Headers | Header | Description | | ------------ | ---------------- | | Content-Type | application/json | ## Response Body The return status indicates success or failure with a reason for the error. List\ of records contains the unprocessed Id of the CachedAPIChange\_\_c object. ``` { "cachedAPIChangeIds": [ "a4Q5g000000TmqjEAC", "a4Q5g000000TmqkEAC", "a4Q5g000000TmqlEAC", "a4Q5g000000TmqmEAC", "a4Q5g000000TmqnEAC", "a4Q5g000000TmqoEAC" ], "errorCode": "INVOKE-200", "error": "OK" } ``` ## HTTP Response Codes | Code | Description | | ---- | --------------------- | | 200 | OK | | 500 | Internal Server Error | # Detailed API Parameters and Calling Information The rows in this table provide detailed information about the calling parameters and methods for each of the Vlocity Communications APIs. | API | Description | | ------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [Get Offers by Catalog API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-get-offers-by-catalog-api.md) | Provides the ability to retrieve a list of offers (products or promotions) that are modeled within the Shared Catalog. The specified catalog code identifies the catalog that contains the offers. Offer eligibility can be determined by API parameters which support both anonymous and known user journeys. Eligibility can be controlled using context rules. Offer eligibility is determined by the default values for the context dimensions. See [Context Eligibility Rules](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-context-eligibility-rules.md). | | [Get Featured Offers API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-get-featured-offers-api.md) | Provides the ability to retrieve a list of offers (products or promotions) that are modeled within the Shared Catalog, which is sorted by a specified Catalog Product Relationship field. The specified catalog code identifies the catalog that contains the offers. Offer eligibility can be determined by API parameters which support both anonymous and known user journeys. | | [Get Contains Products API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-get-contains-products-api.md) | Provides the ability to retrieve a list of offers (products or promotions) that are modeled within the Shared Catalog which contain the specified product. The specified catalog code identifies the catalog that contains the offers. Offer eligibility can be determined by API parameters which support both anonymous and known user journeys. | | [Get Offer Details API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-get-offer-details-api.md) | Provides the ability to retrieve offer (product or promotion) details that are modeled within the Shared Catalog. The specified catalog code identifies the catalog that contains the offers. Offer eligibility can be determined by API parameters which support both anonymous and known user journeys. | | [Post Offer Details with Configuration API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-post-offer-details-with-configuration-api.md) | Provides the ability to pass offer details that are modeled within the Shared Catalog in order to retrieve pricing updates. The specified catalog code identifies the catalog that contains the offers. Pricing eligibility can be determined by API parameters which support only an anonymous journey. | | [Create Basket with BasketAction API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-create-basket-with-basketaction.md) | Provides the ability to create a basket with or without offer (product or promotions) configurations that are modeled within the Shared Catalog. The specified catalog code identifies the catalog that contains the offers. <>(BasketAction: AddWithNoConfig): Add items to the basket without configuration.(BasketAction: AddAfterConfig): Add items to the basket with configuration.(BasketAction: AssetToBasket): Create basket as part of an asset based order. | | [Update Basket Contents API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-update-basket-contents-api.md) | Provides the ability to add or delete offers to or from a virtual basket. You use the cartContextKey to keep track of the basket. The cartContextKey is not required if the basket is empty. The CartContextKey is returned as part of the response after a successful basket operation. | | [Get Basket Details API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-get-basket-details-api.md) | Retrieves details about a basket. | | [Create Cart from Basket API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-create-cart-from-basket.md) | Create Order Cart from Basket. Provides the ability to create a cart from a basket with offers (product or promotions) and its configurations that are modeled within the Shared Catalog. The specified catalog code identifies the catalog that contains the offers. | # Diagnostic Tool for Standard Cart APIs Users can invoke the diagnostic tool for Standard Cart APIs remotely. The `TelcoAdminConsoleController` supports following types of remote calls for diagnostic APIs. - `getDiagnosticDetails`returns a list of string (name of diagnostics to be performed). No parameter is required. - `executeDiagnostics` executes the diagnostic and returns the result of diagnostic in output. Requires name of the diagnostic as `diagnosticName` parameter. Below is a sample code, which performs the diagnostic remotely and generates the output in apex debug log files. ``` vlocity_cmt.TelcoAdminConsoleController controller = new vlocity_cmt.TelcoAdminConsoleController(); // get list of all diagnostics Map output = controller.invokeMethod('getDiagnosticDetails', new Map()); List diagnosticNames = (List) output.get('result'); List> results = new List>(); // iterate over the diagnostic list and execute each one for(Object diagnosticName: diagnosticNames) { Map diagOutput = controller.invokeMethod('executeDiagnostics', new Map{'diagnosticName'=> (String) diagnosticName}); Map result = (Map) diagOutput.get('result'); if(result != null) { // if there's a validationMessage, collect the diagnostic result and print in the end if(result.get('validationMessage') != null) { results.add(result); } } } for(Map result: results) { System.debug('--------'); System.debug('Validation Type: ' + result.get('validationType')); System.debug(result.get('validationMessage')); System.debug(result.get('howToFix')); System.debug('--------'); } ``` Sample Output: ![Diagnostic Output](https://developer.salesforce.com/docs/media/diagnostic-output.png "Diagnostic Output") ## Adding Pre/Post Hook on Standard Cart API Diagnostic Tool APIs To add pre/post hook logic on the diagnostic APIs, create an interface record with name `StdCartDiagnosticHook` and create an interface implementation with a custom class as the implementation. Sample Custom Class: ``` public with sharing class CustomDiagClass implements vlocity_cmt.VlocityOpenInterface { public Boolean invokeMethod(String methodName, Map input, Map output, Map options) { if(methodName.equals('getDiagnosticDetails.PostInvoke')) { List diagnosticList = (List) output.get('result'); // add the name of custom diagnostic to the list of diagnostics to be performed if(diagnosticList != null) { diagnosticList.add('customDataValidation'); } } else if(methodName.equals('executeDiagnostic.PostInvoke') && 'customDataValidation'.equals(input.get('diagnosticName'))) { Map result = new Map(); result.put('validationType', 'customDataValidation'); boolean error = true; // perform diagnostic here. if(error) { result.put('validationMessage', ''); result.put('howToFix', ''); result.put('records', ''); } output.put('result', result); } return true; } } ``` In the Vlocity CMT Administration UI, diagnostic details are displayed as follows. Sample Output: ![Diagnostic Details](https://developer.salesforce.com/docs/media/diagnostic-details.png "Diagnostic Details") # Digital Commerce Digital Commerce is a cloud-based solution that enables high-volume browsing and configuration of product offers on digital self-service channels. Digital Commerce is industry-specific and works with Salesforce Industries Communications, Media, and Energy verticals to provide a catalog-driven, unified commerce solution. The Digital Commerce solution provides for both anonymous and known user scenarios and is applicable (but not limited to) self-service channel scenarios. Digital Commerce is fully integrated with ancillary Salesforce products such as CLM, Order Management, and CPQ for call-center agents. Digital Commerce implements both a Digital Commerce tier and on-platform caching, which provide advanced order-capture and guided-selling capabilities. These capabilities offer best-fit products and services to customers with the ability to scale with demand together with speed and reliability. Digital Commerce offers the following: - A reduced time-to-market through catalog-driven Digital Commerce - A compelling UI engagement - Improved response times using intelligent caching - The ability to manage peak traffic using elastic scaling - A reduced load on the Salesforce platform by offloading static calls ## Standard Digital Commerce Standard Digital Commerce is the next-generation version of the Digital Commerce APIs available in Winter '23. Standard Digital Commerce, like Digital Commerce, is a cloud-based solution that enables high-volume browsing and configuration of product offers on digital self-service channels. Standard Digital Commerce delivers the industries-specific CPQ engine on Salesforce core to improve the performance of Digital Commerce Configure and Basket operations. Benefits: - Improves the performance of the Configure and Basket APIs. - Eliminates Basket Cache maintenance overhead. - Addresses the need for larger basket combinations. See [Standard Digital Commerce](https://developer.salesforce.com/docs/industries/cme/references/std-dc-rest?meta=Summary). ## Digital Commerce APIs The Digital Commerce APIs extend catalog-driven product selection and configuration. These APIs reduce time-to-market, improve response times, and support anonymous browsing and configuration. Using the Digital Commerce APIs, you can retrieve a list of Products and Promotions along with their details and configuration without the need for a Salesforce Opportunity, Quote, or Order record. Digital Commerce API Caching allows you to offload static calls from constrained services, accelerate website responsiveness during peak events, and extend the dynamic range of the omnichannel solution. Digital Commerce APIs also include a Cache Generator that generates the cache to accommodate anticipated high-volume API call activity. The API Response Cache allows you to cache high volume API calls on the Salesforce Platform for on-platform solutions. For additional scalability, Salesforce recommends taking advantage of an off-platform configuration, which allows you to cache high volume API calls on the elastic Amazon Web Services (AWS) platform. See [Digital Commerce (Cacheable) APIs](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-digital-commercecacheableapis.md). ## Digital Commerce SDK The SDK provides a layer of abstraction between the user interface and the Digital Commerce APIs and was developed using Pure JS UI libraries framework and a platform-agnostic approach. The SDK is extensible and versioned with Node JS Module Delivery. You use the Digital Commerce Software Development Toolkit (SDK) to improve usability and reduce the effort to deliver a compelling UI. The SDK consolidates common application and business front-end logic to reduce errors by validated API parameters. Salesforce recommends using the SDK to communicate with the Digital Commerce APIs. See [Digital Commerce SDK Architecture](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-digital-commerce-sdk-architecture.md). ## Web Components Salesforce provides two sets of web components; one set, the Digital Commerce Lightning Web Components, are for use on the Salesforce platform, while the other, the Digital Commerce Web Components, can be leveraged for off-platform use. - Digital Commerce Lightning Web Components: Lightning Web Components are fast, lightweight, and reusable. They support every major browser and use the same standards as Salesforce Lightning Web Components. The Digital Commerce Lightning Web Components are for use on the Salesforce platform. Digital Commerce Lightning Web Components use JavaScript to extend the HTML element using templates and custom logic. They provide the ability to segment CSS and JavaScript from the main document. Salesforce provides reusable HTML templates and support for Lightning Web Components. See [Digital Commerce Lightning Web Components](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-digital-commerce-lightning-web-components.md). - Digital Commerce Web Components: The Digital Commerce Web Components are fast and lightweight, reusable, and support every major browser. Digital Commerce Web Components can be used either on the Salesforce platform or off-platform. Web Components are JavaScript methods that extend HTML elements using templates and custom logic. Web Components provide the ability to segment CSS and JS from the main document. Salesforce provides reusable HTML templates and support for Digital Commerce Web Components. See [Digital Commerce Web Components](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-digital-commerce-web-components.md). ## Digital Cache Management The Cache Management system reduces the time it takes to generate the cache in the event of Product Model changes. The Cache Management system supports updates to the on-platform cache and the Digital Commerce Tier cache. The Cache Manager offers the ability to generate the cache for one or more specific catalogs. Cache Management also provides support for REST API and JavaScript Remote actions for Cache Regeneration. See [Digital Commerce API Caching](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-digital-commerce-api-caching.md), [Populate Cache Batch Process](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-populate-cache-batch-process.md), and [Preparing Digital Commerce API Caching](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-preparing-digital-commerce-api-caching.md). # Digital Commerce (Cacheable) APIs You can use the Digital Commerce APIs to develop consumer-facing web and mobile applications to shop for products and services. Vlocity recommends: - Using the [Digital Commerce SDK](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-digital-commerce-sdk-architecture.md) to make Digital Commerce API calls - An off-platform API cache # Digital Commerce API Caching The Digital Commerce APIs are RESTful Web APIs that are designed to enable client applications such as consumer-facing web and mobile apps to shop for products and services. Digital Commerce API caching is optimized for consumer shopping use cases where the user is often anonymous until well into the check-out process. The APIs are also optimized to enable caching of API responses to provide additional performance and scalability. In addition, the APIs are optimized for lower bandwidth connections between the client application and the server by minimizing the metadata returned in the response. When [Digital Commerce API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-digital-commercecacheableapis.md) calls are made, the API response cache is checked before processing the request. If a response to a request is in the cache, the response is returned to the client without further processing. If the specific request is not in the cache (a cache miss), the API will run Industries CPQ services to calculate the response, return the response to the user, and store the response in the cache for future use. Digital Commerce API Caching provides cache administration controls to populate and delete the cache using Vlocity CMT Administration pages. See [Cache Management](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-cache-management.md). A catalog (or multiple catalogs) is required for shopping and browsing. Digital Commerce API caching uses the Vlocity [Context Rules Framework](https://help.salesforce.com/s/articleView?id=ind.comms_context_rules_framework.htm). The product administrator defines context dimensions and rules which determine all permutations of a customer shape. Context rules are evaluated for each product and cached against these permutations in an object inside Salesforce. The Vlocity Omnichannel REST APIs simplify client application development by hiding the details of internal CPQ processing. Client-side developers do not need to understand details of the underlying CPQ logic; there is no need to know the proper order to apply eligibility and availability rules, and no need to learn the methods of the underlying CPQ rules engines and other CPQ services. The Vlocity Communications API Caching suite of Configure Price Quote (CPQ) Services is based on modern, enterprise-scale Omnichannel Web application programming interfaces (APIs). The web APIs are designed for use by web and mobile developers to extend Vlocity Industry Cloud Application functionality to other applications, devices, and channels. Vlocity Omnichannel Web APIs include a comprehensive set of CPQ-specific Web APIs that you use to develop a variety of powerful CPQ services for your applications. The APIs provide a layer of abstraction between client application developers and developers who configure and customize the underlying CPQ logic. You can call a CPQ API as a REST API resource using a Uniform Resource Identifier (URI). In OmniScript, you can call the CPQAppHandler and methods directly. OmniOut calls the CPQAppHandler through a “GenericInvoke” class. Use a utility such as Postman to try out the APIs. You can use Digital Commerce API Caching to develop the following types of services: - Product Selection (see [Get Offers by Catalog API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-get-offers-by-catalog-api.md) and [Get Offer Details API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-get-offer-details-api.md)) - Product Configuration (see [Update Basket Contents API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-update-basket-contents-api.md), [Create Cart from Basket](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-create-cart-from-basket.md)) - [Attribute-Based Pricing](https://help.salesforce.com/s/articleView?id=ind.comms_attribute_based_pricing.htm) To begin using the Digital Commerce APIs, start by configuring API custom settings detailed in the [CPQ Configuration Settings Reference](https://help.salesforce.com/s/articleView?id=ind.comms_t_cpq_configuration_settings_reference_148927.htm). ## On-Platform Solution Product and pricing metadata stored in the Product Catalog provide the seed data to the engine, which creates priced offers that are cached inside Salesforce. The cached API responses are then available when new calls are made. ![Digital Commerce Architecture On-Platform Solution](https://developer.salesforce.com/docs/media/v3_api_1.png) Salesforce consistently provides best-in-class performance and scalability. Very large communications, media, and energy companies might require additional scalability for peak traffic events, such as iPhone roll-out or pay-per-view specials. ## Off-Platform Solution The Digital Commerce API Caching Tier is an elastically scalable commerce engine that will offload CPQ processing from the Salesforce platform. In the initial release of the Vlocity Communications API Caching Tier, the functionality is limited to an API gateway and a cache store. The architecture of our API caching solution is platform-agnostic. However, the Digital Commerce API Caching Tier is initially certified and operated on Amazon Web Services (AWS) and managed by Salesforce. The Digital Commerce API Caching Tier is an optional component of the architecture that enables customers to store the cached API responses outside of Salesforce. ![Digital Commerce Architecture Off-Platform Solution](https://developer.salesforce.com/docs/media/dc_arch_1.png) Using off-platform caching moves the cache from the Salesforce platform to a scalable off-platform cache. Off-platform caching is useful if you experience high-volume traffic at certain peak times, or if your network traffic is always high-volume. # Digital Commerce API Caching Mechanism Digital Commerce logged-in user APIs use a progressive caching mechanism to cache the API response and quickly serve results that can be consumed by the DC API. The DC API Caching Mechanism for logged-in users ensures response time remains consistent. This caching mechanism involves key generation (Group Context Key) and response generation if the generated key is not found in cache, which stores the API results with different context inputs. The Group Context key should represent the following entities: - Context rules, which include Dimension Based rule conditions and Function-Based rule conditions. - Input context objects. For representing context rules as part of the caching mechanism, Digital Commerce marks context dimensions as cacheable. To achieve this, the Group Context Key generation consists of several major components as described below. These standard context shapes are widely used in dimension context rules or function-based context rules. ## Account Shape Account context shapes consist of: - context={"accountId":"89ddsdjsh7D00M"} - Context Param : accountId - Mandatory : false - Object : Account Context Dimensions fetch CacheableFields on account objects with cacheable mode set to True. Dimension scope should have Account either in the Entity path or in the entity of the Context Scope that belongs to this dimension. ![Account Shape - Account Status](https://developer.salesforce.com/docs/media/dc_accountstatus.png) ![Account Shape - Account Status](https://developer.salesforce.com/docs/media/dc_accountstatus_cm.png) The **Entity** field for AccountScope can be either **Account** or **Order**. ![Account Shape - Account Scope](https://developer.salesforce.com/docs/media/dc_accountscope.png) Based on the Account Object and the cacheable fields obtained from cacheable context dimensions, you can generate a context string such as {vSla\_\_c:Gold, Status:Active}. ## Contract Shape Contract context shapes consist of: - context={"contractId":"89ddsdjsh7D00M"} - Context Param : contractId - Mandatory : false - Object : Contract Context Dimensions fetch CacheableFields on contract objects with cacheable mode set to True. Dimension scope should have Contract either in the Entity path or in the entity of the Context Scope that belongs to this dimension. ![Contract Shape - Contract Status](https://developer.salesforce.com/docs/media/dc_contract_status.png) ![Contract Shape - Contract Status](https://developer.salesforce.com/docs/media/dc_contract_status_cm.png) The **Entity** field for ContractStatus can be either **Contract** or **Order**. ![Contract Shape - Contract Scope](https://developer.salesforce.com/docs/media/dc_contractscope.png) Based on the Contract Object and the cacheable fields, you can generate a context string such as {Status:Active}. ## User Shape User context shapes consist of: - context={"accountId":"89ddsdjsh7D00M"} - Context Param : accountId - Mandatory : false - Object : Account, User ## Basket Shape This key should be provided by the user and is usually available from the Basket APIs. Basket context shapes consist of: - context={"cartContextKey":"e08faf1e2bdc907e409b7d0c1dd47634"} - Context Param : cartContextKey - Mandatory : false - Object : NONE ## Assets Shape Assets Basket context shapes consist of: - context={"accountId":"89ddsdjsh7D00M","rootAssetIds":["id"]} - Context Param : rootAssetIds,accountId - Mandatory : accountId : true, rootAssetIds : false - Object : Account, Asset Context Dimensions fetch CacheableFields on Asset objects with cacheable mode set to True. Dimension scope should have Asset either in the Entity path or in the entity of the Context Scope that belongs to this dimension. ![Assets Shape - Asset Quantity](https://developer.salesforce.com/docs/media/dc_assetquantity.png) ![Assets Shape - Asset Quantity](https://developer.salesforce.com/docs/media/dc_assetquantity_cm.png) ![Assets Shape - Asset Scope](https://developer.salesforce.com/docs/media/dc_assetscope.png) Based on the Account Object, you can retrieve the asset bundle for the rootAssetId provided. Using cacheable fields, you can generate context strings for all the assets. The Group Context Mechanism makes sure that for every given context if the data set is similar, the same key is generated. Otherwise, unique keys are produced. The asset context shape will only contain the asset shape from the latest asset of the account provided in the context. To include other assets of the account in the context, `rootAssetIds` parameter needs to be passed in the URL. Generally, you should send only one root asset ID in the context parameter. Sending more than one root asset ID might lead to performance issues. ## Best Practices - To generate the shape generation of each object type, use values of cacheable dimensions. - If there are complex fields that could not be expressed as part of the fieldset, you can write a post-hook to the shape generator that enables you to add complex fields. - If there are range operators such as (\<>) you want to include as part of the shape generator, you can convert them to a Boolean or text custom formula field and add them as part of the EcommCachingFS fieldset. You can also use post hooks for the shape generator to include. For example, you can convert CPQ_Ageing_Loyalty > 12 to AgeingLoyaltyGT12(Boolean field). ![Layout Editor - Field Set](https://developer.salesforce.com/docs/media/dc_editlayout.png) - Do not include Id fields as part of any object shape, or it results in a cache miss and might lead to an increase in response time. Use Codes instead. - While adding fields to an object shape, consider all your rules and function logic so you can add fields for caching. - Since GetOffers uses eligibility context rules, if no context is provided in the URL then eligibility rules fail since there are no populated context dimensions. - If any context dimension value is not populated, then the rule expression is evaluated to false by default. - If you are using hook services for any rules with functions, make sure you rewrite the logic for DC APIs. # Digital Commerce API Quick-Start Guide Using Postman, you can quickly and easily test and run the Digital Commerce APIs, giving you the opportunity to experiment with different parameters and parameter data and view the values that are returned. By using the Digital Commerce API Postman collection, API variables and parameters are preconfigured allowing you to get started testing quickly. Information is included about basic Digital Commerce setup and Postman environment installation and configuration. Hints and tips for calling the Digital Commerce APIs using Postman are also provided. Postman is a third-party application that can be installed on Windows (32 or 64-bit), Mac, and Linux (64-bit). # Digital Commerce API Response Optimization You can request specific nodes in the response from the following Digital Commerce APIs by creating a DataRaptor interface, a DataRaptor transformer, and a post hook for the API response handler. - AssetToBasket - BasketOperations - ConfigureOffer - GetOffers - GetOfferDetails You will need to specify the nodes you want to include in the API response. Specifying specific nodes in the API call reduces the verbosity of the API response, thereby decreasing overhead and bandwidth requirements. The following example instructions use the GetOffers API and specify the offers:offerType, offers:priceResult:UnitPrice, and offers:ProductCode nodes in the response. To reduce the size of Digital Commerce API responses: 1. Go to the Vlocity DataRaptor tab in your org and click **New**. 2. In the Create Vlocity DataRaptor Interface window, enter a unique name for the DataRaptor interface, such as OffersTransformer. 3. From the **Interface Type** list, select **Transform**. 4. From the **Input Type** and **Output Type** lists, select **JSON** and click **Save**. The DataRaptor transformer is displayed on the Vlocity DataRaptor Interface page. ![Create Vlocity DataRaptor Interface](https://developer.salesforce.com/docs/media/createdataraptortransform.png) 5. Click + to add input and output JSON paths (nodes). 6. In **Input JSON Path** and **Output JSON Path**, enter a valid JSON path from the API's response, such as `offers:offerType`. 7. From the **Output Data Type** list, select the data type for the node, such as **String**. ![Output JSON Path](https://developer.salesforce.com/docs/media/addjsonpathsfordataraptortransform.png) 8. Click **Save** and then click + to add more nodes as needed. ![DataRaptor interface OffersTransformer](https://developer.salesforce.com/docs/media/offerstransformerdataraptorwithjsonpaths.png) 9. Use sample input to test the DataRaptor transformer. The following sample input to GetOffers should return a transformed response similar to the following example output. Sample GetOffers input: ```nolang { "contextKey": "b50d669c29ef610a5b9ba6b4cd734258", "offers": [ { "addtocart": { "rest": { "params": { "basketAction": "AddWithNoConfig", "offer": "accessories" }, "link": "v3/catalogs/mobiles/basket", "method": "POST" } }, "offerDetailsAction": { "rest": { "params": {}, "method": "GET", "link": "/v3/catalogs/mobiles/offers/accessories" }, "remote": { "params": {} }, "client": { "records": [], "params": {} } }, "Name": "accessories", "Description": "accessories", "ProductCode": "accessories", "Attachments": null, "offerType": "Product" }, { "addtocart": { "rest": { "params": { "basketAction": "AddWithNoConfig", "offer": "FastCharger" }, "link": "v3/catalogs/mobiles/basket", "method": "POST" } }, "offerDetailsAction": { "rest": { "params": {}, "method": "GET", "link": "/v3/catalogs/mobiles/offers/FastCharger" }, "remote": { "params": {} }, "client": { "records": [], "params": {} } }, "priceResult": [ { "adjustments": [], "overrides": [], "chargeamount": 10, "baseamount": 10, "Amount__c": 10, "IsVirtualPrice__c": false, "IsBasePrice__c": true, "effectiveuntildatespec": null, "effectivefromdatespec": null, "SubType__c": "Standard", "Type__c": "Price", "RecurringFrequency__c": null, "ChargeType__c": "One-time", "DisplayText__c": "fc", "UnitPrice": 10 } ], "Name": "FastCharger", "Description": "FastCharger", "ProductCode": "FastCharger", "Attachments": null, "offerType": "Product" }, { "addtocart": { "rest": { "params": { "basketAction": "AddWithNoConfig", "offer": "S10" }, "link": "v3/catalogs/mobiles/basket", "method": "POST" } }, "offerDetailsAction": { "rest": { "params": {}, "method": "GET", "link": "/v3/catalogs/mobiles/offers/S10" }, "remote": { "params": {} }, "client": { "records": [], "params": {} } }, "priceResult": [ { "adjustments": [], "overrides": [], "chargeamount": 500, "baseamount": 500, "Amount__c": 500, "IsVirtualPrice__c": false, "IsBasePrice__c": true, "effectiveuntildatespec": null, "effectivefromdatespec": null, "SubType__c": "Standard", "Type__c": "Price", "RecurringFrequency__c": null, "ChargeType__c": "One-time", "DisplayText__c": "one time base", "UnitPrice": 500 }, { "adjustments": [], "overrides": [], "chargeamount": 50, "baseamount": 50, "Amount__c": 50, "IsVirtualPrice__c": false, "IsBasePrice__c": true, "effectiveuntildatespec": null, "effectivefromdatespec": null, "SubType__c": "Standard", "Type__c": "Price", "RecurringFrequency__c": "Monthly", "ChargeType__c": "Recurring", "DisplayText__c": "s10 rec base" } ], "Name": "S10", "Description": "S10", "ProductCode": "S10", "Attachments": null, "offerType": "Product" } ], "errorCode": "INVOKE-200", "error": "OK" } ``` Expected reduced output: ```nolang { "offers": [ { "offerType": "Product", "ProductCode": "accessories" }, { "offerType": "Product", "ProductCode": "FastCharger", "UnitPrice": 10 }, { "offerType": "Product", "ProductCode": "S10", "UnitPrice": 500 } ] } ``` 10. Create a post hook for the response handler to transform responses from getOffers. Sample post hook: ```nolang Object offers = output.get('offers'); Map bodyData = new Map { 'bulkUpload' => false, 'bundleName' => 'OffersTransformer', //name of the transformer 'debug' => false, 'objectList' => new List { output } }; Map re = (Map)DRGlobal.processPost(bodyData); Map resultsData = (Map)re.get('returnResultsData'); output.put('offers', resultsData.get('offers')); ``` # Digital Commerce API Usage Considerations Consider the points in this section when making design and deployment decisions. - Ensure that you delete logger trace flags and disable all logging services, such as CacheAPI.EcommLogger and the pricing log in CPQ Configuration settings. - Cacheable APIs do not currently support penalties that are invoked when attempting to remove promotions from an active asset. To learn more about penalties, see [Create a Penalty Rule](https://help.salesforce.com/s/articleView?id=ind.comms_create_a_penalty_rule.htm). - Attribute binding is not supported by Digital Commerce APIs. See [Create a Pricing Element Adjustment in the Product Console](https://help.salesforce.com/s/articleView?id=ind.comms_create_a_pricing_element_adjustment_in_the_product_console.htm) - The deltaPrice, deltaValidate, and levelBasedApproach custom settings are not supported when using the Digital Commerce APIs. If deltaPrice or deltaValidate are enabled, line items that are added to the cart will not be priced or validated correctly. If levelBasedApproach is enabled, Digital Commerce API calls return only a partial response. In addition, subsequent API calls will not be able to perform any further operations on an existing basket. - For releases prior to CME Winter '20: Vlocity Communications API Caching does not honor product selling period or effectivity dates. The following dates in the product catalog are ignored by Vlocity Communications API caching: Selling Start Date, Selling End Date, Fulfillment Start Date, End Of Life Date, Effective Date and Effective End. Starting with the CME Winter '20 release, these product selling period and effectivity dates are supported; however, effectivity dates for rules are not supported. - Cacheable context dimensions do not support comparisons operations; only absolute values. For example, a context dimension that specifies "Postal Code Range must be greater than {numeric value}" is not supported. Therefore, it is advisable to convert these dimensions to Boolean values. For additional complex dimensions, contact our Product Management team. - Cache management will require manual steps while the admin capabilities are expanded. - The off-platform solution will be designed to be gateway agnostic, but the first iteration will be optimized on AWS. - When creating a promotion override, excluding a child product from the promotion is not supported. - For releases prior to CME Summer '20: When creating catalog product relationships, do not enter both products and promotions in the same product relationship record. For example, do not create a record for a product and then add a promotion to the same record. You should instead create one record for the product and one record for the promotion. - Ensure there are no blank spaces in code fields in objects that are used in the Cacheable API configuration. - Run all appropriate CMT Administration jobs (such as [Field Maps Maintenance](https://help.salesforce.com/s/articleView?id=ind.comms_field_maps_maintenance.htm), [Product Hierarchy Maintenance](https://help.salesforce.com/s/articleView?id=ind.comms_product_hierarchy_maintenance.htm), and so on) before running the cache API jobs. - Starting with the Winter '20 release, the Digital Commerce APIs support [JSONAttribute v2](https://help.salesforce.com/s/articleView?id=ind.comms_jsonattribute_v2_schema_upgrade_considerations.htm). - Consider removing old pseudo records. See [Delete Pseudo Records](https://help.salesforce.com/s/articleView?id=ind.comms_delete_pseudo_records_cmt_4644.htm). - For the Winter '20 release, the custom setting `UseAssetReferenceIdForParentAndRoot=True` is not supported for the Digital Commerce APIs. Set `UseAssetReferenceIdForParentAndRoot=false` instead. ## Get Offers By Catalog - The GetOffers API accepts only one context parameter value in the API call. For example, `context={"AccountSla"="Gold"}` would be supported, but `context={"AccountSla"="Gold,Silver"}` would not be supported. - The Get Offers by Catalog API returns override values of attributes only for products that are part of a promotion. Because the API returns only root-level products and does not return child products, it does not return overrides except in the case of products within a promotion. - Be aware that availability and eligibility interface implementations are ignored while generating the cache. Cache generation defaults to executing eligibility context rules by leveraging context dimensions for Digital Commerce APIs. However, CPQCart leverages Cart-Based APIs which also support eligibility context rules that could be set without affecting cache generation. Therefore, Digital Commerce API cache generation ignores the following: - [ProductAvailabilityInterface](https://help.salesforce.com/s/articleView?id=ind.v_dev_t_productavailabilityinterface_656135.htm) - [ProductAvailabilityOpenInterface](https://help.salesforce.com/s/articleView?id=ind.v_dev_t_productavailabilityopeninterface_656232.htm) - [ProductEligibilityInterface](https://help.salesforce.com/s/articleView?id=ind.v_dev_t_producteligibilityinterface_656504.htm) - [ProductEligibilityOpenInterface](https://help.salesforce.com/s/articleView?id=ind.v_dev_t_producteligibilityopeninterface_656601.htm) - As of the Fall ’20 release, after invoking the Populate API batch job, the following are honored: Active flag, Orderable flag, Effectivity dates, selling start and end dates on offers (Products or Promotions). If an offer becomes ineligible later, due to a selling end date or  effectivity date expiration, it will not be automatically removed from the response. - To remove an inactive offer from a getOffers API response, clear the cached API response records and rerun the Populate API cache batch job. Then, manually edit the offer entry in the Product Console to trigger cache management and run the regenerate cache batch job. - For CME Fall '18 release, ensure that you clear the cache before running the GetOffers batch job. Custom Settings (Fall '18): - CacheAPI.GetOffersCacheRecLimit: - DefaultValue: 9000 - Suggested Value: 5000 - Applicable On: GetOffers and GetContainsOffers batch jobs This custom setting represents the maximum number of results that can be cached for each catalog during the Populate API cache batch jobs for GetOffers or GetContainsOffers. Clear the cache before running the GetOffers batch job. (CME Fall '18). - API calls are cached during run time as part of incremental cache population. ## Get Offer Details - The following custom settings are not supported: DeltaPrice, DeltaValidate, and LevelBasedApproach. - As of the Fall ’20 release, after invoking the Populate API batch job, the following are honored: Active flag, Orderable flag, Effectivity dates, selling start and end dates on offers (Products or Promotions). If an offer becomes ineligible due to a selling end date or effectivity date expiration, the offer will not be automatically removed from the response. - To remove expired offer details from the Digital Commerce cache, clear the cached API response records and rerun the Populate API Cache batch job. Then, manually edit the offer entry in the Product Console to trigger the cache management and run the regenerate batch job. - Note the following about pricing when running this API: - When Get Offer Details is called initially, the pricing interface is not executed. - When Get Offer Details is called with context parameters, the correct pricing is returned based on context eligibility (tightest match) of the prices. The pricing interface is not executed. - The GetOfferDetails API triggers the pricing interface implementation only when a change to the offer occurs. For example, the pricing interface implementation is triggered when a user modifies the QTY amount or modifies an attribute value. Therefore, when GetOfferDetails is initially called, the pricing interface implementation is not executed. If specific context key elements are passed, correct pricing is returned based on the response when running API caching rules, which recognize the pricing interface implementation. ## Get Contains Products - As of the Fall ’20 release, after invoking the Populate API batch job, the following are honored: Active flag, Orderable flag, Effectivity dates, selling start and end dates on offers (Products or Promotions). If an offer becomes ineligible due to a selling end date or effectivity date expiration, the offer will not be automatically removed from the response. - To remove expired offer details from the Digital Commerce cache, clear the cached API response records and rerun the Populate API Cache batch job. Then, manually edit the offer entry in the Product Console to trigger cache management and run the regenerate cache batch job. - The GetContainsProducts API accepts only one context parameter value in the API call. For example, `context={"AccountSla"="Gold"}` would be supported, but `context={"AccountSla"="Gold,Silver"}` would not be supported. - The sortBy parameter and sorting are not supported in the CME Fall '18 release of this API. - Because products are not added to the cart, validation and pricing rules do not run; therefore, product relationship type rules are not supported. - The DeltaPrice, DeltaValidate, and LevelBasedApproach are not supported. - In addition to the offers returned by the API, Get Contains Products also returns the offer itself. - Custom Settings (as of CME Fall '18): [CacheAPI.GetOffersCacheRecLimit](https://help.salesforce.com/s/articleView?id=ind.comms_t_cpq_configuration_settings_reference_148927.htm) - DefaultValue: 9000 - Suggested Value: 5000 - Applicable to GetOffers and GetContainsOffers batch jobs - This custom setting represents the maximum number of results that can be cached for each catalog during CachePopulation batch job for GetOffers or GetContainsOffers. - Ensure that you clear the cache before running the GetOffers batch job (CME Fall '18). ## Post Offer Details with Configuration - The deltaPrice, deltaValidate, levelBasedApproach custom settings are not supported. - One-time charges and monthly charges (NRC and MRC) must be defined for each product. If NRC or MRC are not available, set them to \$0.00. - The Configure Offer API uses the Pricing Interface Implementation; therefore Attribute-Based Pricing via Price Plans is supported. - The Post Offer Details with Configuration API is specific to the orderable Bundled Products that are being configured. Post Offer Details with Configuration APIs do not honor Advanced Rules that are defined to evaluate across multiple bundles. ## Basket API - For releases prior to CME Summer '19: Deleting any offer of type promotion or an offer that has been affected by any rules due to a promotion from the basket will render the basket invalid. The user must start with a fresh basket after such an operation, which can be handled by custom code. - For releases prior to CME Summer '19: Only add and delete were supported, not update. Deleting from the basket, configuring a new offer, and adding to the basket would effectively update the basket. - The Basket API supports [Multi-Transaction Service](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-multi-transaction-service.md). - deltaPrice, deltaValidate, and levelBasedApproach are not supported - For releases prior to CME Winter '20: Cloned child line items are not supported. Cloned child line items are supported as of the Winter '20 release. - For releases prior to CME Winter '20: Adding the same promotion multiple times to a single basket is not supported. This functionality is supported as of the Winter '20 release. - When you create the basket with `price=false` and `validate=true`, cartContextKey is computed with no pricing done on the cart. When you call a getBasket on the created basket with `price=true` and `validate=false`, the basket shape changes as pricing is done on the cart. Therefore, cartContextKey is recomputed. ## Create Basket with Basket Action The Asset To Basket API does not support nesting of multiple baskets from the same asset with different request dates. Example: Assume you create an asset to basket order with a request date of August 1st 2020 and make modifications. Next, another asset to basket order is created with request date of September 1st 2020; the latest request will not have the changes made to the basket that was created on August 1st. Example: Suppose you create an asset to basket order with a request date of August 1st, make modifications, and convert the basket to a cart using the [Create Cart from Basket](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-create-cart-from-basket.md) API. Next, you create another asset to basket order with a request date of September 1st; the basket will have the changes that were created on August 1st. **important:** - The createCart API does not currently accept the order start date as a parameter. The cart is always created on the date of the createCart API call. - Adding assets to the basket after the SellingEndDate is not supported due to implementation limitations. ## Price - Only pricing-element prices are supported. A one-time charge and a recurring charge must be defined for each product as a base price. Zero-base prices are allowed. - Only one-time charge/total and recurring charge/total are supported in the Fall 2018 release. Therefore, loyalty and other pricing variables are not supported. - Prices shown in the GetOffers, GetOfferDetails, GetContainsProducts are read directly from the defined price list entries for each product and promotion in the catalog. Starting from CME Spring ‘22, Digital Commerce supports all the features of Usage Pricing that are supported by Industries CPQ, including: - Promotions - Attribute Binding - Attribute-Based Pricing - Roll-up price - Price overrides For more information on Usage-Based Pricing, see - [Enable Usage Pricing](https://help.salesforce.com/s/articleView?id=ind.comms_enable_usage_pricing_for_industries_cpq.htm) - [Configure Usage Pricing](https://help.salesforce.com/s/articleView?id=ind.comms_configure_usage_pricing.htm) - For releases prior to CME Winter '20: Time plan and time policy are not honored in the price result. Time plan and time policy are supported as the Winter '20 release. - The GetOffers, GetOfferDetails, and GetContainsProducts APIs do not have a cart context; therefore, promotion discounts that are defined on a promotion product that is not a top-level offer, but that references a parent offer in its price list entry definition, will not be calculated. This type of promotion discount can be calculated only when a cart exists with the parent offer already added to it. An example of the above scenario would be to define a promotion, add a promotion Product A, then under product adjustments, add a 10% monthly recurring charge (MRC) discount for Product A with a Parent Offer Context pointing to an offer Product B. This promotion means Product A's MRC price is 10% less if Product B exists and Product A is under Product B's hierarchy in the cart. ## Context Eligibility (Products and Promotions) Rules Limitations - To Cache Eligibility Combinations, ensure you enable cacheable mode, and have populated values for caching and default values for context dimensions. Otherwise, API performance will be negatively impacted and result in frequent cache misses and might lead to caching of unwanted combinations. - The context scope associated with the cacheable dimension must be of type Entity (Virtual and Session are not supported). - Cacheable dimension does not support any dynamic fields. (Domain Type must be of type "Type In" => SObject and picklist is not supported because there will not be any cross-validation while generating combinations against the picklist values). - The context parameter in all of the above APIs is case sensitive. Otherwise, eligibility results might not be accurate. - All the rules defined for generation of eligibility combination must have Rule Type as Qualification and Rule purpose as Eligibility. - The rule condition supports only == and != operators in the case of Eligibility Context Rules. The != operator is supported only for known users, while the == operator is supported for anonymous users as well as known users. - Rules support only AND or OR Expression Modes in rule condition evaluation. - Rule Set supports only AND or OR Expression Mode rules evaluation. Custom expression modes are not supported. - Fail Level and Fail Message are not honored. - For any configuration changes related to context dimension, rules, rule conditions, rule sets, or rule set assignments to products or promotions, first clear the platform cache, then run the ContextEligibilityGenerator batch job and the rest of the batch jobs under Populate API Cache in the Vlocity CMT Administration screen. - Prior to the Summer '19 release, header rules within context rules are ignored for Digital Commerce anonymous APIs. - Eligibility Rules are applicable in GetOffers API and GetContainsProducts API only. - Beginning with the Fall 2018 release, the Context Dimension Name and Code must be identical. - Custom Settings (CME Fall '18): The [CacheAPI.CombinationLimit](https://help.salesforce.com/s/articleView?id=ind.comms_t_cpq_configuration_settings_reference_148927.htm) custom setting represents the maximum number of results that can be cached for each catalog during ContextEligibilityGenerator CachePopulation batch job. - DefaultValue: 9000 - Suggested Value: 5000 ## Pricing Context Rules (Tightest Match) - Even though scope and mappings are defined for context dimension, Pricing Rules will obtain values from the context parameter of the URL to evaluate the rule conditions. - Pricing context rules are supported in Basket API, Configure API, and Create CART API. - The Cart-Based defined scope for a context Dimension, which acted as input for rules. For example, consider the following scenario: - Create a Dimension: `AccountSla, Scope: Account, Mapping: {SourceExpression: Account.Sla__c}` - Create a Rule named R1 which says: `AccountSla == gold`, and create a rule set called RS1. - Assign this ruleset to PriceListEntry (PLE1 => One time charge: 50) of product P1 to RS1. Assume one more PLE for P1 (PLE2, one-time charge: 40). - Now assume you are trying to add P1 in a Cart-Based API CPQ cart while adding product P1. This API attempts to fetch the best possible match of the prices assigned to product P1 based on the context rules assigned. - Because PLE1 is assigned to RS1, it fetches the AccountSla value from the scope object that was assigned to it. - Assume that AccountSla value is gold in the Account object that is related to the current cart, then the existing context rule service will replace AccountSla in the ( `AccountSla == gold`) condition with the AccountSla value (which is obtained from the related account object) and the final expression of the rule condition will be simplified to (gold == gold). Because this qualifies PLE1, PLE1 takes priority over PLE2 based on the weight defined in the dimension. - Based on the above scenario, the input source for the rule condition was given from the Scope objects. - In the Digital Commerce APIs, context scope, mappings, rules, rule conditions, and rulesets must be defined as specified above. But instead of using the scope object for the input source to evaluate the rule conditions, the API uses the context parameter provided in the URL to evaluate the rule conditions. To illustrate the above scenario, consider the following URL: `/v3/catalogs/Mobiles/basket/5b7f58ae49f221537c97e7fd4f6d063c?context={"AccountSla":"Silver"}` - Assume the URL above is used to add product P1 to the basket. The URL has a context with AccountSla as key, which is the code of the dimension that was defined. Because silver is not equal to gold, the rule fails and PLE2 takes precedence over PLE1. Because silver is not equal to gold, the rule fails and PLE2 takes precedence over PLE1. The evaluated rule condition expression is as follows: (`"Silver" == "Gold"`) - This feature is supported only by Basket API, Configure API, and Create CART API ## Create Cart - The [Create Cart from Basket](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-create-cart-from-basket.md) API requires that catalogCode be sent as an input to the API call. The catalogCode is required to determine the PriceList to use for the cart. If you have a single catalog, then specify the catalogCode in the input of the Create Cart API. If you have multiple catalogs, use the same price list on all of the catalogs. Using one price list allows you to specify any one of the catalog codes in the input of createCart API. - When creating a cart using the Digital Commerce APIs, the order start date will be the date on which the Create Cart from Basket API was called. - When using the Create Cart API, effectivity and eligibility checks are supported only when the cartContextKey parameter is set. Effectivity and eligibility checks are not supported by setting the JSONResult parameter. ## Cache Management - The Digital Commerce Cache Manager is unable to regenerate or recompute existing baskets if they contain configured offers. If a basket contains configured offers and changes are made to the catalog, the cache manager invalidates the baskets. - The Cache Manager is unable to regenerate or recompute responses to the Post Offer Details with Configuration API call. If a basket contains configured offers and changes are made to the catalog, information returned by the Post Offer Details with Configuration API is invalid. - The Cache Manager does not support scenarios in which a child product within the catalog hierarchy is changed to inactive. - The Cache Manager does not support scenarios in which a promotion is active but the promotional product is inactive. ## Performance Considerations For best performance, whether the user is known or anonymous, call the API with both the context parameter and the context key. This is a two-step process. For example, first issue a request to the Get Offers by Catalog API. The contextKey is returned in the output of the API call, as shown here: ```nolang API Call: /services/apexrest/cacheableapis/v3/catalogs/Mobiles/offers?context={"accountId":"001f200001ci94Q"}&loggedin=true API Response: {"contextKey":"9425c79cd5f3ec005ebcf4b72d57a378","offers":[{" ... (truncated for clarity) ``` Subsequent requests are then made using the contextKey and the context. For example: ```nolang API Call: /services/apexrest/cacheableapis/v3/catalogs/Mobiles/offers?context={"accountId":"001f200001ci94Q"}&contextKey=9425c79cd5f3ec005ebcf4b72d57a378&loggedin=true ``` If the context shape changes (changes are made to the account, an asset that belongs to the account, or to a contract), the context key must be regenerated. # Digital Commerce APIs and Guest Users The following URIs and their corresponding Digital Commerce APIs allow guest users to use the basket and offer operations. The [Create Basket with BasketAction](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-create-basket-with-basketaction.md) API creates and updates records for guest users. Digital Commerce APIs that use a context key must encrypt them. - /carts [Create Cart from Basket](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-create-cart-from-basket.md) `POST /carts` - /catalogs/_/basket/_ - [Create Basket with BasketAction](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-create-basket-with-basketaction.md) `POST /catalogs/{catalogcode}/basket` - [Get Basket Details API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-get-basket-details-api.md) `GET /catalogs/{catalogcode}/basket/{basketkey}` - [Update Basket Contents API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-update-basket-contents-api.md) `POST /catalogs/{catalogcode}/basket/{basketkey}` - /catalogs/_/offers/_ - [Get Offers by Catalog API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-get-offers-by-catalog-api.md) `GET /catalogs/{catalogcode}/offers` - [Get Offer Details API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-get-offer-details-api.md) `GET /catalogs/{catalogcode}/offers/{offercode}` - [Post Offer Details with Configuration API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-post-offer-details-with-configuration-api.md) `POST /catalogs/{catalogcode}/offers/{offercode}` # Digital Commerce Artifacts Salesforce Industries provides several example applications and source code to help you create your own Digital Commerce experience. The topics in this section contain instructions for accessing and downloading the files and components to enable the Digital Commerce Web Components, Digital Commerce Lightning Web Components, Lightning Web Component OmniScript Datapack, and the Digital Commerce Software Development Toolkit (SDK). You can use the samples as a starting point for making your own Digital Commerce web site. You are free to modify and enhance the examples to fit your requirements; however, the examples are not meant to be used in a production environment. For information about how to download the Vlocity Web Components or Vlocity Lightning Web Components artifacts, see [Digital Commerce Lightning Web Component Artifacts](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-digital-commerce-lightning-web-component-artifacts.md). For example, using Vlocity Web Components or Vlocity Lightning Web Components, you can create applications similar to those shown below. ![Web page with Web Components or Lightning Web Components](https://developer.salesforce.com/docs/media/lwc_demo_app.png) ![Web page with Web Components or Lightning Web Components](https://developer.salesforce.com/docs/media/digital_commerce_lightning_web_components__includes_sdk_.png) The Digital Commerce Software Development Toolkit (SDK) allows access to the components you need to develop your own applications. For information, see the [Digital Commerce SDK Architecture](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-digital-commerce-sdk-architecture.md). ![SDK allows access to the components you need to develop your own applications](https://developer.salesforce.com/docs/media/digital_commerce_software_development_kit__sdk_.png) You can also use Vlocity OmniScripts to create your application. For information about how to download the Digital Commerce Lightning Web Components Sample OmniScript data pack. ![use OmniScripts to create your application](https://developer.salesforce.com/docs/media/sample_dc_omniscript_embedded_dc_lwc.png) # Digital Commerce Batch Jobs Digital Commerce APIs rely on the cache data populated by the batch jobs in the persistent cache layer. Each batch job has its own separation of concerns regarding the type of cache data they populate. Digital Commerce APIs rely on the cache data populated by the batch jobs in the persistent cache layer. Each batch job has its own separation of concerns regarding the type of cache data they populate. The cache populated during the batch time includes: - Catalog profile data (catalog information, products, promotions under that catalog). - Context combination of the cacheable context dimension with the corresponding eligibility list. - The list of offers that contains an offer. - The prices of each product or promotional product along with the override information. - Flat hierarchy of the product bundle, etc. Pre-populating the cache data not only reduces the time complexity and overall SOQL during the run-time, but also acts as a source of truth for most of the APIs. With versioning enabled, there can be different product versions and different promotional product versions associated with the catalog and promotion. The source of truth becomes the timeSliceInfo cache data populated by the Version Info Generator batch job that holds the information about the product and promotional products versions associated with the catalog at the given point of time. As such, the batch jobs divides into three categories: - Catalog level batches - Information cached per catalog time slice: The catalog level batches are the type of batches that run at the catalog level and operate on the list of offers (Root products only) associated with the catalog. Therefore, catalog level batches are time bound as per the listed offer’s effectivity. Their cache effectivity date is that of the time slice information on which they are operating. The catalog level batches are: - Ecomm Data Profile - Context Eligibility Generator - GetOffers List Batch job - Offer level batches - Information cached per offer time slice: For the batch jobs concerned with the information about a particular offer, for example, offerDetails, the effectivity corresponds to the version effectivity dates of itself and the time slices generated by the versions of its children. - Get Offers Item - Get Hierarchy - Get Offer Details - Information cached for the entire effectivity dates: The data holding a reference to the actual sObjects (products or promotions) can be cached for the entire duration. For example, each rule for rule set expressions has some rule conditions with rule expressions to evaluate whether the rule passes or fails. The Digital Commerce getOffers API, references the qualifying rule sets that are associated with a product. Those rule expressions for a rule set can be cached for the entire cache duration. - Rule set expressions - GetPrices There are catalog-level batch jobs that rely on the information cached by offer-level batches. For example, the getContains offers batch job lists the offers containing a product in the hierarchy. It returns the lists of catalog products and promotions. Therefore, the getContains offers batch job must be time-sliced according to all offer versions but it also depends on the individual offer version because the hierarchy of the product might change to a different version. The following diagram shows an overview of the different types of cache data generated by the batch jobs (y-axis) vs timeline (x-axis) of the data set. ![Digital Commerce Batch Jobs - Time Slices](https://developer.salesforce.com/docs/media/dc_cachebatchjob_data.png) # Digital Commerce Entities The base entity for the Digital Commerce setup is the offers listed under a catalog. The data setup of a typical digital e-commerce org contains a catalog with offers under that catalog. The offers can be either a product or promotion and are linked to the catalog by a catalog product relationship. - Products: In EPC, a product can have multiple versions depending on the versioning start and end times. When versioning is enabled in the org, the catalog product relationship data model holds the same association of the product or the promotion with the catalog, but in any instance, there can only be one product version associated with the catalog. For example, Product1 Version1 is linked to the catalog with CPR1. Even though there is only one version of the product linked to the catalog, we assume that all product versions are associated with the catalog. With CPR1, the system links all three versions of Product1 to the catalog according to the version effectivity dates of the products. If the effectivity of Version1 has reached its end date and Version2 has become active then in the responses of DC APIs and batch jobs, Product1 Version2 is considered. - Promotions: With versioning enabled, there can be multiple versions of child products. Only the child product versions associated with the promotion by a promotional item relationship are considered. The product versions that are not promotional items are not considered. The catalog product relationship of the promotion bears no change when versioning is enabled. However, all the product versions that need to be promotional items must be added individually. Products can have different versions but the same catalog product relationship. Promotions have versioning on the promotional items. ![Catalog product relationship](https://developer.salesforce.com/docs/media/dc_versioned_relationships.png) Products can have different versions but the same catalog product relationship. Promotions have versioning on the promotional items. Extend Product Versioning to your Digital Commerce solution to accelerate product innovation and market responsiveness. With Product Versioning, sales teams can support and track offer modifications to existing offers without business disruption. With Product Versioning, you can also modify offers and deploy changes without disruption. This feature is now extended to your Digital Commerce solution. Extend Product Versioning to your Digital Commerce solution to accelerate product innovation and market responsiveness. With Product Versioning, sales teams can support and track offer modifications to existing offers without business disruption. With Product Versioning, you can also modify offers and deploy changes without disruption. This feature is now extended to your Digital Commerce solution. # Digital Commerce Gateway (DCG) Overview The Digital Commerce Gateway provides communications and media companies additional scalability for peak traffic events, such as mobile device roll-out or pay-per-view specials. **note:** The documentation in this section applies only to customers who have purchased the Digital Commerce Gateway license. The instructions provided don't work without the Digital Commerce Gateway license. The Digital Commerce Gateway uses the Amazon API Gateway to provide additional scalability and a reduction in response times. Cacheable API calls are responded to from the API Gateway itself, reducing traffic to Salesforce, enabling peak traffic management, and providing consistent and fast API response times. API cache misses are routed by the Digital Commerce Gateway to the Salesforce platform for execution, and responses, if cacheable, are cached on the on-platform API Caching layer and the Digital Commerce Gateway.  The Digital Commerce Gateway is hosted on the AWS cloud platform. # Digital Commerce Gateway Setup Setting up the Digital Commerce Gateway (DCG) ensures that the steps required to use the gateway are in place and configured correctly. **note:** The documentation in this section applies only to customers who have purchased the Digital Commerce Gateway license. The instructions provided don't work without the Digital Commerce Gateway license. To set up the Digital Commerce Gateway: 1. Identify or Create a Salesforce User 2. Create a Salesforce connected application. 1. For information about creating a connected application, see [Connected Apps](https://help.salesforce.com/articleView?id=sf.connected_app_overview.htm). 2. For information about creating a connected application for Digital Commerce, see [DCG Connected App Setup](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-dcg-connected-app-setup.md). 3. Copy the Connected Application Consumer Key (client_id) and paste it into a temporary file. The key is required later. 4. Copy the authorized user name (the name created in step 1). The name is required in the steps that follow. 3. Create a ticket with Salesforce Customer Support by providing the following information: 1. The environment name (such as dev1, uat, preprod, prod, and so on). Use this name when creating any future related support requests. 2. The organization type (such as test.salesforce.com or login.salesforce.com, and so on). 3. The connected application _consumer key_ (also known as client_id). 4. The authorized user name to use the connected application. Note that it is not necessary to provide the password or consumer secret. 5. Provide the version of the CME managed package, including the major number and minor number. To find the version numbers, navigate to the following documentation page to verify the package that you have installed in your Salesforce Org: [Industries Communications, Media and Energy Release Summary](https://help.salesforce.com/s/articleView?id=ind.comms_industries_communications__media_and_energy_release_summary.htm&type=5). Copy the name shown in the Version column (for example, 109.1.900.393). After the ticket has been received by Salesforce Customer Support, the following three items will be delivered: - Public Certificate for the Connected Application - Digital Commerce Gateway End-Point (API URL) - Digital Commerce Gateway OAUTH2 credentials 4. Import the Public Certificate into the Connected App. See Upload the Certificate to SFDC here: [DCG Connected App Setup](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-dcg-connected-app-setup.md). 5. Perform a test to ensure you have access to the Digital Commerce Gateway. Note that the Digital Commerce Gateway can be accessed only using OAuth2. For more information, refer to the [DCG OAuth2 Setup and Usage](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-dcg-oauth2-setup-and-usage.md). **note:** Run the DCG setup process again for these cases: - Re-integration of an existing DCG environment with a different Salesforce organization. - e-integration after a sandbox refresh. # Digital Commerce Lightning Web Component Artifacts You can use the Digital Commerce Lightning Web Components as a guide to creating your own digital commerce application. The artifacts include a Digital Commerce Guided Process that allows users to browse, configure, and add offers to a basket, and then begin a checkout process. Both the explore and checkout processes are built using Digital Commerce Lightning Web Components (LWC), which allow customers to browse and configure products as well as convert their baskets to a Salesforce Order by providing the ability to log in to CRM as an identified user (Account), optionally call a payment gateway system, and submit their order. Customer Service Agents can see the items in a customer's cart based on the order ID. The information on this page describes how to download and install the Digital Commerce Lightning Web Component artifacts. **note:** The dcCheckoutPayment component in the sample app contains a link to the Braintree payment service provider. The link is for demonstration purposes only; you must replace the link with your own Braintree link or other payment gateway. Depending on your requirements, you can download the modules best suited to your particular needs. The following sections describe the choices. ## Digital Commerce Lightning Web Components only If you need the Digital Commerce Lightning Web Components only (without OmniScript support), follow this link: [Explore and Checkout Using Digital Commerce LWC](https://github.com/Salesforce-Industries-Process-Library/Industries-CPQ/tree/samples) - Installation guide, which provides instructions for deploying each of the artifacts and how to download and use the NDS file. - A zip file containing HTML and meta.xml files of corresponding DC LWC's in the managed package. - A datapack file containing the VIP for the checkout process - A DX file containing data to be imported into your org to run the sample DC LWC Application. ## Digital Commerce Lightning Web Components With OmniScript support If you need the Digital Commerce Lightning Web Components with OmniScript support, follow this link: [Explore and Checkout Using Digital Commerce LWC OmniScript](https://github.com/Salesforce-Industries-Process-Library/Industries-CPQ/tree/samples/LWC%20Omniscript%20%2B%20DC%20LWC) - Installation guide, which provides instructions for deploying each of the artifacts and how to download and use the NDS file. - A zip file containing HTML and meta.xml files of corresponding DC LWC's in the managed package. - A datapack file containing sample Omniscript that embeds DC LWC to implement the purchase flow. - A DX file containing data to be imported into your org to run Sample the OmniScript that embeds DC LWC to implement the purchase flow. ## Digital Commerce Web Components and SDK for Off-Platform Use If you need the Digital Commerce Lightning Web Components with OmniScript support, follow this link: [Explore and Checkout for Off-Platform Use](https://github.com/Salesforce-Industries-Process-Library/Industries-CPQ/tree/samples/DC%20WC%20%2B%20DC%20SDK%20for%20Off-Platform%20Usage) - Installation guide, which provides instructions for how to deploy each of the artifacts, how to download and use NDS, instructions for how to download DC WC and DC SDK using NPM (without a password). - A zip file containing the reference application that showcases how DC WC can be customized. - A datapack file containing the VIP for the checkout process. - A DX file containing data to be imported into your org to run the sample DC WC application. # Digital Commerce Lightning Web Components This topic describes the Digital Commerce Lightning Web Components, which are intended for use on the Salesforce platform and follow the same standards as [Salesforce's Lightning Web Components](https://developer.salesforce.com/docs/component-library/documentation/lwc). Digital Commerce Lightning Web Components supplement Vlocity Lightning Web Components by incorporating calls to the set of Digital Commerce cacheable APIs. Digital Commerce APIs are RESTful Web APIs that are designed to enable client applications such as consumer-facing web and mobile apps to shop for products and services. Vlocity Communications API Caching is optimized for consumer shopping use cases where the user is often anonymous until well into the check-out process. OmniStudio Vlocity Lightning Web Components Vlocity Lightning Web Components are custom components and widgets built on Web Component standards that work with all modern browsers and can be distributed with any JavaScript library or framework. Web components allow you to create new custom, reusable, encapsulated HTML tags to use in your web pages or applications. The Digital Commerce Web Components developer reference has two versions: - [Current Version](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc/index.html) - [Spring '20 Version](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc107/lwc/107.0/index.html) | Component | Description | | ---------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [DCAppliedPromotionList](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc/DCAppliedPromotionList.html) | Render all the applied promotions. | | [DCAssetAttributes](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc/DCAssetAttributes.html) | Lists all asset attributes. | | [DCAssetDetails](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc/DCAssetDetails.html) | Renders each asset. | | [DCAssetItemDetails](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc/DCAssetItemDetails.html) | Displays asset details for each asset. | | [DCAssetsList](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc/DCAssetsList.html) | Displays all assets. | | [DCBaseComponent](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc/DCBaseComponent.html) | A base class that is extended by other lightning web components | | [dcBaseMixin](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc/dcBaseMixin.html) | <>A wrapper for [DCBaseComponent](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc/DCBaseComponent.html) that help implement your custom UI and leverage the Digital Commerce SDKExtends [OmniScript Base Mixin (omniscriptBaseMixin)](https://help.salesforce.com/s/articleView?id=sf.os_extend_the_omniscriptbasemixin_component_17717.htm&type=5)Enables a custom Salesforce URL for logged-in users by specifying the value of the salesforceCustomDomainUrl variableProvides methods to get an SDK instance, update custom URLs, load a CSS into custom LWCs, update OmniScript data, and other capabilitiesSupports the getTranslatedLabels translation method and its parameters: language and labels | | [DCCatalog](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc/DCCatalog.html) | Render the specified catalog list. | | [DCCheckOut](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc/DCCheckOut.html) | Supports the checkout workflow, including payment and submitting the order | | [DCCheckoutPayment](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc/DCCheckoutPayment.html) | Supports payment features | | [DCChildCatalogs](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc/DCChildCatalogs.html) | Render the specified catalog child list. | | [DCCustomAuthentication](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc/DCCustomAuthentication.html) | Reference implementation for sign-in or sign-up using redirect mechanism. | | [DCFilter](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc/DCFilter.html) | Render offer prices in the offer list. | | [DCGlobalHeader](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc/DCGlobalHeader.html) | Renders a global header available across all components except checkout. | | [DCMediaViewer](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc/DCMediaViewer.html) | Render a media carousel that cycles through media resources. | | [DCMyAccount](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc/DCMyAccount.html) | Renders user account. | | [DCOfferAddons](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc/DCOfferAddons.html) | Supports add-on offers and displays the child bundle options | | [DCOfferAttributeConfig](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc/DCOfferAttributeConfig.html) | Render attribute values and allow users to choose a predefined set of options. | | [DCOfferColorConfig](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc/DCOfferColorConfig.html) | Render color options for an offer. | | [DCOfferConfig](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc/DCOfferConfig.html) | Retrieve the selected offer details using the getOffer() API. The offer can also be configured in this component. | | [DCOfferConfigDetails](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc/DCOfferConfigDetails.html) | Render configuration details for an offer. | | [DCOfferConfigurations](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc/DCOfferConfigurations.html) | Render non-configurable offer attributes. | | [DCOfferGridView](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc/DCOfferGridView.html) | Render offers in a grid. | | [DCOfferGroup](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc/DCOfferGroup.html) | Render offers in a group. | | [DCOfferGroupSections](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc/DCOfferGroupSections.html) | Render the first child bundle options (optional). | | [DCOfferGroupSelection](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc/DCOfferGroupSelection.html) | Segment offer groups | | [DCOfferInputConfig](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc/DCOfferInputConfig.html) | Supports custom input | | [DCOfferListViewAttribute](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc/DCOfferListViewAttribute.html) | Render offer attributes in an offer list. | | [DCOfferListViewImage](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc/DCOfferListViewImage.html) | Render offer images in an offer list. | | [DCOfferListViewPrice](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc/DCOfferListViewPrice.html) | Render offer prices in an offer list. | | [DCOfferPaymentConfig](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc/DCOfferPaymentConfig.html) | Render payment options for an offer. | | [DCOffersList](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc/DCOffersList.html) | Retrieve the offers for the specified catalog-code using the getOffers() API. DCOffersList is a base class which is extended by all lightning web components. | | [DCOffersListView](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc/DCOffersListView.html) | Render offers in a list view. | | [DCProgressIndicator](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc/DCProgressIndicator.html) | Render a progress icon or a progress bar. | | [DCPromotionList](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc/DCPromotionList.html) | Render all available promotions. | | [DCReviewOrder](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc/DCReviewOrder.html) | Render all the order details so that the user can review them before submitting the order. | | [DCSampleApp](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc/DCSampleApp.html) | Container class where all components are rendered conditionally. | | [DCShoppingCart](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc/DCShoppingCart.html) | Render the offers that are being added to the cart. The cart may be updated before checkout. | | [DCShoppingcartNestedOffer](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc/DCShoppingcartNestedOffer.html) | Render child bundles of the offer that is being added to the cart. | | [DCShoppingCartOfferDetails](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc/DCShoppingCartOfferDetails.html) | Render details of the offers that are being added to cart. | | [DCSignIn](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc/DCSignIn.html) | Supports sign up and sign in | | [DCTotalBar](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc/DCTotalBar.html) | Render total cart prices. | | [DCUpdateBillingAddress](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc/DCUpdateBillingAddress.html) | Supports updates to billing and shipping addresses | # Digital Commerce Remote Calls You can use the code samples in this topic to make remote method calls to the Digital Commerce APIs for both anonymous and logged-in users. ## Sample Remote Calls Get Offers By Catalog for Anonymous Users: ```nolang String methodName; Map input = new Map(); Map output = new Map(); Map options = new Map(); // Setting remote parameters methodName = 'getOffersByCatalogCode'; input.put('apiName','getOffers'); input.put('catalogCode', 'ECOMM-CAT1'); input.put('pagesize','20'); input.put('offset','0'); //remote action invocation vlocity_cmt.CpqAppHandler appHandler = new vlocity_cmt.CpqAppHandler(); appHandler.invokeMethod(methodName, input, output, options); ``` For more details about which parameters correspond to the POST body, refer to the API documentation. Get Offers By Catalog for Logged In Users: ```nolang String methodName; Map input = new Map(); Map output = new Map(); Map options = new Map(); // Setting remote parameters methodName = 'getOffersByCatalogCode'; input.put('apiName','getOffers'); input.put('catalogCode', 'ECOMM-CAT1'); input.put('pagesize','20'); input.put('offset','0'); input.put('context','{"accountId":"accountId1", "contractId":"contractId1"}'); input.put('isloggedin','true'); //remote action invocation vlocity_cmt.CpqAppHandler appHandler = new vlocity_cmt.CpqAppHandler(); appHandler.invokeMethod(methodName, input, output, options); ``` Get Contains Products for Anonymous Users: ```nolang String methodName; Map input = new Map(); Map output = new Map(); Map options = new Map(); // Setting remote parameters methodName = 'getOffersByCatalogCode'; input.put('apiName','GetContainOffers'); input.put('catalogCode', 'ECOMM-CAT1'); input.put('requestURL', '/v3/catalogs/ECOMM-CAT1/offers?contains=Child1&context={}&pagesize=20&offset=0'); input.put('productCode', 'Child1');input.put('pagesize','20'); input.put('offset','0'); //remote action invocation vlocity_cmt.CpqAppHandler appHandler = new vlocity_cmt.CpqAppHandler(); appHandler.invokeMethod(methodName, input, output, options); ``` Get Contains Products for Logged In Users: ```nolang String methodName; Map input = new Map(); Map output = new Map(); Map options = new Map(); // Setting remote parameters methodName = 'getOffersByCatalogCode'; input.put('apiName','GetContainOffers'); input.put('catalogCode', 'ECOMM-CAT1'); input.put('requestURL', '/v3/catalogs/ECOMM-CAT1/offers?contains=Child1&pagesize=20&offset=0'); input.put('productCode', 'Child1');input.put('pagesize','20'); input.put('offset','0'); input.put('context','{"accountId":"accountId1", "contractId":"contractId1"}'); input.put('isloggedin','true'); //remote action invocation vlocity_cmt.CpqAppHandler appHandler = new vlocity_cmt.CpqAppHandler(); appHandler.invokeMethod(methodName, input, output, options); ``` GetOfferDetailsByCatalog for Anonymous Users: ```nolang String methodName; Map input = new Map(); Map output = new Map(); Map options = new Map(); // Setting remote parametersmethodName = 'getOfferDetailsByCatalogCode'; input.put('apiName','getOfferDetails'); input.put('catalogCode', 'ECOMM-CAT1'); input.put('requestURL', '/v3/catalogs/ECOMM-CAT1/offers/iPhone8Bundle'); //remote action invocation vlocity_cmt.CpqAppHandler appHandler = new vlocity_cmt.CpqAppHandler(); appHandler.invokeMethod(methodName, input, output, options); ``` GetOfferDetails ByCatalog for Logged In Users: ```nolang String methodName; Map input = new Map(); Map output = new Map(); Map options = new Map(); // Setting remote parameters methodName = 'getOfferDetailsByCatalogCode'; input.put('apiName','getOfferDetails'); input.put('catalogCode', 'ECOMM-CAT1'); input.put('requestURL', '/v3/catalogs/ECOMM-CAT1/offers/iPhone8Bundle'); input.put('context','{"accountId":"accountId1", "contractId":"contractId1"}'); input.put('isloggedin','true'); //remote action invocation vlocity_cmt.CpqAppHandler appHandler = new vlocity_cmt.CpqAppHandler(); appHandler.invokeMethod(methodName, input, output, options); ``` Get Basket for Logged In Users: ```nolang String methodName; Map input = new Map(); Map output = new Map(); Map options = new Map(); // Setting remote parameters methodName = 'getBasket'; input.put('apiName','basketOperations'); input.put('catalogCode', 'ECOMM-CAT1'); input.put('requestURL', '/v3/catalogs/ECOMM-CAT1/basket'); input.put('context','{"accountId":"accountId1", "contractId":"contractId1"}'); input.put('isloggedin','true'); input.put('cartContextKey', 'cartContextKey'); //remote action invocation vlocity_cmt.CpqAppHandler appHandler = new vlocity_cmt.CpqAppHandler(); appHandler.invokeMethod(methodName, input, output, options); ``` ## POST API Sample Calls Configure Offer for Anonymous or Logged In Users: ```nolang String methodName; Map input = new Map(); Map output = new Map(); Map options = new Map(); // Setting remote parameters methodName = 'configureOfferDetail'; input.put('apiName','ConfigureOfferDetail'); input.put('catalogCode', 'ECOMM-CAT1'); input.put('offerCode', 'iPhone8Bundle'); input.put('requestURL', '/v3/catalogs/ECOMM-CAT1/offer/iPhone8Bundle'); input.put('result', '{{offerdetailsStructure}}'); //remote action invocation vlocity_cmt.CpqAppHandler appHandler = new vlocity_cmt.CpqAppHandler(); appHandler.invokeMethod(methodName, input, output, options); ``` Additional parameters: ```nolang // Transactional break for ValidateAndPriceAction  input.put('orderId', '{{transactionKey}}'); // validate and price  input.put('validate', false); input.put('price', false); ``` Basket API for Anonymous or Logged In Users: ```nolang String methodName; Map input = new Map(); Map output = new Map(); Map options = new Map(); // Setting remote parametersmethodName = 'addWithNoConfig'; input.put('apiName','basketOperations'); input.put('catalogCode', 'ECOMM-CAT1'); input.put('offer', 'Product1');input.put('methodName', 'addWithNoConfig'); input.put('requestURL', '/v3/catalogs/ECOMM-CAT1/basket'); //remote action invocation vlocity_cmt.CpqAppHandler appHandler = new vlocity_cmt.CpqAppHandler(); appHandler.invokeMethod(methodName, input, output, options); ``` Additional parameters include different method names (note that their first letter is not capitalized unlike in REST POST body params): - addWithNoConfig - addAfterConfig - deleteFromBasket Additional input map parameters include: - offerDetails - same as productConfig - orderId - same as transactionKey - cartContextKey - deleteBundleNumber Refer to Basket APIs documentation for more details on what they correspond to in POST body params. ```nolang // validate and price  input.put('validate', false); input.put('price', false); ``` Basket API: Asset to Basket for Logged In Users: ```nolang String methodName; Map input = new Map(); Map output = new Map(); Map options = new Map(); // Setting remote parameters methodName = 'assetToBasket'; input.put('apiName','basketOperations'); input.put('catalogCode', 'ECOMM-CAT1'); input.put('requestURL', '/v3/catalogs/ECOMM-CAT1/basket'); input.put('methodName', 'assetToBasket'); input.put('context','{"accountId":"accountId1", "contractId":"contractId1", "rootAssetIds":["rootItemId1", "rootItemId2"]}'); input.put('isloggedin','true'); input.put('rootAssetIds', 'rootItemId1,rootItemId2'); input.put('requestDateTime', '2020-01-08T12:00:00.000z'); input.put('requestURL', '/v3/catalogs/ECOMM-CAT1/basket'); //remote action invocation vlocity_cmt.CpqAppHandler appHandler = new vlocity_cmt.CpqAppHandler(); appHandler.invokeMethod(methodName, input, output, options); ``` Additional Parameters: ```nolang // validate and price  input.put('validate', false); input.put('price', false); ``` Basket API: Delete From Basket for Anonymous or Logged in Users: ```nolang String methodName; Map input = new Map(); Map output = new Map(); Map options = new Map(); // Setting remote parameters methodName = 'deleteFromBasket'; input.put('apiName','basketOperations'); input.put('methodName','deleteFromBasket'); input.put('catalogCode', 'ECOMM-CAT1'); input.put('requestURL', '/v3/catalogs/ECOMM-CAT1/basket'); input.put('cartContextKey', 'cartContextKey'); //Use the cart context keyinput.put('bundleContextKey', 'bundleContextKey'); //Use the key of the bundle under which the line to be deleted input.put('lineItemKey', 'lineItemKey'); //Use the key of the line to be deleted input.put('context','{"accountId":"accountId1", "contractId":"contractId1"}'); input.put('isloggedin','true'); //remote action invocation vlocity_cmt.CpqAppHandler appHandler = new vlocity_cmt.CpqAppHandler(); appHandler.invokeMethod(methodName, input, output, options); ``` Additional parameters: ```nolang // validate and price  input.put('validate', false); input.put('price', false); ``` Basket API: Update Basket for Anonymous or Logged In Users: ```nolang String methodName; Map input = new Map(); Map output = new Map(); Map options = new Map(); // Setting remote parameters methodName = 'updateBasket';input.put('apiName','basketOperations'); input.put('methodName','updateBasket'); input.put('catalogCode', 'ECOMM-CAT1'); input.put('requestURL', '/v3/catalogs/ECOMM-CAT1/basket'); input.put('cartContextKey', 'cartContextKey'); //Use the cart context keyinput.put('bundleContextKey', 'bundleContextKey'); //Use the key of the bundle under which the line to be deleted input.put('lineItemKey', 'lineItemKey'); //Use the key of the line to be updatedinput.put('Quantity', 5); //Quantity to be updated input.put('context','{"accountId":"accountId1", "contractId":"contractId1"}'); input.put('isloggedin','true'); //remote action invocation vlocity_cmt.CpqAppHandler appHandler = new vlocity_cmt.CpqAppHandler(); appHandler.invokeMethod(methodName, input, output, options); ``` Additional parameters: ```nolang // validate and price input.put('validate', false); input.put('price', false); // to update attribute  input.put('attributeCategories', 'attributecategorystring'); //attribute category to be updated ``` Basket API : Add Multiple Items to a Basket: ```nolang String methodName; Map input = new Map(); Map output = new Map(); Map options = new Map(); methodName = 'addWithNoConfig'; input.put('apiName','basketOperations'); input.put('catalogCode', 'ECOMM-CAT1'); input.put('productConfig', [list of product configs]); //this is the list of product configs or single product config to add input.put('offer', [list of offers to add]); //list of offer codes to add or single offer code to add input.put('methodName', 'addAfterConfig'); input.put('requestURL', '/v3/catalogs/ECOMM-CAT1/basket'); //remote action invocation vlocity_cmt.CpqAppHandler appHandler = new vlocity_cmt.CpqAppHandler(); appHandler.invokeMethod(methodName, input, output, options); ``` Create Cart for Logged In Users: ```nolang String methodName; Map input = new Map(); Map output = new Map(); Map options = new Map(); // Setting remote parameters methodName = 'createEcomCart'; input.put('apiName','createEcomCart'); input.put('methodName','createEcomCart'); input.put('catalogCode', 'ECOMM-CAT1'); input.put('requestURL', '/v3/carts'); input.put('cartContextKey', 'cartContextKey');//Use the cart context key input.put('context','{"accountId":"accountId1", "contractId":"contractId1"}'); input.put('isloggedin','true'); //remote action invocation vlocity_cmt.CpqAppHandler appHandler = new vlocity_cmt.CpqAppHandler(); appHandler.invokeMethod(methodName, input, output, options); ``` Additional Parameters ```nolang // validate and price input.put('validate', false); input.put('price', false); //Old format:  input.put('catalogCode', 'Mobiles'); input.put('accountId', '001f200001eSlhe'); input.put('JSONResult', '{{AddTobasketResponse}}'); ``` Basket API : Add Child Items to a Basket: ```nolang String methodName; Map input = new Map(); Map output = new Map(); Map options = new Map(); // Setting remote parameters methodName = 'addWithNoConfig'; input.put('apiName','basketOperations'); input.put('catalogCode', 'catalog_Apr18'); input.put('offer', '300MbpsRouter-129356540'); input.put('methodName', 'addWithNoConfig'); input.put('cartContextKey', '1aa8bcbb632946e295cbe98b2fffa91b'); input.put('parentHierarchyPath', '01tDH000000MYRPYA4'); input.put('bundleContextKey', 'a9347c07-9793-4e78-8371-9ac4e50e96df'); input.put('parentLineItemKey', 'a9347c07-9793-4e78-8371-9ac4e50e96df'); input.put('requestURL', '/v3/catalogs/catalog_Apr18/basket'); //remote action invocation vlocity_cmt.CpqAppHandler appHandler = new vlocity_cmt.CpqAppHandler(); appHandler.invokeMethod(methodName, input, output, options); ``` # Digital Commerce REST API Reference The Digital Commerce REST API reference is located on the developer.salesforce.com website. [Digital Commerce REST API](https://developer.salesforce.com/docs/industries/cme/references/dc-rest1?meta=Summary) Digital Commerce REST APIs # Digital Commerce REST APIs Industries Digital Commerce APIs are RESTful Web APIs designed to enable client applications such as consumer-facing web and mobile apps to shop for products and services. The Digital Commerce APIs are optimized for consumer shopping use cases where the user may be anonymous until well into the check-out process. These APIs are also optimized to enable caching of API responses to provide performance enhancements and scalability. Finally, these APIs are optimized for lower bandwidth connections between the client app and the server by minimizing the metadata returned in the response. The Digital Commerce APIs are provided in addition to the Industries Cart Based APIs. The Cart Based APIs are optimized for highly interactive cart operations done by contact center agents and sales reps using an editor such as the Vlocity Cart UI. Therefore, Cart Based APIs provide more metadata to the client browser enabling a wide array of operations. Both the Cart Based CPQ APIs and the Digital Commerce APIs will continue to be supported and actively enhanced. The Digital Commerce APIs are not intended to replace the Cart based APIs. All of the Industries Omnichannel REST APIs simplify client app development by hiding the details of internal CPQ processing. Client-side developers do not need to understand details of the underlying CPQ logic: no need to know the proper order to apply eligibility and availability rules and no need to learn the methods of the underlying CPQ rules engines and other CPQ services. * * * The basic flow of API calls with the digital commerce APIs is as follows: 1. Get eligible offers from a catalog: GET /v3/catalogs/{catalogcode}/offers 2. Get the details of a specific offer retrieved from the previous call: GET /v3/catalogs/{catalogcode}/offers/{offercode} 3. Get the details of a specific offer with attribute values specified: POST /v3/catalogs/{catalogcode}/offers/{offercode} The above APIs retrieve eligible offers (products and/or promotions) from the specified catalog based on the customer context provided in the request, but these APIs only return default "starts-with" and base pricing information. To request more specific pricing and feedback on the validity of the configured bundle, use the basket APIs that follow. 4. Get a basket containing a configured offer bundle using an offer details response (3 above): POST /v3/catalogs/{catalogcode}/basket 5. Get a modification of the previous basket adding another bundle or deleting a bundle: POST /v3/catalogs/{catalogcode}/basket/{basketkey} The basket APIs get specific pricing for the context given by executing the Industries CPQ pricing services. The API returns a basket key that is a hash form of a cart containing the chosen items as configured. 6. Create a cart in Salesforce for a specific customer using the basket response (4 or 5 above): POST /v3/carts ## Servers * `https://xx##.salesforce.com/services/apexrest/vlocity_cmt` * `http://xx##.salesforce.com/services/apexrest/vlocity_cmt` Protocols: https, http. ## Operations ### GET Get application health, application build information, salesforce authentication,redis information (AWS only) `GET /app-status` Operation ID: `getAppStatus`. Tags: Audit. Get application health, details, build information and check jks keys and display\`s jks key expire information. Gets redis information and redis pool status. Note: Endpoint only for AWS. #### Responses * **200** successful operation Media type: `application/json`. Schema: `AppStatusResponse`. * **500** Invalid status value ### GET Diagnose the application and get current the information of application (AWS only) `GET /app-diagnostic` Operation ID: `getAppDiagnostic`. Tags: Audit. Get application diagnose information of salesforce , redis, application context. Note: Endpoint only for AWS. #### Responses * **200** successful operation Media type: `application/json`. Schema: `AppDiagnosticResponse`. * **500** Invalid status value ### GET Get Offers By Catalog, Get Featured Offers & Get Contains Products `GET /v3/catalogs/{catalogcode}/offers` Operation ID: `getOffersByCatalogCode`. Tags: Catalog. Get offers from the specified Catalog (identified by Catalog Code). Offers can be a product or a promotion (and in the future a product with an applied promotion). The sortby param can sort featured offers first in the result set. #### Parameters * `catalogcode` (path, string, required) Identifies the catalog of interest to a customer, prospect or partner. This defines the collection of offers to present to the users and sets a default price list and locale(lang). * `contains` (query, string) A Product Code (Product2.ProductCode) that is contained within one or more composite or bundle offers. Use to query for offers containing the desired component product such as an iPhone8. The sortby parameter (thus sorting) is not supported with the contains parameter in Fall '18. * `contextkey` (query, string) Context key (e.g. 784b264ea6dc63690369e721ffd8e112) which describes the anonymous or known customer's "context" to be used in rule processing. Use if the customer's context key is known. * `context` (query, array of string, collection format: csv) If isloggedin is not present in the api or isloggedin parameter value is false then, Context dimension values in the following format: dimension1:val1,dimension2:val2. Required if the context key or account id are not provided. The key value pairs specify Context Dimension values that describe the anonymous or known customer's "context" to be used in rule processing. If a value for any given context dimension defined in the Vlocity Product Catalog is not provided, the default value specified on the Context Dimension will be used to determine eligibility and pricing. If isloggedin is present in the api and isloggedin parameter value is set to true then, this parameter should have, accountId, contractId(optional), rootAssetIds(optional), example format for logged-in user context param : {"accountId":"idvalue", "contractId":"idvalue", "rootAssetIds": \["idvalue"\]} * `forceinvalidatecache` (query, boolean) For debugging purposes, TRUE will force a cache refresh for this key. This parameter only works when a server setting enables forceinvalidatecache to be set from the API. * `isloggedin` (query, boolean) A flag which describes if the user is logged-in or anonymous. If isloggedin flag is true, It indicates present api is used by a logged-in user, then we expect an accountId and a contractId in the context param of the api. If the isloggedin flag is false or if this param is not specified, It indicates present api is used by an anonymous user * `pagesize` (query, integer) Page size of results defined as the number of offers to return. Default pagesize can be set in the server (Vlocity API Metadata > API Params). * `offset` (query, integer) Offset of results to return. This is used along with pagination to request a specific page of results. For example, an offset value of 40 and pagesize of 20 will request that the server return the third page of offers. In other words, it should return 20 offers starting from the 40th offer in the complete list. If not specified in request, offset defaults to 1, but this can be overridden in the server (Vlocity API Metadata > API Params). * `sortby` (query, string) Name of Catalog Product Relationship field to sort by. Defaults to Sequence (Catalog Product Relationship > Sequence Number). * `excludeoverridedefinition` (query, boolean) A flag to skip the override definitions for attributes of promotional products. When False (Default) : The promotions will show the overridden values for all attributes. When True (excludeoverridedefinition=true) : The override definitions will be skipped and result will have default attributes. * `offerList` (query, string) offerList takes in a list of offers, separated by commas, as a input and the getOffers api returns eligible offers from that list. #### Responses * **200** successful operation Media type: `application/json`. Schema: `OffersApiResponse`. * **400** Invalid status value ### GET Get Offer Details `GET /v3/catalogs/{catalogcode}/offers/{offercode}` Operation ID: `getOfferDetails`. Tags: Catalog. Get detailed info about a specific offer (product or promotion). It returns the full hierarchy of a product or promotion as defined in the product catalog. #### Parameters * `catalogcode` (path, string, required) Identifies the catalog of interest to a customer, prospect or partner. This defines the collection of offers to present to the users and sets a default price list and locale(lang). * `offercode` (path, string, required) Identifies an offer of interest. Can be a Product Code or a Promo Code (GET only). (PRODUCTCODE+PROMOCODE and PROMOCODE ie addPromo cannot be supported for v103.) * `contextkey` (query, string) Context key (e.g. 784b264ea6dc63690369e721ffd8e112) which describes the anonymous or known customer's "context" to be used in rule processing. Use if the customer's context key is known. * `context` (query, array of string, collection format: csv) If isloggedin is not present in the api or isloggedin parameter value is false then, Context dimension values in the following format: dimension1:val1,dimension2:val2. Required if the context key or account id are not provided. The key value pairs specify Context Dimension values that describe the anonymous or known customer's "context" to be used in rule processing. If a value for any given context dimension defined in the Vlocity Product Catalog is not provided, the default value specified on the Context Dimension will be used to determine eligibility and pricing. If isloggedin is present in the api and isloggedin parameter value is set to true then, this parameter should have, accountId, contractId(optional), rootAssetIds(optional), example format for logged-in user context param : {"accountId":"idvalue", "contractId":"idvalue", "rootAssetIds": \["idvalue"\]} * `forceinvalidatecache` (query, boolean) For debugging purposes, TRUE will force a cache refresh for this key. This parameter only works when a server setting enables forceinvalidatecache to be set from the API. * `isloggedin` (query, boolean) A flag which describes if the user is logged-in or anonymous. If isloggedin flag is true, It indicates present api is used by a logged-in user, then we expect an accountId and a contractId in the context param of the api. If the isloggedin flag is false or if this param is not specified, It indicates present api is used by an anonymous user #### Responses * **200** successful operation Media type: `application/json`. Schema: `OfferDetailsApiResponse`. * **400** Invalid status value ### POST Get Offer Details With Configuration `POST /v3/catalogs/{catalogcode}/offers/{offercode}` Operation ID: `cfgOffer`. Tags: Catalog. Get detailed info about a specific offer. Accepts a configuration of the chosen offer (quantity and attribute values) to enable validation and pricing of that configuration. If the basketKey is passed in the input, it'll honour the rules on the basket items which can affect the offer configuration. #### Parameters * `catalogcode` (path, string, required) Identifies the catalog of interest to a customer, prospect or partner. This defines the collection of offers to present to the users and sets a default price list and locale(lang). * `offercode` (path, string, required) Identifies an offer of interest. Can be a Product Code or a Promo Code (GET only). (PRODUCTCODE+PROMOCODE and PROMOCODE ie addPromo cannot be supported for v103.) * `contextkey` (query, string) Context key (e.g. 784b264ea6dc63690369e721ffd8e112) which describes the anonymous or known customer's "context" to be used in rule processing. Use if the customer's context key is known. * `context` (query, array of string, collection format: csv) If isloggedin is not present in the api or isloggedin parameter value is false then, Context dimension values in the following format: dimension1:val1,dimension2:val2. Required if the context key or account id are not provided. The key value pairs specify Context Dimension values that describe the anonymous or known customer's "context" to be used in rule processing. If a value for any given context dimension defined in the Vlocity Product Catalog is not provided, the default value specified on the Context Dimension will be used to determine eligibility and pricing. If isloggedin is present in the api and isloggedin parameter value is set to true then, this parameter should have, accountId, contractId(optional), rootAssetIds(optional), example format for logged-in user context param : {"accountId":"idvalue", "contractId":"idvalue", "rootAssetIds": \["idvalue"\]} * `forceinvalidatecache` (query, boolean) For debugging purposes, TRUE will force a cache refresh for this key. This parameter only works when a server setting enables forceinvalidatecache to be set from the API. * `isloggedin` (query, boolean) A flag which describes if the user is logged-in or anonymous. If isloggedin flag is true, It indicates present api is used by a logged-in user, then we expect an accountId and a contractId in the context param of the api. If the isloggedin flag is false or if this param is not specified, It indicates present api is used by an anonymous user #### Request body (required) Apply this Product configuration to get the resultant prices. A Promotion configuration is not currently supported. OFFERCODE ADD will be a product for v103. OFFERCODE can be configured to get details but ADD has to happen. If offer is a product this input will specify the details to be added and the promotion context it is to be added in. (productconfiguration will be in the format as #/definitions/productconfiguration) Media type: `application/x-www-form-urlencoded`. Schema: `offerDetails`. #### Responses * **200** successful operation Media type: `application/json`. Schema: `OfferDetailsApiResponse`. * **400** Invalid status value ### POST Create Basket with basketAction = AddWithNoConfig/AddAfterConfig/AssetToBasket `POST /v3/catalogs/{catalogcode}/basket` Operation ID: `EmptyBasketOps`. Tags: Catalog Basket. Create a basket containing an offer bundle using one of three methods: 1. Pass basketAction = AddWithNoConfig and offer = Offer Code to add the offer without any configured attribute values. 2. Pass basketAction = AddAfterConfig and productConfig = result from Get Offer Details API to add a configured offer. 3. Pass basketAction = AssetToBasket and rootAssetIds = the root assets Ids and requestDateTime = the requested date time #### Parameters * `catalogcode` (path, string, required) Identifies the catalog of interest to a customer, prospect or partner. This defines the collection of offers to present to the users and sets a default price list and locale(lang). * `contextkey` (query, string) Context key (e.g. 784b264ea6dc63690369e721ffd8e112) which describes the anonymous or known customer's "context" to be used in rule processing. Use if the customer's context key is known. * `context` (query, array of string, collection format: csv) If isloggedin is not present in the api or isloggedin parameter value is false then, Context dimension values in the following format: dimension1:val1,dimension2:val2. Required if the context key or account id are not provided. The key value pairs specify Context Dimension values that describe the anonymous or known customer's "context" to be used in rule processing. If a value for any given context dimension defined in the Vlocity Product Catalog is not provided, the default value specified on the Context Dimension will be used to determine eligibility and pricing. If isloggedin is present in the api and isloggedin parameter value is set to true then, this parameter should have, accountId, contractId(optional), rootAssetIds(optional), example format for logged-in user context param : {"accountId":"idvalue", "contractId":"idvalue", "rootAssetIds": \["idvalue"\]} * `forceinvalidatecache` (query, boolean) For debugging purposes, TRUE will force a cache refresh for this key. This parameter only works when a server setting enables forceinvalidatecache to be set from the API. * `isloggedin` (query, boolean) A flag which describes if the user is logged-in or anonymous. If isloggedin flag is true, It indicates present api is used by a logged-in user, then we expect an accountId and a contractId in the context param of the api. If the isloggedin flag is false or if this param is not specified, It indicates present api is used by an anonymous user * `includeAttachment` (query, boolean) A flag which describes if the basket api should return attachments or not. The default value is false. If includeAttachment is true, the basket api returns the attachments. If the isloggedin flag is false, the basket api does not return the attachments. * `returnBasket` (query, boolean) This flag indicates whether to return basket in the AssetToBasket DC api response. The default value is true. So the assettobasket api will return the basket as earlier(backward compatible). If it is set to false, the assettobasket api will return only the basket key, not the complete basket. * `validatebasket` (query, boolean) This flag indicates whether to run the lightweight basket validation for basket and create cart api. The default value is true. So the effectivity and eligibility, of the offer being added to a basket and the existing basket, will be check. If it is set to false, the lightweight basket validation will not run. * `responseFormat` (query, string) This flag indicates whether the response must be trimmed, leaner, or full by taking the values trimResponse, leanerResponse, or fullResponse. By default it is set to fullResponse. #### Request body Basket Action post input Media type: `application/x-www-form-urlencoded`. Schema: `APINewBasketInput`. #### Responses * **200** successful operation Media type: `application/json`. Schema: `APIBasketResponse`. * **400** Invalid status value ### GET Get Basket Details `GET /v3/catalogs/{catalogcode}/basket/{basketkey}` Operation ID: `getBasketDetails`. Tags: Catalog Basket. get Details of a basket #### Parameters * `basketkey` (path, string, required) Basket key (e.g. 784b264ea6dc63690369e721ffd8e112). Key identifying the basket. * `catalogcode` (path, string, required) Identifies the catalog of interest to a customer, prospect or partner. This defines the collection of offers to present to the users and sets a default price list and locale(lang). * `contextkey` (query, string) Context key (e.g. 784b264ea6dc63690369e721ffd8e112) which describes the anonymous or known customer's "context" to be used in rule processing. Use if the customer's context key is known. * `context` (query, array of string, collection format: csv) If isloggedin is not present in the api or isloggedin parameter value is false then, Context dimension values in the following format: dimension1:val1,dimension2:val2. Required if the context key or account id are not provided. The key value pairs specify Context Dimension values that describe the anonymous or known customer's "context" to be used in rule processing. If a value for any given context dimension defined in the Vlocity Product Catalog is not provided, the default value specified on the Context Dimension will be used to determine eligibility and pricing. If isloggedin is present in the api and isloggedin parameter value is set to true then, this parameter should have, accountId, contractId(optional), rootAssetIds(optional), example format for logged-in user context param : {"accountId":"idvalue", "contractId":"idvalue", "rootAssetIds": \["idvalue"\]} * `validatebasket` (query, boolean) This flag indicates whether to run the lightweight basket validation for basket and create cart api. The default value is true. So the effectivity and eligibility, of the offer being added to a basket and the existing basket, will be check. If it is set to false, the lightweight basket validation will not run. * `responseFormat` (query, string) This flag indicates whether the response must be trimmed, leaner, or full by taking the values trimResponse, leanerResponse, or fullResponse. By default it is set to fullResponse. #### Responses * **200** successful operation Media type: `application/json`. Schema: `APIBasketResponse`. * **400** Invalid status value ### PUT Update Basket Items `PUT /v3/catalogs/{catalogcode}/basket/{basketkey}` Operation ID: `updateBasketItems`. Tags: Catalog Basket. update item in Basket(update quantity or attribute) #### Parameters * `basketkey` (path, string, required) Basket key (e.g. 784b264ea6dc63690369e721ffd8e112). Key identifying the basket. * `catalogcode` (path, string, required) Identifies the catalog of interest to a customer, prospect or partner. This defines the collection of offers to present to the users and sets a default price list and locale(lang). * `contextkey` (query, string) Context key (e.g. 784b264ea6dc63690369e721ffd8e112) which describes the anonymous or known customer's "context" to be used in rule processing. Use if the customer's context key is known. * `context` (query, array of string, collection format: csv) If isloggedin is not present in the api or isloggedin parameter value is false then, Context dimension values in the following format: dimension1:val1,dimension2:val2. Required if the context key or account id are not provided. The key value pairs specify Context Dimension values that describe the anonymous or known customer's "context" to be used in rule processing. If a value for any given context dimension defined in the Vlocity Product Catalog is not provided, the default value specified on the Context Dimension will be used to determine eligibility and pricing. If isloggedin is present in the api and isloggedin parameter value is set to true then, this parameter should have, accountId, contractId(optional), rootAssetIds(optional), example format for logged-in user context param : {"accountId":"idvalue", "contractId":"idvalue", "rootAssetIds": \["idvalue"\]} * `forceinvalidatecache` (query, boolean) For debugging purposes, TRUE will force a cache refresh for this key. This parameter only works when a server setting enables forceinvalidatecache to be set from the API. * `isloggedin` (query, boolean) A flag which describes if the user is logged-in or anonymous. If isloggedin flag is true, It indicates present api is used by a logged-in user, then we expect an accountId and a contractId in the context param of the api. If the isloggedin flag is false or if this param is not specified, It indicates present api is used by an anonymous user * `includeAttachment` (query, boolean) A flag which describes if the basket api should return attachments or not. The default value is false. If includeAttachment is true, the basket api returns the attachments. If the isloggedin flag is false, the basket api does not return the attachments. * `validatebasket` (query, boolean) This flag indicates whether to run the lightweight basket validation for basket and create cart api. The default value is true. So the effectivity and eligibility, of the offer being added to a basket and the existing basket, will be check. If it is set to false, the lightweight basket validation will not run. * `responseFormat` (query, string) This flag indicates whether the response must be trimmed, leaner, or full by taking the values trimResponse, leanerResponse, or fullResponse. By default it is set to fullResponse. #### Request body Basket Action post input Media type: `application/json`. Schema: `UpdateBasketInput`. #### Responses * **200** successful operation Media type: `application/json`. Schema: `APIBasketResponse`. * **400** Invalid status value ### POST Modify Basket `POST /v3/catalogs/{catalogcode}/basket/{basketkey}` Operation ID: `BasketOps`. Tags: Catalog Basket. Add/Delete/MultiDelete Offers to Basket 1. Pass basketAction = AddWithNoConfig and offer = Offer Code to add the offer without any configured attribute values. 2. Pass basketAction = AddAfterConfig and productConfig = result from Get Offer Details API to add a configured offer. Add/Delete Child products to a basket 1. For AddChildProduct Pass basketAction = AddWithNoConfig bundleContextKey = This represents bundle context key to which child product needs to be added offer = product code which needs to be added parentLineItemKey = This is the key of the parent under which the product needs to be added. In case the parent is a virtual product, the line key of the grand parent should be passed. parentHierarchyPath = This is the product hierarchy path of the parent. 2. For DeleteFromBasket Pass basketAction = DeleteFromBasket deleteBundleNumber(only in 103 and 104) = bundle Number which will be updated bundleContextKey = This represents bundle context key from which child product needs to be deleted lineItemKey = This is the key of the product to be deleted. Delete promotion from a basket 1. For DeleteFromBasket Pass basketAction = DeleteFromBasket offer = promotion code to be deleted appliedAction = Apply/Add/Existing, action of the applied promotion cancellationDate = This represents the cancellation date for promotion in case of MACD order cancellationReason = This represents the reason for cancellation of promo in case of MACD order When Standard Digital Commerce is enabled, cartContextKey, OrderId, and corresponding fields aren't returned. #### Parameters * `basketkey` (path, string, required) Basket key (e.g. 784b264ea6dc63690369e721ffd8e112). Key identifying the basket. * `catalogcode` (path, string, required) Identifies the catalog of interest to a customer, prospect or partner. This defines the collection of offers to present to the users and sets a default price list and locale(lang). * `contextkey` (query, string) Context key (e.g. 784b264ea6dc63690369e721ffd8e112) which describes the anonymous or known customer's "context" to be used in rule processing. Use if the customer's context key is known. * `context` (query, array of string, collection format: csv) If isloggedin is not present in the api or isloggedin parameter value is false then, Context dimension values in the following format: dimension1:val1,dimension2:val2. Required if the context key or account id are not provided. The key value pairs specify Context Dimension values that describe the anonymous or known customer's "context" to be used in rule processing. If a value for any given context dimension defined in the Vlocity Product Catalog is not provided, the default value specified on the Context Dimension will be used to determine eligibility and pricing. If isloggedin is present in the api and isloggedin parameter value is set to true then, this parameter should have, accountId, contractId(optional), rootAssetIds(optional), example format for logged-in user context param : {"accountId":"idvalue", "contractId":"idvalue", "rootAssetIds": \["idvalue"\]} * `forceinvalidatecache` (query, boolean) For debugging purposes, TRUE will force a cache refresh for this key. This parameter only works when a server setting enables forceinvalidatecache to be set from the API. * `isloggedin` (query, boolean) A flag which describes if the user is logged-in or anonymous. If isloggedin flag is true, It indicates present api is used by a logged-in user, then we expect an accountId and a contractId in the context param of the api. If the isloggedin flag is false or if this param is not specified, It indicates present api is used by an anonymous user * `includeAttachment` (query, boolean) A flag which describes if the basket api should return attachments or not. The default value is false. If includeAttachment is true, the basket api returns the attachments. If the isloggedin flag is false, the basket api does not return the attachments. * `validatebasket` (query, boolean) This flag indicates whether to run the lightweight basket validation for basket and create cart api. The default value is true. So the effectivity and eligibility, of the offer being added to a basket and the existing basket, will be check. If it is set to false, the lightweight basket validation will not run. * `responseFormat` (query, string) This flag indicates whether the response must be trimmed, leaner, or full by taking the values trimResponse, leanerResponse, or fullResponse. By default it is set to fullResponse. #### Request body Basket Action post input Media type: `application/x-www-form-urlencoded`. Schema: `APIExistingBasketInput`. #### Responses * **200** successful operation Media type: `application/json`. Schema: `APIBasketResponse`. * **400** Invalid status value ### POST Create Cart from Basket, Create Quote from Basket `POST /v3/carts` Operation ID: `CreateCartAfterConfigure`. Tags: Cart. Create a cart or quote on Salesforce using a basket of configured items returned from one of the basket APIs. This API adds all the requested items to the cart and configures them. The API will validate & price the cart after bulk adding the items. In this version the API will always create an Order (not a quote or opportunity). It returns the Order Number of the created cart and a link to the /v2 API to retrieve the full cart contents. When Standard Digital Commerce is enabled, we only support the context key in the input and not the JSON result. #### Parameters * `context` (query, array of string, collection format: csv) If isloggedin is not present in the api or isloggedin parameter value is false then, Context dimension values in the following format: dimension1:val1,dimension2:val2. Required if the context key or account id are not provided. The key value pairs specify Context Dimension values that describe the anonymous or known customer's "context" to be used in rule processing. If a value for any given context dimension defined in the Vlocity Product Catalog is not provided, the default value specified on the Context Dimension will be used to determine eligibility and pricing. If isloggedin is present in the api and isloggedin parameter value is set to true then, this parameter should have, accountId, contractId(optional), rootAssetIds(optional), example format for logged-in user context param : {"accountId":"idvalue", "contractId":"idvalue", "rootAssetIds": \["idvalue"\]} * `isloggedin` (query, boolean) A flag which describes if the user is logged-in or anonymous. If isloggedin flag is true, It indicates present api is used by a logged-in user, then we expect an accountId and a contractId in the context param of the api. If the isloggedin flag is false or if this param is not specified, It indicates present api is used by an anonymous user * `price` (query, boolean) A flag which describes if the pricing should be run in createCart api. If price is true, it runs pricing on the created cart. If price is false, it does not run pricing on the created cart. Default value is true. * `validate` (query, boolean) A flag which describes if the validation should be run in createCart api. If validate is true, it runs validation on the created cart. If validate is false, it does not run validation on the created cart. Default value is true. * `validatebasket` (query, boolean) This flag indicates whether to run the lightweight basket validation for basket and create cart api. The default value is true. So the effectivity and eligibility, of the offer being added to a basket and the existing basket, will be check. If it is set to false, the lightweight basket validation will not run. #### Request body A representation of the desired cart, including an array of product configurations which convert to cart items. Media type: `application/x-www-form-urlencoded`. Schema: `object`. * `accountId` (_string_, required) The customer account ID (Salesforce Id) for whom to create the cart. * `opportunityId` (_string_, required) The opportunity ID for which Quote needs to be created. Required for Create Quote. * `cartType` (_string_, required) The type of cart. In Classic DC, only an Order can be created. * `catalogCode` (_string_, required) The Catalog Code from which the customer is ordering. This defines the default price list to use for the cart. * `cartContextKey` (_string_, required) the context key of the basket. If we pass this parameter, JSONResult parameter is not required. * `assetReferenceKey` (_string_, required) assetReferenceKey returned in asset to basket. Required for baskets created from asset. Not required for draft baskets. * `JSONResult` (_string_, required) Serialized form of the JSONResult format retrieved from a Basket API. This describes the items and configuration to add to the created cart.(Not required in v105 or higher, recommend to use cartContextKey instead) * `orderFields` (_object_) Optional Order fields API name to value pairs, for updating those fields. Additional properties: `any`. * `orderItemFields` (_array of object_) Optional array of objects containing OrderItem fields api-name to value pairs, for updating those fields. Additional properties: `any`. * `quoteFields` (_object_) Optional Quote fields API name to value pairs, for updating those fields. Additional properties: `any`. * `quoteItemFields` (_array of object_) Optional array of objects containing QuoteItem. Additional properties: `any`. #### Responses * **200** successful operation Media type: `application/json`. Schema: `CreateCartResponse`. * **400** Invalid status value ## Schemas ### AppStatusResponse * `status` (_string_) Allowed values: `UP`, `DOWN`. * `details` (_object_) * `health` (_object_) * `status` (_string_) Allowed values: `UP`, `DOWN`. * `details` (_object_) * `app-name` (_string_) Name of the application * `version` (_string_) Application version * `build_time` (_string_) Application build time * `build_info` (_object_) Application build information will be displayed. * `commit` (_string_) Deployed commit information * `buildInfo` (_string_) Has information about user who triggered build * `branch` (_string_) Deployed branch information * `date` (_string (date-time)_) Application build time * `salesforce_last_contact` (_string_) * `app_start_time` (_string (date-time)_) Application start time * `jks_expire_ms` (_string (date-time)_) jks key application expire information * `redis` (_object_) * `status` (_string_) redis status Allowed values: `UP`, `DOWN`. * `details` (_object_) * `redis` (_string_) Allowed values: `UP`, `DOWN`. * `hits` (_integer_) Number of successful lookup of keys in the main dictionary * `misses` (_integer_) Number of failed lookup of keys in the main dictionary * `evicted` (_integer_) Number of evicted keys due to maxmemory limit * `expired` (_integer_) Total number of key expiration events * `hit_ratio` (_number_) Average hit ratio * `con_active` (_integer_) Number of connection in active * `con_idle` (_integer_) Number of connection idle in the pool * `con_wait` (_integer_) Number of threads waiting for the pool * `redis_pool_size` (_integer_) redis connection max pool size ### AppDiagnosticResponse * `app_context` (_object_) * `app_start_time` (_string (date-time)_) Application start time * `build_info` (_string_) Application build information * `jks_expire_ms` (_string (date-time)_) jks key application expire information * `sf` (_object_) * `authentication` (_object_) * `method` (_string_) Allowed values: `JWT`, `secretkey`. * `status` (_string_) Allowed values: `success`, `failure`. * `useLoginFlow` (_string_) used for development, will be disabled by default in prod Allowed values: `disabled`, `enabled`. * `cmt_access` (_object_) * `root_service_path` (_string_) salesforce service root path * `status_api_message` (_string_) * `namespace` (_string_) connected salesforce org namespace * `status_api_call` (_string_) Allowed values: `failure`, `success`. * `redis` (_object_) * `set` (_string_) Allowed values: `success`, `failure`. * `get` (_string_) Allowed values: `success`, `failure`. * `cache_partition_key` (_string_) cache partition key for application * `expiry` (_string_) redis cache expiry status Allowed values: `success`, `failure`. ### OffersApiResponse * `contextKey` (_string_) * `offers` (_array of Offer_) * `nextOffersAction` (_ApiRestAction_) Next page offers ### OfferDetailsApiResponse * `contextKey` (_string_) Refreshed contextkey * `result` (_offerDetails_) * `errorCode` (_string_) Example: `INVOKE-200`. * `error` (_string_) Example: `OK`. ### offerDetails * `offer` (_OfferDetail_) ### APINewBasketInput * `basketAction` (_string_, required) Defines the action to take to create the basket. Options are: * AddWithNoConfig - use when passing Offer Code only \* AddAfterConfig - use when passing productConfig \* AssetToBasket - use when doing a MACD \* DeleteFromBasket - use when passing deleteBundleNumber to get a modified basket without the specified bundle Allowed values: `AddWithNoConfig`, `AddAfterConfig`, `AssetToBasket`. * `offer` (_string_, required) Required when basketAction = 'AddWithNoConfig', OfferCode to be added or deleted. In case of multi add, the offercodes should be separated by comma. For example- "iphone11" in case of single add, \["iphone11","iphone12"\] in case of multi add. * `transactionKey` (_string_) Optional continuation key to be passed. (Recommended to use multiTransactionKey from CMT105) * `multiTransactionKey` (_string_) Optional transactionkey to be passed if the api requires more than one transaction. In case of cache miss, the api may need more than one transaction to complete in order to avoid hitting the salesforce governing limits( SOQL, DML, heap size, cpu time). So in order to handle that, the api will break when any of the above configured salesforce governing limit is exceeded and it will return the multiTransactionKey. So the UI can invoke the same API again with the multiTransactionKey and the API will proceed from previous step. The configured salesforce governing limits are configurable through following custom settings - SOQL - NumberOfQueriesPerTransaction DML - NumberOfDMLPerTransaction CPU Time - MaxCPUTimePerTransaction Heap Size - MaxHeapSizePerTransaction * `productConfig` (_OfferDetailsInput_) OfferDetail of the offer to be added. In case of multi add, the product configs should be separated by comma. For example- {ProductConfig1} in case of single add, \[{ProductConfig1},{ProductConfig2}\] * `requestDateTime` (_string_) Required when basketAction = 'AssetToBasket', requested date-time for the Asset To Basket * `rootAssetIds` (_string_) Required when basketAction = 'AssetToBasket', comma separated list of root asset ids * `canCreateBasket` (_boolean_) Required when basketAction = 'AssetToBasket', performs check whether we can create a basket for the requested date. So you can not create a basket for a previous date (for example 1st July 2020) if there a open order with higher request date (for example 1st August 2020). Default value is false. If it is false, then the above check is not performed. ### APIBasketResponse * `cartContextKey` (_string_) * `assetReferenceKey` (_string_) * `nexttransaction` (_MTSRestAction_) Returned if the api requires more than one transaction. It contains the multiTransactionKey to be used in next transaction. * `createCartAction` (_ApiRestAction_) Action to create cart. * `validateAndPriceAction` (_object_) * `params` (_BasketContinuationResponse_) * `result` (_object_) * `totals` (_object_) * `EffectiveOneTimeTotal__c` (_number_) * `EffectiveRecurringTotal__c` (_number_) * `EffectiveUsagePriceTotal__c` (_number_) * `totalSize` (_integer_) * `BasketValidationResult` (_object_) * `isBasketValid` (_boolean_) * `basketValidationMessage` (_string_) * `isOffersEffective` (_boolean_) * `isPricingEffective` (_boolean_) * `IneligibleOffers` (_array of object_) It contains the details of offer for which the eligibility has failed. This will a part of response only if the offers in the basket are ineligible. If the eligibility has failed for anonymous user flow then the value will be an array of offer name that failed eligibility If the eligibility has failed for logged in user flow then the value will be an array of object where each object will be a mapping of offer name and the reason for eligibility fail * `InvalidOffers` (_object_) It contains the details of offer for which the effectivity has failed. This will a part of response only if the offers in the basket are eligible and 1 or more offers has failed the effectivity * `InvalidPLEs` (_array of InvalidPLEs_) * `InvalidProducts` (_array of InvalidProducts_) * `InvalidPromotions` (_array of InvalidPromotions_) * `records` (_array of JSONResultRecord_) ### UpdateBasketInput * `basketAction` (_string_, required) Defines the action to update Basket. Allowed values: `updateBasket`. * `bundleContextKey` (_string_, required) key of the bundle * `lineItemKey` (_string_, required) key of the line item to be updated * `Quantity` (_string_) quantity to be updated, this is required if you are updating the quantity. * `attributeCategories` (_string_) attribute to be updated, this is required if you are updating the attribute. * `fieldsToBeUpdated` (_object_) * `vlocity_cmt__UsageQuantity__c` (_string_) usage quantity to be updated, this is required if you are updating the usage quantity. * `transactionKey` (_string_) Optional continuation key to be passed ### APIExistingBasketInput * `basketAction` (_string_, required) Defines the action to take to create the basket. Options are: * AddWithNoConfig - use when passing Offer Code only \* AddAfterConfig - use when passing productConfig \* DeleteFromBasket - use when passing deleteBundleNumber to get a modified basket without the specified bundle Allowed values: `AddWithNoConfig`, `AddAfterConfig`, `DeleteFromBasket`. * `offer` (_string_, required) Required when basketAction = 'AddWithNoConfig', OfferCode to be added or deleted * `deleteBundleNumber` (_string_) Required when basketAction = 'DeleteFromBasket', 0-Based number of toplevel Bundle to be deleted(not required in v105 or higher) * `itemsToDelete` (_object_) Required when basketAction = 'DeleteFromBasket', with multiple deletions in a single API. * `lineItemKey` (_string_) Key of the basket line item * `bundleContextKey` (_string_) Key of the bundle * `bundleContextKey` (_string_, required) Key of the bundle * `lineItemKey` (_string_) Key of the basket line item * `parentLineItemKey` (_string_, required) Key of the parent line item * `parentHierarchyPath` (_string_, required) Product Hierarchy Path of the parent * `transactionKey` (_string_) Optional continuation key to be passed(Recommended to use multiTransactionKey from CMT105) * `multiTransactionKey` (_string_) Optional transactionkey to be passed if the api requires more than one transaction. In case of cache miss, the api may need more than one transaction to complete in order to avoid hitting the salesforce governing limits( SOQL, DML, heap size, cpu time). So in order to handle that, the api will break when any of the above configured salesforce governing limit is exceeded and it will return the multiTransactionKey. So the UI can invoke the same API again with the multiTransactionKey and the API will proceed from previous step. The configured salesforce governing limits are configurable through following custom settings - SOQL - NumberOfQueriesPerTransaction DML - NumberOfDMLPerTransaction CPU Time - MaxCPUTimePerTransaction Heap Size - MaxHeapSizePerTransaction * `productConfig` (_OfferDetailsInput_) ### CreateCartResponse * `orderNumber` (_string_) Exclusive to Create Cart. Example: `11761`. * `orderId` (_string_) Exclusive to Create Cart. Example: `801f2000000uk6fAAA`. * `quoteId` (_string_) Exclusive to Create Quote. Example: `0Q0xx0000004E4OCAU`. * `errorCode` (_string_) Example: `INVOKE-200`. * `error` (_string_) Example: `OK`. * `action` (_object_) * `CartItems` (_object_) * `rest` (_object_) * `link` (_string_) The assembled URL (minus the [HTTP://hostname](HTTP://hostname)). Example: `/v2/carts/801f2000000uk6fAAA/items`. ### Offer * `offerDetailsAction` (_ApiRestAction_) OfferDetails API contextkey = from previous response * `qualification` (_Qualification_) * `addToCart` (_ApiRestAction_) Basket Action * `offerCode` (_string_) OfferCode is non null if a promo was applied * `offerType` (_string_, required) Allowed values: `product`, `promotion`. * `Name` (_string_, required) * `Description` (_string_) * `ProductCode` (_string (date-time)_) * `AttributeCategory` (_array of AttributeCategoryRecord_) * `priceResult` (_array of PriceResultRecord_) * `products` (_array of Product_) ### ApiRestAction * `params` (_array of object_) * `link` (_string_) * `method` (_string_) Allowed values: `POST`, `GET`, `PUT`, `DELETE`. ### OfferDetail * `addToCart` (_ApiRestAction_) Basket Action * `Name` (_string_, required) * `ProductCode` (_string_) * `Product2Id` (_string_) * `PricebookEntryId` (_string_) * `Quantity` (_string_) * `vlocity_cmt__UsageQuantity__c` (_string_) * `minQuantity` (_string_) * `maxQuantity` (_string_) * `groupMinQuantity` (_string_) * `groupMaxQuantity` (_string_) * `productHierarchyPath` (_string_) * `lineNumber` (_string_) * `Id` (_string_) * `Description` (_string_) * `vlocity_cmt__SellingStartDate__c` (_string (datetime)_) * `vlocity_cmt__SellingEndDate__c` (_string (datetime)_) * `vlocity_cmt__EndOfLifeDate__c` (_string (datetime)_) * `vlocity_cmt__IsOrderable__c` (_string_) * `IsActive` (_boolean_) * `offerType` (_string_, required) Allowed values: `product`, `promotion`. * `AttributeCategory` (_array of AttributeCategoryRecord_) * `Attachments` (_array of object_) * `contentType` (_string_) Example: `image`. * `defaultAttachment` (_boolean_) Example: `false`. * `description` (_string_) * `displayConditionsData` (_string_) * `mimeType` (_string_) Example: `image/jpeg`. * `sequenceNumber` (_integer_) * `title` (_string_) * `url` (_string_) * `priceResult` (_array of PriceResultRecord_) * `childProducts` (_array of OfferDetail_) ### OfferDetailsInput * `offerDetails` (_object_) * `offer` (_offerDetails_) ### MTSRestAction * `params` (_object_) * `multiTransactionKey` (_string_) Example: `3d712d4a3b14cea4187ea9a5332cff0e`. * `method` (_string_) Example: `addWithNoConfig`. ### BasketContinuationResponse * `transactionKey` (_string_) Continuation key to be passed back for incomplete transaction * `offer` (_string_) * `basketAction` (_string_) * `context` (_string_) ### InvalidPLEs Contains the details of invalid Price List Entries(PLE) with invalid fields (1 or more) for offers * `OfferName` (_object_) * `PLECode` (_string_) Example: `Invalid Field1`. ### InvalidProducts Contains the details of invalid products with the invalid fields (1 or more) * `ProductName` (_array of object_) * `SellingStartDate` (_string_) * `SellingEndDate` (_string_) * `EndOfLifeDate` (_string_) * `IsActive` (_boolean_) * `IsOrderable` (_boolean_) ### InvalidPromotions Contains the details of invalid promotions with the invalid fields (1 or more) * `PromotionName` (_array of object_) * `EffectiveStartDate` (_string_) * `EffectiveEndDate` (_string_) * `IsActive` (_boolean_) * `IsOrderable` (_boolean_) ### JSONResultRecord * `actions` (_object_) * `item` (_object_) Action to get details of this offer -> GET /v3/catalogs/{catalogcode}/offers/{offercode}?contextkey={CONTEXTKEY} Does not provide all optional parameters such as: - cartContextkey or cartContext = MOST RECENT CARTContext, to be set by caller (NOT returned from backend) because another Add could have happened since this getOffers call, which could've modified cartcontext. - AppliedPromotionCode = NULL * `method` (_string_) HTTP method to use on the URL. If multiple are enabled, comma-delimit them. Allowed values: `GET`, `POST`. Example: `GET,POST`. * `link` (_string_) The assembled URL (minus the [HTTP://hostname](HTTP://hostname)). Example: `/services/apexrest/vlocity_cmt/v3/catalogs/CATALOG_CODE/offers/PRODUCTCODE?contextkey=6a8c75ba46f6bb6d529def9b992571fa`. * `addtocart` (_object_) Action to add this item to the user's cart. API -> POST /v3/carts POST BODY will contain - contextkey = from previous response - cartContextkey, cartContext = MOST RECENT CARTContext, to be set by caller (NOT returned from backend) eg another Add could have happened since this getOffers call, which could've modified cartcontext. * `method` (_string_) HTTP method to use on the URL. If multiple are enabled, comma-delimit them. Allowed values: `POST`. Example: `POST`. * `link` (_string_) The assembled URL (minus the [HTTP://hostname](HTTP://hostname)). Example: `/services/apexrest/vlocity_cmt/v3/carts?contextkey=6a8c75ba46f6bb6d529def9b992571fa`. * `attributeCategories` (_object_) * `records` (_array of AttributeCategoryRecord_) * `lineItemKey` (_string_) * `bundleContextKey` (_string_) * `productGroups` (_object_) * `records` (_array of JSONResultRecord_) * `totalSize` (_integer_) * `lineItems` (_object_) * `records` (_array of JSONResultRecord_) * `totalSize` (_integer_) * `productCategories` (_object_) * `records` (_array of any_) * `totalSize` (_integer_) * `vlocity_cmt__FulfilmentStatus__c` (_array of BasketNodeResponse_) * `vlocity_cmt__FirstVersionOrderItemId__c` (_array of BasketNodeResponse_) * `vlocity_cmt__SupersededOrderItemId__c` (_array of BasketNodeResponse_) * `vlocity_cmt__SupplementalAction__c` (_array of BasketNodeResponse_) * `vlocity_cmt__CatalogItemReferenceDateTime__c` (_array of BasketNodeResponse_) * `vlocity_cmt__CpqPricingMessage__c` (_array of BasketNodeResponse_) * `vlocity_cmt__CpqCardinalityMessage__c` (_array of BasketNodeResponse_) * `vlocity_cmt__ItemName__c` (_array of BasketNodeResponse_) * `vlocity_cmt__BillingAccountId__c` (_array of BasketNodeResponse_) * `vlocity_cmt__ServiceAccountId__c` (_array of BasketNodeResponse_) * `vlocity_cmt__CpqMessageData__c` (_array of BasketNodeResponse_) * `vlocity_cmt__RecurringDiscountPrice__c` (_array of BasketNodeResponse_) * `vlocity_cmt__ParentItemId__c` (_array of BasketNodeResponse_) * `vlocity_cmt__SubAction__c` (_array of BasketNodeResponse_) * `vlocity_cmt__RootItemId__c` (_array of BasketNodeResponse_) * `vlocity_cmt__RecurringTotal__c` (_array of BasketNodeResponse_) * `vlocity_cmt__RecurringManualDiscount__c` (_array of BasketNodeResponse_) * `vlocity_cmt__RecurringCharge__c` (_array of BasketNodeResponse_) * `vlocity_cmt__RecurringCalculatedPrice__c` (_array of BasketNodeResponse_) * `vlocity_cmt__UsageUnitPrice__c` (_array of BasketNodeResponse_) * `vlocity_cmt__UsageQuantity__c` (_array of BasketNodeResponse_) * `vlocity_cmt__UsagePriceTotal__c` (_array of BasketNodeResponse_) * `vlocity_cmt__UsageMeasurementId__c` (_array of BasketNodeResponse_) * `vlocity_cmt__ProvisioningStatus__c` (_array of BasketNodeResponse_) * `vlocity_cmt__ProductHierarchyPath__c` (_array of BasketNodeResponse_) * `vlocity_cmt__ProductHierarchyGroupKeyPath__c` (_array of BasketNodeResponse_) * `vlocity_cmt__ProductGroupKey__c` (_array of BasketNodeResponse_) * `vlocity_cmt__Product2Id__c` (_array of BasketNodeResponse_) * `vlocity_cmt__PricingLogData__c` (_array of BasketNodeResponse_) * `vlocity_cmt__OneTimeTotal__c` (_array of BasketNodeResponse_) * `vlocity_cmt__OneTimeManualDiscount__c` (_array of BasketNodeResponse_) * `vlocity_cmt__OneTimeCharge__c` (_array of BasketNodeResponse_) * `vlocity_cmt__OneTimeCalculatedPrice__c` (_array of BasketNodeResponse_) * `vlocity_cmt__LineNumber__c` (_array of BasketNodeResponse_) * `vlocity_cmt__IsChangesAllowed__c` (_array of BasketNodeResponse_) * `vlocity_cmt__InCartQuantityMap__c` (_array of BasketNodeResponse_) * `vlocity_cmt__EffectiveUsagePriceTotal__c` (_array of BasketNodeResponse_) * `vlocity_cmt__EffectiveRecurringTotal__c` (_array of BasketNodeResponse_) * `vlocity_cmt__EffectiveOneTimeTotal__c` (_array of BasketNodeResponse_) * `vlocity_cmt__CurrencyPaymentMode__c` (_array of BasketNodeResponse_) * `vlocity_cmt__AssetReferenceId__c` (_array of BasketNodeResponse_) * `vlocity_cmt__Action__c` (_array of BasketNodeResponse_) * `Quantity` (_array of BasketNodeResponse_) * `PricebookEntryId` (_array of BasketNodeResponse_) * `ListPrice` (_array of BasketNodeResponse_) * `UnitPrice` (_array of BasketNodeResponse_) * `SellingPeriod` (_string_) * `action` (_string_) * `itemType` (_string_) * `orderActive` (_boolean_) * `hasChildren` (_boolean_) * `lineNumber` (_string_) * `isVirtualItem` (_boolean_) * `name` (_string_) * `productHierarchyPath` (_string_) * `productChildItemId` (_string_) * `sequenceNumber` (_integer_) * `groupMaxQuantity` (_integer_) * `groupMinQuantity` (_integer_) * `maxQuantity` (_integer_) * `minQuantity` (_integer_) * `defaultQuantity` (_integer_) * `productId` (_string_) * `Pricebook2Id` (_string_) * `ProductCode` (_string_) * `sginteg234__RecurringPrice__c` (_integer_) * `IsActive` (_boolean_) * `Product2Id` (_string_) * `Name` (_string_) * `displaySequence` (_integer_) * `Product2` (_object_) * `productChildItemDefinition` (_object_) * `PricebookEntry` (_object_) ### Qualification * `qualificationType` (_string_) Example: `Hard Fail`. * `message` (_string_) Example: `Account Sla is not Gold`. ### AttributeCategoryRecord * `messages` (_Messages_) * `displaySequence` (_integer (int32)_) * `Code__c` (_string_) Example: `NonSubscription`. * `Name` (_string_) Example: `Non Subscription Attributes`. * `id` (_string_) Example: `a0K0E000001m0tGUAQ`. * `productAttributes` (_ProductAttributes_) ### PriceResultRecord * `adjustments` (_array of object_) * `overrides` (_array of object_) * `unitOfMeasure` (_object_) unitOfMeasure defined on the ChargeMeasurement\_\_c for Usage Based Pricing * `Name` (_string_) * `Id` (_string_) * `vlocity_cmt__GlobalKey__c` (_string_) * `attributes` (_object_) * `chargeamount` (_number_) chargeamount is calculated by subtracting the adjustments from baseamount (baseamount- adjustments). * `baseamount` (_number_) This is the baseprice. * `IsVirtualPrice__c` (_boolean_) This is the IsVirtualPrice\_\_c flag defined on the Price List Entry of this price. * `IsBasePrice__c` (_boolean_) This is the IsBasePrice\_\_c flag defined on the Price List Entry of this price. * `effectiveuntildatespec` (_string (date-time)_) Specifies how the EffectiveUntilDate value can be calculated based on the Time Plan and Time Policy attached to the Price List Entry of this price. * `effectivefromdatespec` (_string (date-time)_) Specifies how the EffectiveFromDate value can be calculated based on the Time Plan and Time Policy attached to the Price List Entry of this price. * `SubType__c` (_string_) This is the SubType\_\_c defined on the Pricing Variable of the Price List Entry of this price. * `Type__c` (_string_) This is the Type\_\_c defined on the Pricing Variable of the Price List Entry of this price. * `RecurringFrequency__c` (_string_) This is the RecurringFrequency\_\_c defined on the Pricing Variable of the Price List Entry of this price. * `ChargeType__c` (_string_) This is the ChargeType\_\_c defined on the Pricing Variable of the Price List Entry of this price. * `DisplayText__c` (_string_) This is the DisplayText\_\_c defined on the Price List Entry of this price. ### Product * `Name` (_string_) * `Description` (_string_) * `Action:detailAction` (_string_) * `records` (_array of AttributeCategoryRecord_) * `priceResults` (_array of PriceResultRecord_) ### BasketNodeResponse * `actions` (_object_) * `alternateValues` (_string_) * `dataType` (_string_) * `editable` (_boolean_) * `fieldName` (_string_) * `hidden` (_object_) * `label` (_string_) * `messages` (_array of any_) * `originalValue` (_integer_) * `previousValue` (_integer_) * `value` (_integer_) ### Messages Array of `object`. * `severity` (_string_) * `messageId` (_string_) * `code` (_integer (int32)_, required) * `message` (_string_, required) ### ProductAttributes * `totalSize` (_integer_, read-only) Number of records in the records array. Example: `2`. * `messages` (_Messages_) * `records` (_array of Attribute_) ### Attribute * `messages` (_Messages_) * `categorycode__c` (_string_) * `categoryname__c` (_string_) * `code` (_string_) Example: `Frequency`. * `dataType` (_string_) Example: `text`. * `inputType` (_string_) Example: `dropdown`. * `multiselect` (_boolean_) Example: `false`. * `required` (_boolean_) Example: `true`. * `readonly` (_boolean_) Example: `false`. * `disabled` (_boolean_) Example: `false`. * `filterable` (_boolean_) Example: `true`. * `attributeId` (_string_) Example: `a0L0E000001GTMpUAO`. * `label` (_string_) Example: `Frequency`. * `displaySequence` (_integer_) Sequence to display in the UI. Example: `1`. * `hasRules` (_boolean_) Example: `false`. * `hidden` (_boolean_) Example: `false`. * `values` (_array of AttributeValue_) * `userValues` (_string_) Example: `red,blue`. ### AttributeValue * `id` (_string_) Example: `10`. * `name` (_string_) Example: `10`. * `label` (_string_) Example: `Day`. * `readonly` (_boolean_) Example: `false`. * `disabled` (_boolean_) Example: `false`. * `value` (_string_) Example: `10`. * `defaultSelected` (_boolean_) Example: `false`. # Digital Commerce SDK Architecture The Digital Commerce Software Development Toolkit (SDK) is a JavaScript library that abstracts and simplifies the use of [Digital Commerce API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-digital-commercecacheableapis.md) calls. The SDK improves usability and reduces the effort to develop compelling user interfaces by hiding complex API semantics inside the SDK interface. The SDK can be used in either of two ways: as a client-side SDK, or as a proxy SDK, redirecting all calls to the SDK running on a Node.js server. Refer to the following architecture diagrams. ![Digital Commerce SDK UI Architecture](https://developer.salesforce.com/docs/media/cme_107_1_proxy_sdk.png) ![Digital Commerce SDK Architecture](https://developer.salesforce.com/docs/media/cme_109_proxy_sdk.png) See [ServerSDK Overview](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-serversdk-overview.md) for more information. In some cases, the SDK invokes more than one API call (as required by some APIs) to complete a request. In the previous architecture diagram, various UI components are shown calling the SDK, which in turn, calls the appropriate Digital Commerce API and returns a result. ## Digital Commerce UI Interaction The SDK ensures that errors are detected before API calls are made so that data structure rules are honored and data is not written incorrectly to Industries Cart or to the product database. The SDK consolidates common application and business front-end logic that is shared by different user interfaces such as Vlocity Digital Commerce Lightning Web Components and Web Components, and Custom Digital Commerce UI. Components (which can be based on any framework), CMT Mobile App Shopping UI, OmniScripts that use Digital Commerce APIs, and so on. **tip:** Salesforce recommends that you do not call the API directly and instead use the SDK. [Vlocity Digital Commerce APIDigital Commerce (Cacheable) APIs](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-digital-commercecacheableapis.md) documentation is available for your reference so that you can understand the data that is included in various calls. The SDK supports Node.js module delivery. Each module has its own context, cannot interfere with other modules, or interfere with global scope. See: [Vlocity Digital Commerce SDK developer reference](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/sdk/index.html). ## SDK Proxy Support The Digital Commerce Server SDKs support a proxy configuration by using an optional proxyUrl parameter when creating the SDK instance. For example: ```nolang const digitalCommerceConfig1 = window.VlocitySDK.digitalcommerce.createConfigForLoginUser( "https://{instance}.my.salesforce.com", "00D3i000000Eeay!AQoAQH8O7aSMu. Foz1fYdtz9kGiodgGRdOuox1wFlRG9a_JgnLi1n. jcjvTDc0XVyvGyENudSuhucZEUj_fhUxh2DHRDxHcK", "https://node-salesforce-proxy.herokuapp.com/proxy/" // use your proxy URL); ``` # Digital Commerce SDK implementation You can easily integrate the ServerSDK with the Digital Commerce UI by using the Proxy SDK library. The Proxy SDK is very lightweight and shares the same signatures as the other Digital Commerce client SDKs, requiring no changes to UI code. 1. Import ProxySDK from **node_modules** to the UI: ```nolang ``` 2. Meta tag config ```nolang meta name="vlocity-dc-enable-proxy-sdk" value="enable" /> ``` 3. Call Proxy SDK methods ```nolang let input = Object.assign(this.digitalCommerceSDK.createGetOffersInput(), {"input" : "inputValue"}); this.digitalCommerceSDK.getOffers(input).then(response => { ``` # Digital Commerce SDK Installation The Digital Commerce SDK allows experienced software developers to create user applications that simplify and abstract the Digital Commerce APIs. See [Digital Commerce (Cacheable) APIs](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-digital-commercecacheableapis.md) for more information. ## Prerequisites Please ensure you meet the following prerequisites before attempting to use the Digital Commerce Software Development Toolkit: - Knowledge of software development using JavaScript. - Knowledge using the npm package manager (see [https://www.npmjs.com/](https://www.npmjs.com/)). - An integrated development environment (IDE) such as Microsoft Visual Studio (see [https://code.visualstudio.com/](https://code.visualstudio.com/)). ## See also For code examples demonstrating SDK functionality, see the following (depending on the version of the software you are using): - [SDK Usage Examples (Winter '20 version)](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-sdk-usage-exampleswinter20-version-.md) - [SDK Usage Examples (Fall '20 version)](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-sdk-usage-examplesfall20-version-.md) - [SDK Usage Examples (Fall '19 version)](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-sdk-usage-examplesfall19-version-.md) # Digital Commerce SDK Troubleshooting This topic provides hints and tips for troubleshooting and fixing common issues while using the Vlocity SDK. ## Example: SDK returns 0 or null, or does not return correct data In the following code sample, the SDK does not return correct data even though the fields have data in the Salesforce cache: ![Code sample - SDK does not return correct data](https://developer.salesforce.com/docs/media/sdk_ex1.png) The API response is as follows: ![Code sample - API response](https://developer.salesforce.com/docs/media/sdk_ex1a.png) ## Solution The root cause of this issue is that the SDK maps fields in the following format: ```nolang namespace__fieldname ``` You should ensure that the namespace specified in the SDK matches the one defined for the org. ```nolang this.digitalCommerceSDK.namespace = "vlocity_cmt"; ``` After setting the correct namespace, the SDK will return correct values from related fields. ![Code sample - SDK returns correct values from related fields](https://developer.salesforce.com/docs/media/sdk_ex1b.png) # Digital Commerce Server SDK Installation After running the steps in this topic, you can host or deploy the ServerSDK to a Node.js server, or you can run ServerSDK in local mode. 1. Navigate to the [Salesforce Industries Process Library](https://github.com/Salesforce-Industries-Process-Library/Industries-CPQ/tree/samples) and download the serverSDK reference app zip file. 2. Unzip the folder and add it to your IDE. Navigate to `vop_server_sdk/secure-server-reference-app`; this will be the root folder. 3. Set up the org. ServerSDK uses OAuth 2.0 JSON Web Token (JWT) bearer flow to authenticate the server. Therefore, you must generate a public/private key pair and create a Connected App. See [https://github.com/lekkimworld/salesforce-jwt-generator](https://github.com/lekkimworld/salesforce-jwt-generator). 1. Generate a public/private key pair. Generate a public/private key pair using `openssl` and fill in the required information when you generate the certificate, as shown here: ```nolang openssl req -newkey rsa:2048 -nodes -keyout private_key.pem -x509 -days 365 -out certificate.pem openssl x509 -outform der -in certificate.pem -out public_key.der openssl x509 -in certificate.pem -pubkey > public_key.pem ``` 2. Create connected APP and upload the CER (certificate) file to SFDC. In Salesforce, create a Connected App using the App Manager in Setup and upload the public key (public_key.cer) to the app. Be sure to select the offline_access scope as well as other required scopes. Save the Connected App and make a note of the consumer key (issuer_id). 4. Configure Authentication The ServerSDK application has an authentication layer which is responsible for validating a user identity against an authentication server such as Firebase, Cognito and so on. A reference implementation using Firebase as an authentication strategy has been used in the app by default. However, you may easily swap Firebase for any other third-party authentication system by creating a custom authentication strategy. - Create a folder in the `vop_server_sdk/secure-server-reference-app/authentication/strategies` directory. In the folder, create a file and Implement the IAuthenticationStrategy interface. The implementing class should define the properties with the corresponding method of the third-party authentication system. For example, the implementation of sign-In method should have the sign-In logic of the third-party authentication system you want to use. - After you have created your custom authentication strategy, open the `AuthenticationStrategy.ts` file and import your customize strategy and initialize it inside the constructor. 5. Set up the `config.json` file. Locate the `config.json` file in `vop_server_sdk/secure-server-reference-app/config.json` ![Server SDK Installation](https://developer.salesforce.com/docs/media/sdk_config_json.png) 1. Enter the consumer key (issuer_id) that you noted in step 2. 2. In the org Id field, enter the username of the salesforce user.org namespace. 3. In the org.namespace field, enter the SF org namespace. 6. Configure the `sdkConfig.ts` file. Locate the `sdkConfig.ts` file located in `vop_server_sdk/secure-server-reference-app/sdkConfig.ts`. Make the following changes in the section indicated: _strategyConfig_ - If you are using Firebase as the authentication server then set a strategyConfig object. _jwtConfig_ - Paste the `private_key.pem` and `public_key.pem` files generated from step2 in vop_server_sdk/secure-server-reference-app/certificates folder for JWT sign _remoteSite_ - For anonymous users, the URL is an anonymous URL of the org and namespace will be the org namespace. _allowlist_ - When you are requesting from a CORS domain, you must specify the domain here. ![Server SDK Installation - Configure](https://developer.salesforce.com/docs/media/sdk_sdkconfig.png) 7. Configure the `package.json` file. In the `vop_server_sdk/secure-server-reference-app/package.json` file, under the dependencies object, update SDKs with version 109, as shown here: ![Server SDK Installation - configure package JSON](https://developer.salesforce.com/docs/media/sdk_109_version.png) **note:** Ensure that you add the `.npmrc` file. The `.npmrc` file is required to authenticate with the Vlocity private npm registry. For public access, use the default access token. # Digital Commerce ServerSDK Client Setup and Usage You can configure the ServerSDK for use with the client-side SDK or with the proxy server SDK. ## Client-Side SDK Using the client-side implementation, the Digital Commerce APIs are called directly from the client for guest users. After signing in, all Digital Commerce APIs are called from ServerSDK. ## Proxy SDK Using the Proxy SDK, all Digital Commerce APIs are called from ServerSDK. The Proxy SDK library is very light weight and shares the same signatures as the other Digital Commerce client SDK, requiring no code changes in the user interface. ## Digital Commerce Lightning Web Component Setup Add Digital Commerce Lightning Web Component client setup information (on-Platform customers can also use ServerSDK to log in using third-rd party authentication server). Edit your LWC component HTML include file `\\` component with the attributes shown here: ```nolang   ``` | Attribute | Description | | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | checkout-api-url | Contains a value that specifies the URL where ServerSDK is hosted. | | secure-server-api-request-credentials | Contains a value that specifies a value indicating whether the user agent should send cookies to the secure server if it is hosted on another domain in the case of cross-origin requests. Possible values are: include,omit and same-origin (default value) | | checkout-payment-url | Contains a value that specifies the checkout payment URL. | | enable-proxy-sdk | Contains a boolean value (true or false). The default valus is false. If set to true, the Digital Commerce, Account, Translation Proxy SDK instances will be created. | | auth-configuration | Contains your Firebase or custom auth configuration details. You can create custom auth config by overriding dcCustomAuthenticationUtil. | # Digital Commerce ServerSDK Overview The ServerSDK is a reference implementation that serves as a middle layer between the user interface and the Digital Commerce APIs. ServerSDK runs the SDK methods on any Node.js supported server and provides REST APIs that you can interact with. ServerSDK provides the following advantages: - Provides support for third-party authentication systems. - Avoids exposure of Salesforce account IDs to the UI. - Avoids exposure of org details such as namespace, remote site URL and authorization tokens for off-platform users. - Provides protected endpoint URLs. - Supports the **isloggedin** input parameter for all Digital Commerce APIs. - iOS and Android native clients can reuse the same application logic in the SDK that other UI platforms have been using to implement Digital Commerce. **note:** Additional information: - Additional server-side configuration and setup are required to support serving with clustering and HTTP/2. - An SSL certificate is required to serve as HTTP/2 protocol - The server enables Redis or another central caching mechanism when serving with a cluster. - Heroku does not support HTTP/2 protocol. ## ServerSDK Architecture The ServerSDK reference app consists of three layers: Authentication Layer, SF connection Layer, and App Business Layer, as shown in the following illustration: ![ServerSDK Architecture](https://developer.salesforce.com/docs/media/serversdk_arch.png) - Authentication Layer: The authentication layer is responsible for validating the identity of a user. Currently, the reference implementation uses Firebase as an authentication strategy; however, a different third-party authentication system may be used by creating a custom authentication strategy. To develop your own authentication strategy, follow the steps below: - Create a folder inside the strategies directory and inside that folder create a file and Implement `IAuthenticationStrategy` interface. The implementing class should define the properties with the corresponding method of the third-party authentication system. For example, the implementation of the signIn method should have the signIn logic of your third-party authentication system that you want to use. - Once you have created your custom authentication strategy, open the `AuthenticationStrategy.ts` file, import your customized strategy, and initialize it inside the constructor. - Connection layer: To request access to the Salesforce data ServerSDK, the reference app has a connection layer that is responsible for connecting the app to the Salesforce connected app using JWT OAuth Flow. The jsonwebtoken generator is used internally to create a JSON Web Token (JWT) using the RS256 algorithm. RS256 is an open standard that defines a compact and self-contained way to securely transmit information between parties as a JSON object. - App Business layer: The app business layer is the layer that determines how the application’s endpoints (URIs) respond to client requests .In this layer, the Digital Commerce SDK is imported from Node.js modules, which use its methods to define the route logic of the None.js application. The ServerSDK Reference app may be divided into two flows; Auth flow and accessing the protected URLs, described below: - Auth flow: Once a request is made to the /signIn or /signUp endpoints of the ServerSDK reference application, the authentication layer is reached. Here, the user's identity is authenticated or created. If the user provides details that are incorrect or incomplete, authentication fails and an error message is sent back to the client. However, If the authentication succeeds, a connection to Salesforce connected app is built using the connection layer of the application and an account id of the signedIn user is created and fetched from the Salesforce app. The accountId is then stored in the session object of the user’s session on the Node application. Express-session is used as session middleware. - Access protected URLs: The ServerSDK reference app has protected endpoint URLs that have a customizable validateUser middleware that catches invalid requests to the APIs. Therefore, if a user tries to access a protected URL without authentication, a 401-Unauthorised error will be returned. Only after the user has successfully signed in would they be able to access the protected endpoint URLs. ## Pros and Cons of running Digital Commerce SDK on a server Running the Digital Commerce SDK on a Server

Pros

Cons

Running the Digital Commerce SDK on a server is an advantage for clients that have configuration limitations (such as disk space limitations, lack of computation power or memory) because computation cycles are moved to the server and won't use client resources.

Client sensitive information such as access_token, account Id, and namespace are stored on the server and are therefore not passed to the client.

The URL of the Digital Commerce APIs is hidden from the client because the user calls server endpoints.

Using REST calls, native iOS and Android mobile apps can reuse application logic in the Digital Commerce SDK when running on the server.

Digital Commerce SDK running on the server may be used as an API warmer. Calling an API the first time has a latency delay, invoking the Digital Commerce API using the SDK once every hour can eliminate API latency.

Server-to-server Enterprise Integration

An extra API layer exists between the user interface and the Digital Commerce APIs. However, this overhead may be reduced by optimizing the server.

There is an additional cost to running and maintaining a server.

Setting up clustering and HTTP/2 might require devOps (Development and Operations) expertise.

## Pros and Cons of Running the Server on the Client Running the Digital Commerce SDK on the client.
  

Because the SDK is running on the client, there are no additional cost associated with running and maintaining a server.

Clients with high configuration (disk, computation power and memory) would see response time improvement as the client would be communicating directly with the v3 API.

Clients running on less powerful devices, such as mobile devices, might see slower responses because the SDK is using the client’s resources.

Sensitive information such as access_token, accountId, and namespace might be exposed on the client side.

The Digital Commerce API endpoint URL might be exposed on the network tab of the browser.

## APIs supported by ServerSDK When running the SDK on a server, 21 REST APIs are available for use with the translation SDK, account SDK and digital Commerce SDK to accommodate different requirements. - /fetchtranslations - /getoffers - /getfilteredofferslist - /getoffer - /validateoffer - /getselectedoffer - /addtocart - /getpromotions - /updateitemsincart - /getitemsincart - /authenticateuser - /signIn - /signOut - /updateDetails - /createOrder - /submitOrder - /getcontracts - /getassets - /getassetsbyaccount - /getaccountoffers # Digital Commerce Support for Offer Specification Extend Offer Specifications to your Digital Commerce solution. With Offer Specification, sales teams can simplify the creation of new offers and bundles and reduce product modeling efforts. With simplified offer creation, you can get to market faster. Offer Specification allows service providers flexibility for existing subscribers to manage in-life changes with purchased configurations. With Offer Specifications for Digital Commerce, you can: - Decouple offers from specifications so current products are not disrupted. - Reduce product modeling effort. Product modeling is aligned to TM Forum standards for increased competitive advantage. Enhanced Digital Commerce cache includes Populate and Regenerate API Cache jobs that are aware of Offer Specification design. Available specification types are: - Offer - Product Offering - Product - Product Specification - Service (not functional as of CME Summer ‘21). - Resource (not functional as of CME Summer ‘21). ## Product Specification A product specification is a product with specification type as product, which represents product offerings that are externally presented to the market. A product offering can be assembled from a reusable product specification. A product specification describes the characteristics of what the customer can do after making a purchase. The product offering is the market vision, while the product specification is the effective component description, from the perspective of a service provider, that is leveraged to compose the product offering. Product specifications cannot contain other associated product specifications. Product specification subtypes consist of: - Simple product specifications with no children. This is a product offering with no children but can have an associated product specification. The associated product specification characteristics are mapped to the product offering. Characteristics can include rules, attributes, or applicable promotions. ![Product Specification - Simple product specifications with no children](https://developer.salesforce.com/docs/media/dc_simple_offer.png) - Bundle (composite) product specification with children of specification type Product. This is a product offering with children but cannot have an associated product specification. ![Product Specification - Bundle product specifications with children](https://developer.salesforce.com/docs/media/dc_bundle_offer.png) ## Product Offering A Product offering is a product with specification type as Offer, which represents product offerings that are externally presented to the market. A product offering can be assembled from a reusable product specification, which is sometimes referred to as product spec. ## Get Offer Details API Support for Offer Specification Offer Spec only impacts Digital Commerce APIs when there is no support for Unit of Work (UOW) mode. Once support for UOW mode exists, the only impact to Digital Commerce APIs is for cases with override, which require validation. Validation is implemented as part of UOW support for the getOfferDetails API. The Get Offer Details API retrieves the details of an offer, which can be a product or promotion, from a specified catalog. The offer details generated are the complete product details and product hierarchy for a product or the details of the promotions and their promotional items, along with the full hierarchy of the promotional item. - PCIs/DataStore: For a given offer, this API fetches the full product hierarchy using the Product Hierarchy service. The full product hierarchy and hierarchicalProductListGenerator generate the entire JSON result. The generated JSON result is converted to the offerDetail structure. If the input offer product is of type Offer Specification when using ProductHierarchyService and HierarchicalProductListGenerator, then building the hierarchy is not possible. - Products: Fetching a product with the type simple offer specification based on the current implementation does not allow for building the hierarchy. Using ProductHierarchyService and HierarchicalProductList generator prevents fetching the full hierarchy for the product with a simple offer specification with an associated bundle product specification. - Promotions - Group Cardinality - Pricing - Overrides V2ProductHierarchyService generates the hierarchy and JSON result. V2OverrideService processes any overrides. # Digital Commerce Support for Versioning Extend Product Versioning to your Digital Commerce solution to accelerate product innovation and market responsiveness. With Product Versioning, sales teams can support and track offer modifications to existing offers without business disruption. With Product Versioning, you can also modify offers and deploy changes without disruption. This feature is now extended to your Digital Commerce solution. With Product Versioning for Digital Commerce, you can: - Introduce product changes to ongoing transactions without disruption. - Reduce order fallout with version management in CPQ and order fulfillment. - Track and compare product versions. Accurate ordering through the Digital Commerce solution is aligned with periodic product configurations changes. Product Versioning for Digital Commerce supports: - Browse and Search that accurately returns valid product versions driven by current or reference date and time through a URL parameter `referencedatetime` for all Cacheable APIs. The default is currentDate() in GMT. - Enhanced Digital Commerce cache, which includes Populate and Regenerate API Cache jobs that are aware of versioned products. - Configuration and Basket operations that accurately capture product configuration and checkout specific to your chosen product version in the Digital Commerce customer journey. - The Populate API Cache job, which contains a new batch job, named Version Info List Generator, that generates the cache for multiple versions of the same product. The job contains information about all versions of the same product and promotion. - Time slices that store information to maintain snapshots of product version configurations at different time intervals. In the Digital Commerce solution, product offers and child products are cached, which is primarily driven by the catalog definition. With versioning enabled, cache management and jobs are enhanced to cache all versions of an offer structure definition by time-slice to support the browsing of offers, new purchase flow, and change orders. The Digital Commerce solution supports versioning on the cacheable APIs in the on-platform Salesforce layer. The Digital Commerce APIs leverage the persistent cache in the cached API response table generated either through the cache initialization batch jobs (populate API cache), cache refresh batch jobs (regenerate batches), or data cached during the processing of a cache miss flow. Digital Commerce does not support future-dated cache with Versioning enabled. **note:** To enable the Product Versioning feature, customers must contact their Account Executives (AEs). Starting with the Winter'26 release, any new customer attempting to enable this feature will receive an error message instructing them to contact their AE. # Digital Commerce Web Component Setup Follow the steps in this section to configure ServerSDK to take advantage of the Digital Commerce Web Components. 1. Add SDK and digitalcommerce-components-src in your package.json file., as shown here: ![Add SDK and digitalcommerce-components-src](https://developer.salesforce.com/docs/media/sdk_rename.png) 2. Add the `.npmrc` file. The `.npmrc` file is required to authenticate with the Vlocity private npm registry. For public access, use the default access token. Contact Salesforce Customer Support to obtain the authorization token. ![Add the ​.npmrc​ file](https://developer.salesforce.com/docs/media/sdk_auth.png) 3. In the `index.html` file, add and define the meta tag as shown here: ![Add and define the meta tag in the ​index.html​​ file](https://developer.salesforce.com/docs/media/sdk_metatag.png) Meta name definitions: | Meta tag name attribute | Description | | --------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | vlocity-dc-remote-site-url | Contains the content attribute, which may be a SalesForce instance URL for known users or an AWS URL for anonymous users. | | vlocity-dc-remote-method-type | Contains an attribute value that specifies the logon method, which can be either "knownUser" for known users or "anonymousUser" for anonymous users. | | vlocity-dc-org-namespace | Contains value attributes that specify the org namespace. | | vlocity-dc-payment-url | Contains value attributes that specify the checkout payment URL. | | vlocity-dc-secure-server-url | Contains value attributes that specify the URL where ServerSDK is hosted. | | vlocity-dc-secure-server-request-credentials) | Contains value attributes that specify a value indicating whether the user agent should send cookies to the secure server if it is hosted on another domain in the case of cross-origin requests. Possible values are: include, omit and same-origin (default value) | | vlocity-dc-enable-proxy-sdk | Contains value attributes that specify the value “enable”. If set to enable, the Digital Commerce, Account, and Translation Proxy SDK instance will be created. | 4. In your `index.html` file, import the SDK using the script tag, as shown here: - If using the Client-Side SDK: ![Script tag, client-Side SDK index.html​​ file](https://developer.salesforce.com/docs/media/sdk_client.png) - If using the Proxy SDK ![Script tag, Proxy SDK index.html​​ file](https://developer.salesforce.com/docs/media/sdl_proxy.png) 5. To initialize a Firebase SDK strategy in your Web Component application, you must configure Firebase authorization details. You can initialize Firebase from any component simply by importing `vlocity-dc-authentication-util` and passing Firebase authorization configuration to the initAuthConfig method. ![Import ​vlocity-dc-authentication-util​ and pass Firebase authorization configuration to the ​initAuthConfig​​ method](https://developer.salesforce.com/docs/media/sdk_lwc.png) **note:** You can configure a custom authentication by creating your own authorization strategy and then importing it and passing it as an input parameter to the configureAuthentication method of the vlocity-dc-authentication-util component. Once configured, you can initialize it and use your custom authorization strategy. ![Configure a custom authentication](https://developer.salesforce.com/docs/media/sdk_lwc2.png) 6. From your JS file, import the `SDK-util` file: ```nolang import { digitalCommerceSDKInstance } from "@vlocity-cme-wc/digitalcommerce-components-src/vlocity-dc-utils/vlocity-dc-sdk-utils"; ``` Get the SDK instance: ```nolang this.digitalCommerceSDK = digitalCommerceSDKInstance().digitalCommerce; ``` Call the SDK methods: ```nolang let input = this.digitalCommerceSDK.createGetOffersInput() this.digitalCommerceSDK.getOffers(input).then(response => {}); ``` # Digital Commerce Web Components Digital Commerce Web Components are built on Web Component standards that work with all modern browsers and can be distributed with any JavaScript library or framework. Web components allow you to create new custom, reusable, encapsulated HTML tags to use in your web pages or applications. Use Digital Commerce Web Components to implement an eCommerce solution. These components support all of the major phases of any eCommerce solution, namely browse phase, configure phase, cart phase, and checkout. You can use these web components as-configured or they can be customized based on client requirements. The Digital Commerce reference app is available to Salesforce customers and partners as a working sample to learn more about the Digital Commerce solution. Current Salesforce customers and partners can explore how Digital Commerce web components work with the Digital Commerce SDK by accessing the Digital Commerce Web Component Reference App which is located in a zip file in a VPL. See [Digital Commerce Lightning Web Component Artifacts](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-digital-commerce-lightning-web-component-artifacts.md) for information and links to the VPL. The reference implementation showcases preconfigured SDK and web component dependencies, sample apps, and build/deploy scripts for off-platform development. Digital Commerce Web Components were developed using a Google library called LitElement, which is a simple base class for creating fast, lightweight web components. Web Components are encapsulated. You can develop your applications using any library and any tool that supports Web Standards. There are no dependencies on Google Polymer, however, and because of its foundation on LitElement, Digital Commerce Web Components provides full support for a shadow DOM. You can use Digital Commerce Web Components to develop Single-Page-Applications (SPAs) and non-SPA applications. Each web component comes with defined methods to retrieve data and a Newport style template to render data. See [Digital Commerce Web Components developer reference](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/wc/index.html). For the Spring '20 version of the Digital Commerce Web Components developer reference see [https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/wc107/index.html](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/wc107/index.html) | Component | Description | | ----------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | | [VlocityAssetAttributes](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/wc/VlocityAssetAttributes.html) | Render asset attributes. | | [VlocityDCAppliedPromotionList](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/wc/VlocityDCAppliedPromotionList.html) | Render all the applied promotions. | | [VlocityDCAssetDetails](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/wc/VlocityDCAssetDetails.html) | Render each asset. | | [VlocityDCAssetItemDetails](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/wc/VlocityDCAssetItemDetails.html) | Display asset details for each asset. | | [VlocityDCAssetsList](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/wc/VlocityDCAssetsList.html) | Display all the assets. | | [VlocityDCBaseComponent](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/wc/VlocityDCBaseComponent.html) | Base class extended by all DC components. This class contains common logic of all components. | | [VlocityDCCatalog](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/wc/VlocityDCCatalog.html) | Render the specified catalog list. | | [VlocityDCCheckout](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/wc/VlocityDCCheckout.html) | Supports the checkout workflow, including payment and submitting the order. | | [VlocityDCChildCatalog](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/wc/VlocityDCChildCatalog.html) | Render the specified catalog child list. | | [VlocityDCEditModal](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/wc/VlocityDCEditModal.html) | Supports basket updates. | | [VlocityDCFilter](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/wc/VlocityDCFilter.html) | Render offer prices in the list of offers. | | [VlocityDCFirebaseRedirectStrategy](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/wc/VlocityDCFirebaseRedirectStrategy.html) | Used for sign-in or sign-up using redirect mechanism. | | [VlocityDCGlobalHeader](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/wc/VlocityDCGlobalHeader.html) | Renders a global header which is available across all components except checkout. | | [VlocityDCHomePage](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/wc/VlocityDCHomePage.html) | Render the home screen during the browse phase. | | [VlocityDCMain](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/wc/VlocityDCMain.html) | Contains internal navigation logic between different screens/phases. | | [VlocityDCMediaViewer](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/wc/VlocityDCMediaViewer.html) | Render a media carousel that cycles through media resources. | | [VlocityDCModal](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/wc/VlocityDCModal.html) | Render a modal popup. | | [VlocityDCMyAccount](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/wc/VlocityDCMyAccount.html) | Render user account. | | [VlocityDCOfferAddons](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/wc/VlocityDCOfferAddons.html) | Supports add-on offers and displays the child bundle options. | | [VlocityDCOfferAttributeConfig](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/wc/VlocityDCOfferAttributeConfig.html) | Render attribute values and allow users to choose a predefined set of options. | | [VlocityDCOfferColorConfig](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/wc/VlocityDCOfferColorConfig.html) | Render color options for an offer. | | [VlocityDCOfferConfig](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/wc/VlocityDCOfferConfig.html) | Retrieve the selected offer details using the getOffer() API. The offer can also be configured in this component. | | [VlocityDCOfferConfigDetails](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/wc/VlocityDCOfferConfigDetails.html) | Render configuration details for an offer. | | [VlocityDCOfferConfigurations](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/wc/VlocityDCOfferConfigurations.html) | Render non-configurable offer attributes. | | [VlocityDCOfferGridView](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/wc/VlocityDCOfferGridView.html) | Render offers in a grid. | | [VlocityDCOfferGroup](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/wc/VlocityDCOfferGroup.html) | Render offers in a group. | | [VlocityDCOfferGroupSections](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/wc/VlocityDCOfferGroupSections.html) | Render the first child bundle options. | | [VlocityDCOfferGroupSelection](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/wc/VlocityDCOfferGroupSelection.html) | Segment offer groups. | | [VlocityDCOfferInputConfig](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/wc/VlocityDCOfferInputConfig.html) | Supports custom input. | | [VlocityDCOfferListView](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/wc/VlocityDCOfferListView.html) | Render a list of all the offers. | | [VlocityDCOfferListViewAttribute](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/wc/VlocityDCOfferListViewAttribute.html) | Render offer attributes in an offer list. | | [VlocityDCOfferListViewImage](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/wc/VlocityDCOfferListViewImage.html) | Render offer images in an offer list. | | [VlocityDCOfferListViewPrice](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/wc/VlocityDCOfferListViewPrice.html) | Render offer prices in an offer list. | | [VlocityDCOfferPaymentConfig](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/wc/VlocityDCOfferPaymentConfig.html) | Render payment options for an offer. | | [VlocityDCOffersList](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/wc/VlocityDCOffersList.html) | Retrieve the offers for the specified catalog-code using the getOffers() API. DCOffersList is a base class which is extended by all web components. | | [VlocityDCPromotionList](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/wc/VlocityDCPromotionList.html) | Render all available promotions. | | [VlocityDCReviewOrder](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/wc/VlocityDCReviewOrder.html) | Render all the order details so that the user can review them before submitting the order. | | [VlocityDCShoppingCart](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/wc/VlocityDCShoppingCart.html) | Render the offers that are being added to the cart. The cart may be updated before checkout. | | [VlocityDCShoppingNestedOffer](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/wc/VlocityDCShoppingNestedOffer.html) | Render child bundles of the offer that is being added to the cart. | | [VlocityDCShoppingOfferDetails](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/wc/VlocityDCShoppingOfferDetails.html) | Render details of the offers that are being added to cart. | | [VlocityDCSignin](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/wc/VlocityDCSignin.html) | Supports sign up and sign in. | | [VlocityDCToast](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/wc/VlocityDCToast.html) | Render toast messages. | | [VlocityDCTotalbar](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/wc/VlocityDCTotalbar.html) | Render total cart prices. | | [VlocityDCUpdateBillingAddress](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/wc/VlocityDCUpdateBillingAddress.html) | Supports updates to the billing and shipping addresses. | # Discard Supplemental Order For CME Winter '20 and later releases, the discardOrder API is invoked on a supplemental order if the supplemental order is not submitted and the user wants to discard a supplemental order and proceed with the original order’s fulfillment. ## Apex Method Use this method with the supplemental order's ID as input (supplementalOrdId) to discard a supplemental order request. ```nolang public static void unfreezeOrder(Id supplementalOrdId) { final String methodName = 'discardOrder'; Map inputMap = new Map { 'cartId' => supplementalOrdId, 'methodName' => methodName }; Map outputMap = new Map(); Map optionsMap = new Map(); vlocity_cmt.CpqAppHandler handler = new vlocity_cmt.CpqAppHandler(); handler.invokeMethod(methodName, inputMap, outputMap, optionsMap); // traverse the result that was returned, to find the supplemental order id. vlocity_cmt.JSONResult result = (vlocity_cmt.JSONResult) outputMap.get('result'); } ``` **See Also** - [Create Supplemental Order](https://developer.salesforce.com/docs/industries/cme/guide/comms-create-supplemental-order.md) - [Unfreeze Order](https://developer.salesforce.com/docs/industries/cme/guide/comms-unfreeze-order.md) # Documentation Changelog This changelog lists documentation changes made in this developer guide. ## September 9, 2026 These documentation changes are new for September 9, 2026. - Updated [Migration Considerations](https://developer.salesforce.com/docs/industries/cme/guide/comms-migration-consideration-cart.md) to document Product Configuration Procedure (PCP) execution order in Classic Cart APIs versus Standard Cart APIs. - Updated [Known Limitations for Standard Cart APIs](https://developer.salesforce.com/docs/industries/cme/guide/standard-cart-known-limitations.md) and [Use CpqCartDocument](https://developer.salesforce.com/docs/industries/cme/guide/use-cart-document-cpq.md) with PCP execution-order links. ## September 3, 2026 These documentation changes are new for September 3, 2026. - Updated [Clone Line Items in Cart](https://developer.salesforce.com/docs/industries/cme/guide/comms-clone-line-items-in-cart.md) to document `noResponseNeeded` support from the Winter'27 release. - Updated [Known Limitations for Standard Cart APIs](https://developer.salesforce.com/docs/industries/cme/guide/standard-cart-known-limitations.md) and [Check Feature Compatibility](https://developer.salesforce.com/docs/industries/cme/guide/review-the-considerations.md) to include Classic `cloneItems` `noResponseNeeded` support. - Updated [Use CpqCartDocument](https://developer.salesforce.com/docs/industries/cme/guide/use-cart-document-cpq.md) to direct customers to `setItemAttributes` when setting attribute values from custom code. - Updated [Update Items in Cart](https://developer.salesforce.com/docs/industries/cme/guide/comms-update-items-in-cart.md) to extend `DisableAttributeDataTypeValidation` opt-out support through Winter'27 and note removal in Spring'27. - Updated [Check Feature Compatibility](https://developer.salesforce.com/docs/industries/cme/guide/review-the-considerations.md) and [Known Limitations for Standard Cart APIs](https://developer.salesforce.com/docs/industries/cme/guide/standard-cart-known-limitations.md) to mark Bulk Change and Bulk Update as not compatible with Standard Cart APIs. - Updated [Add Items to Cart](https://developer.salesforce.com/docs/industries/cme/guide/standard_cart/std_comms-add-items-to-cart.md) to document that `UnitPrice` and `ListPrice` in `fieldsToUpdate` persist only when `price` is `false`. - Documented Classic versus Standard add-to-cart behavior for duplicate pricebook entry IDs on [Add Items to Cart](https://developer.salesforce.com/docs/industries/cme/guide/comms-add-items-to-cart.md) and [Add Items to Cart (Standard)](https://developer.salesforce.com/docs/industries/cme/guide/standard_cart/std_comms-add-items-to-cart.md). - Expanded product-attachment limitations on [Check Feature Compatibility](https://developer.salesforce.com/docs/industries/cme/guide/review-the-considerations.md), [Migrate to Standard Cart APIs](https://developer.salesforce.com/docs/industries/cme/guide/comms-migrate-to-std-cart.md), and [Known Limitations](https://developer.salesforce.com/docs/industries/cme/guide/standard-cart-known-limitations.md). - Documented ISO versus locale date parsing for Standard Cart APIs on [Create Cart (assetToOrder)](https://developer.salesforce.com/docs/industries/cme/guide/standard_cart/std_comms-create-cart__assettoorder-.md) and Add Items to Cart. ## September 1, 2026 These documentation changes are new for September 1, 2026. - Expanded [Cart APIs vs Standard Cart APIs](https://developer.salesforce.com/docs/industries/cme/guide/comms-cart-based-apis-for-industries-cpq.md#cart-apis-vs-standard-cart-apis) with engine, governor-limit, customization, and response differences. - Added [Known Limitations for Standard Cart APIs](https://developer.salesforce.com/docs/industries/cme/guide/standard-cart-known-limitations.md). - Updated [Check Feature Compatibility](https://developer.salesforce.com/docs/industries/cme/guide/review-the-considerations.md): multi-play offers are compatible with limitations; Field Settings, `noResponseNeeded`, and `maintainAssetPrice` support is documented for Standard Cart APIs. - Corrected the Get Cart Items resource URL on [Standard Cart APIs](https://developer.salesforce.com/docs/industries/cme/guide/std-cart-get-started.md). - Updated [Get Started](https://developer.salesforce.com/docs/industries/cme/guide/get-started.md) landing-page typos and added Cart Document and Known Limitations links. - Updated [Introduction](https://developer.salesforce.com/docs/industries/cme/guide/introduction.md) with the Classic Apex versus Standard core architecture. ## May 15, 2026 These documentation changes are new for May 16, 2026. Included information about: - Template APIs (Save, Get, Apply, Search, and Delete) (https://developer.salesforce.com/docs/industries/cme/guide/stdcart-api-examples.html) - Availability and Eligibility Interface (https://developer.salesforce.com/docs/industries/cme/guide/std_comms-get-list-of-products.html) ## February 27, 2026 These documentation changes are new for February 27, 2026. - Updated [Use CpqCartDocument](https://developer.salesforce.com/docs/industries/cme/guide/use-cart-document-cpq.html) topic. - Updated [Check Feature Compatibility](https://developer.salesforce.com/docs/industries/cme/guide/review-the-considerations-dc.html) - Updated [Changes to API Responses](https://developer.salesforce.com/docs/industries/cme/guide/comms-changes-to-api-responses.html) ## December 11, 2025 These documentation changes are new for December 11, 2025. - Updated [Use CpqCartDocument](https://developer.salesforce.com/docs/industries/cme/guide/use-cart-document-cpq.html) topic. - Updated [Create Cart (assetToOrder)](https://developer.salesforce.com/docs/industries/cme/guide/std_comms-create-cart__assettoorder-.html) topic. - Updated [DCG External Client App Setup](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-dcg-connected-app-setup.html) topic. ## September 11, 2025 These documentation changes are new for September 11, 2025. - Updated [Standard Configure, Price, Quote Web APIs v2 Documentation](https://developer.salesforce.com/docs/industries/cme/references/rn_comms?meta=Summary) topic. - Included [Access Custom Fields Using Cart Document](https://developer.salesforce.com/docs/industries/cme/guide/use-field-mappers-cart-document.html) topic. - Migration Considerations [FAQ](https://developer.salesforce.com/docs/industries/cme/guide/comms-migration-consideration-cart.html) topic. ## February 27, 2025 These documentation changes are new for February 27, 2025. - Updated [Migrate to Standard Cart APIs](https://developer.salesforce.com/docs/industries/cme/guide/comms-migrate-to-std-cart.md) topic. - Included [Optimized Configurations and Settings for Maximum Performance](https://developer.salesforce.com/docs/industries/cme/guide/comms-performances.md) topic. - Included [FAQ](https://developer.salesforce.com/docs/industries/cme/guide/FAQ.md) topic. ## October 7, 2024 These documentation changes are new for June 14, 2024. - Included [Communications, Media, and Energy Application Constraints](https://developer.salesforce.com/docs/industries/cme/guide/comms-application-constraints.md) topic. - Included information about incremental caching feature. See [Execute the Administration Tasks](https://developer.salesforce.com/docs/industries/cme/guide/execute-administration-tasks.md). ## June 14, 2024 These documentation changes are new for June 14, 2024. - Included [Relies On Relationship Capability](https://developer.salesforce.com/docs/industries/cme/guide/relies_on_capability.md) topic. - Included information about Diagnostic Tool for Standard Cart APIs. See [Troubleshooting](https://developer.salesforce.com/docs/industries/cme/guide/troubleshooting-cart.md). - Removed information related to Pricing Plans. ## May 16, 2024 These documentation changes are new for May 16, 2024. - Included [Cache Management sObjects](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-sobjects-cache-management.md) topic. The cache management mechanism listens to the sObjects listed in the topic. - Added information about Multi-Edit Multi-Edit Cart Line Items [Standard Cart APIs](https://developer.salesforce.com/docs/industries/cme/guide/std-cart-get-started.md). - Updated reference tab to include information about the endpoints for CPQ and standard cart APIs. ## April 22, 2024 These documentation changes are new for April 22, 2024. - Updated [Introduction](https://developer.salesforce.com/docs/industries/cme/guide/introduction.md) topic. Included information about CPQ Data Layer Workflow. - Updated [Troubleshooting](https://developer.salesforce.com/docs/industries/cme/guide/troubleshooting-cart.md) topic. Included information about the diagnostic tool. - Updated [Enable Standard Digital Commerce](https://developer.salesforce.com/docs/industries/cme/guide/comms-enable-standard-digital-commerce.md) topic. - Updated [Standard Cart APIs](https://developer.salesforce.com/docs/industries/cme/guide/std-cart-get-started.md) topic. Included resource URL, release version details for the APIs implemented. - Updated [Run Admin Jobs for Standard Digital Commerce](https://developer.salesforce.com/docs/industries/cme/guide/comms-run-admin-jobs-for-sdc.md) topic. Included information about executing Load API Metadata job. ## April 1, 2024 These documentation changes are new for April 1, 2024. - Created [Standard Cart API Usage Example](https://developer.salesforce.com/docs/industries/cme/guide/stdcart-api-examples.md) topic. Included information about the following standard cart APIs. - Checkout Items in Cart - Remove Items from Cart - Delete Applied Promotion Items - Delete Discounts - Updated [Check Feature Compatibility](https://developer.salesforce.com/docs/industries/cme/guide/review-the-considerations.md) # Download the Postman Environment and Collection Files To make configuring Postman easier, Salesforce provides a template environment file and a preconfigured collection file that you can import into Postman. 1. To download the collection file, click [here](https://volt.my.salesforce.com/sfc/p/o0000000IKm8/a/3m0000005umv/X8mm38e.7nCeHE52342fSYgZVFnI9ANWfr0Q2iJJjd8). 2. To download the environment file, click [here](https://volt.my.salesforce.com/sfc/p/o0000000IKm8/a/3m0000005umu/ylHiaMX54l5.SlvjJDhAN1qXnfKgjva5RXvIL2CJufY). 3. Rename the environment file and open it in a text editor. 4. Change the `name` value from `Salesforce Template Environment` to a more descriptive environment name. 5. In the file, set the `url` value to `https://login.salesforce.com` or `https://test.salesforce.com` depending on the org type. 6. Set the `baseUrl` to your org's hostname with `/services/apexrest/vlocity_cmt` appended. For example `https://demo.my.salesforce.com/services/apexrest/vlocity_cmt`. 7. Set the `username` and `password` values to your username and password. So far, the file looks something like this: ```nolang { "id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "name": "Cache API Test Environment", "values": [ { "key": "url", "value": "https://login.salesforce.com", "enabled": true }, { "key": "baseUrl", "value": "https://demo.my.salesforce.com/services/apexrest/vlocity_cmt", "enabled": true }, { "key": "version", "value": "48.0", "enabled": true }, { "key": "username", "value": "me@example.com", "enabled": true }, { "key": "password", "value": "p@s$w0rd", "enabled": true }, ... ``` 8. Save the file, but keep it open so you can add more values to it in the next task. [Set Up a Connected App for Postman](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-set-up-a-connected-app-for-postman.md) # Eligibility and Advanced Rules with Digital Commerce Digital Commerce supports eligibility rules and advanced rules. # Enable Apex Classes and Sharing Rules for Guest User Profile Enable the apex classes and sharing rules for a guest user profile to access the Standard Digital Commerce APIs. **Before You Begin** - You are assigned with Admin role. - The guest user profile is available in the org. Enable the apex classes and sharing rules. 1. From Setup, in the Quick Find box, enter `All Sites`, and then select **All Sites**. 2. To enable Apex Classes for the guest user, click **Builder** next to that guest user. 3. Click **settings** and in General settings, click the guest user profile link. 4. On the guest user profile page, click **Enable Apex Classes**, and then click **Edit**. 5. Move all the apex classes in the enable apex classes column to the disabled apex classes column. Select **APIGetOffersV3** and **APIBasketOperationsV3** apex classes and click the right arrow to enable the classes for the guest user. 6. Click **Save** and exit the guest user profile. 7. To enable sharing rules, from Setup, in the Quick Find box, enter `Sharing Settings`, and then select **Sharing Settings**. 8. In the Product Sharing Rules section, click **New**. Enter Product Sharing Rules and save the changes. For Criteria: Select **Created By ID** and **not equal to** from the Field and Operator drop down respectively. Enter `null` in the Value field. For Share With: Select the guest user. Repeat this step for the standard Objects: - CachedAPIResponse - Catalog - ConfigurationSnapshot - PriceList # Enable CPQ Configuration Settings You need to enable the following CPQ configuration setting (GUID setting): - UseAssetReferenceIdForParentAndRoot For more information on impact of enabling GUIDs settings, see [GUIDs Performance in Industries CPQ](https://help.salesforce.com/s/articleView?id=ind.comms_guids_performance_in_vlocity_cpq.htm&type=5). # Enable JSONAttribute V2 Schema You need to enable JSONAttribute V2 Schema. For more information, see [JSONAttribute v2 Schema Upgrade Considerations](https://help.salesforce.com/s/articleView?id=ind.comms_jsonattribute_v2_schema_upgrade_considerations.htm&language=en_US&type=5). # Enable Standard Digital Commerce After upgrading to Winter '23 or later, you can enable Standard Digital Commerce. When you enable Standard Digital Commerce, the DC API response is curated from the Cache Product Catalog Definitions. **note:** When you enable Standard Digital Commerce APIs, any pre-existing cache definitions are automatically cleared. You also cannot run the following jobs under Cacheable API Jobs: - Populate API cache. - Create psuedo orders pool for basket APIs. - Regenerate cached API records. 1. From the App Launcher, find and select **Vlocity CMT Administration** 2. Under the Custom Settings section, click **Enable Features**. 3. Enable Standard Digital Commerce APIs and click **Enable**. When you enable Standard Digital Commerce APIs, Salesforce installs the standard pricing plan and clears any pre-existing cache definitions. Salesforce then displays a message confirming that Standard Digital Commerce was enabled. 4. Under the Admin Console section of Vlocity CMT Administration, verify that you can see **Cache Catalog Product Definitions**.![Cache Catalog Product Definitions](https://developer.salesforce.com/docs/media/sdc_cache_catalog_product_def.png) :::note To clear old FFX records to manage storage limits, perform the following steps. 1. From the App Launcher, find and select **Vlocity CMT Administration**. 2. Under Admin Console, click **Cacheable API Jobs**. 3. Click **Delete FFX Records**. # Enable the Cache Management Trigger Enabling the CacheAPI.CacheManagement trigger is a prerequisite for using the Regenerate Cache APIs. 1. From Setup, in the **Quick Find** box enter `Custom Settings`. 2. Click **Custom Settings**. The Custom Settings page appears. 3. Click **T** in the index across the top of the page and navigate to Trigger Setup. 4. Next to Trigger Setup, click **Manage**. The Custom Setting page for the Trigger Setup appears. 5. If the trigger doesn't exist, click **New**. If it does exist, click **Edit** beside the name. The Trigger Setup Edit page appears. 6. If you clicked **New** in the previous step, in the **Name** field, enter `CacheAPI.CacheManagement`. 7. Make sure **Trigger On** is selected. 8. Click **Save**. # Enable the Standard Cart APIs Perform the following steps to enable the standard cart APIs in your org. 1. From the App Launcher, find and select **Vlocity CMT Administration**. 2. Click **Enable Features**. 3. Enable **Standard Salesforce libraries and cache with the CPQ Cart-Based APIs** as shown in the following figure. ![Enable API](https://developer.salesforce.com/docs/media/enable_std_api.png "Enable APIs") # Enterprise Product Catalog (EPC) REST APIs The EPC REST APIs enable client application users to manage products, picklists, and promotions. The EPC REST APIs provide a layer of abstraction between client application development and the configuration of these EPC objects. This abstraction layer enables you to easily integrate your applications with EPC. Who: Developers that use the REST APIs to create applications that integrate with EPC. Why: You can use the REST APIs to integrate or build applications that interface with EPC. This allows your users to continue using internal applications while also having access to data from EPC. What: Using the REST APIs, you can create, read, update, and delete the following objects: - Product2 - Product Version - Product Child - Picklist - Picklist Version - PicklistItem - Promotion - PromotionItem Enterprise Product Catalog (EPC) REST APIs # Enterprise Product Catalog (EPC) REST APIs This document contains request and response description for Enterprise Product Catalog Admin API. **Version:** 2 Contact: apiteam@salesforce.com License: V2.0 Terms of service: http://www.salesforce.com ## Servers * `https://xx##.salesforce.com/services/apexrest/vlocity_cmt/v2/epc` ## Operations ### PUT Update an existing product `PUT /products` Operation ID: `Update Product`. Tags: Products. #### Parameters * `fields` (query, array of string, style: form, explode: false) Fields to return in response * `includeInResponse` (query, array of string, style: form, explode: false) Additional information to return in response #### Request body (required) #### Update Product Request Example ```json { "epcRequest": { "entity": { "Id":"01t3h000001dbgvAAA", "vlocity_cmt__VersionStartDateTime__c":"2020-09-01 00:00:00", "vlocity_cmt__VersionLabel__c": "V1.0" } } } ``` In the above example few fields is populated, but any number of field of Product2 can be populated as and when it needed. Media type: `application/json`. Schema: `EPCRequestSingleUpdate`. #### Responses * **200** Success Media type: `application/json`. Schema: `EPCResponse`. * **400** Invalid ID supplied * **405** Validation exception ### POST Create a product `POST /products` Operation ID: `Create a product`. Tags: Products. Creates a products based on request body. #### Parameters * `fields` (query, array of string, style: form, explode: false) Fields to return in response * `includeInResponse` (query, array of string, style: form, explode: false) Additional information to return in response #### Request body (required) #### Create Product Request Example ```json { "epcRequest": { "entity": { "Name": "Product - 0001", "ProductCode": "Product - 0001", "IsActive": true, "Description": "The product discription", "vlocity_cmt__SpecificationType__c": "Offer", "vlocity_cmt__SpecificationSubType__c": "Simple" "vlocity_cmt__VersionLabel__c": "V1.0" } } } ``` In the above example few fields is populated, but any number of field of Product2 can be populated as and when it needed. Media type: `application/json`. Schema: `EPCRequestSingleCreate`. #### Responses * **200** Success Media type: `application/json`. Schema: `EPCResponse`. * **405** Invalid input ### GET Finds Product by product Id `GET /products/{productId}` Operation ID: `Find Product By ID`. Tags: Products. Finds Product by product Id #### Parameters * `productId` (path, string, required) Product id * `ids` (query, array of string, style: form, explode: false) Comma separated multiple ids * `fields` (query, array of string, style: form, explode: false) Fields to return in response * `includeInResponse` (query, array of string, style: form, explode: false) Additional information to return in response #### Responses * **200** successful operation Media type: `application/json`. Schema: `array of EPCResponse`. Array of `EPCResponse`. * **400** Invalid status value ### DELETE Deletes Products by product Id `DELETE /products/{productId}` Operation ID: `Delete Product By ID`. Tags: Products. Deletes Products by product Id #### Parameters * `productId` (path, string, required) Product id * `ids` (query, array of string, style: form, explode: false) Comma separated multiple ids #### Responses * **200** successful operation Media type: `application/json`. Schema: `array of EPCResponse`. Array of `EPCResponse`. * **400** Invalid status value ### GET Get version product `GET /products/{productId}/versions` Operation ID: `Get Version Product`. Tags: Products. Get version product #### Parameters * `productId` (path, string, required) Product Id * `fields` (query, array of string, style: form, explode: false) Fields to return in response * `includeInResponse` (query, array of string, style: form, explode: false) Additional information to return in response #### Responses * **200** successful operation Media type: `application/json`. Schema: `array of EPCResponse`. Array of `EPCResponse`. * **400** Invalid status value ### POST Create version product `POST /products/{productId}/versions` Operation ID: `Create version product`. Tags: Products. Create version product #### Parameters * `productId` (path, array of string, required) Product Id #### Request body (required) #### Create version product Request Example ```json { "epcRequest": { "entity": { "Id": "product id", "vlocity_cmt__VersionLabel__c": "V2.0", "vlocity_cmt__VersionStartDateTime__c":"2020-09-01 00:00:00", "vlocity_cmt__VersionEndDateTime__c" : "2021-09-01 00:00:00" } } } ``` Create version product takes only three field where VersionLabel\_\_c is mandatory. Media type: `application/json`. Schema: `EPCRequestSingleUpdate`. #### Responses * **200** successful operation Media type: `application/json`. Schema: `array of EPCResponse`. Array of `EPCResponse`. * **400** Invalid status value ### PUT Update an existing picklist `PUT /picklists` Operation ID: `Update picklist`. Tags: Picklists. #### Parameters * `fields` (query, array of string, style: form, explode: false) Fields to return in response * `includeInResponse` (query, array of string, style: form, explode: false) Additional information to return in response #### Request body (required) #### Update Picklist Request Example ```json { "epcRequest": { "entity": { "Id": "picklist id" "Name": "NewPicklist-01", "vlocity_cmt__Code__c": "NewPicklist-01", "vlocity_cmt__IsActive__c": true } } } ``` In the above example few fields is populated, but any number of field of Picklist\_\_c can be populated as and when it needed. Media type: `application/json`. Schema: `EPCRequestMultiUpdate | EPCRequestSingleUpdate`. One of: `EPCRequestMultiUpdate`, `EPCRequestSingleUpdate`. #### Responses * **200** Success Media type: `application/json`. Schema: `EPCResponse`. * **400** Invalid ID supplied * **405** Validation exception ### POST Create a picklist `POST /picklists` Operation ID: `Create a picklist`. Tags: Picklists. Creates a picklist based on request body. #### Parameters * `fields` (query, array of string, style: form, explode: false) Fields to return in response * `includeInResponse` (query, array of string, style: form, explode: false) Additional information to return in response #### Request body (required) #### Create Picklist Request Example ```json { "epcRequest": { "entity": { "Name": "Demo-Picklist-05", "vlocity_cmt__Code__c": "Demo-Picklist-05", "vlocity_cmt__VersionLabel__c": "Version-1", "vlocity_cmt__DataType__c": "Text", "vlocity_cmt__LifecycleStatus__c": "Draft", "vlocity_cmt__IsActive__c": true } } } ``` In the above example few fields is populated, but any number of field of Picklist\_\_c can be populated as and when it needed. Media type: `application/json`. Schema: `EPCRequestSingleCreate | EPCRequestMultiCreate`. One of: `EPCRequestSingleCreate`, `EPCRequestMultiCreate`. #### Responses * **200** Success Media type: `application/json`. Schema: `EPCResponse`. * **405** Invalid input ### GET Finds picklist by picklist Id `GET /picklists/{picklistId}` Operation ID: `Find picklist`. Tags: Picklists. Finds picklist by picklist Id #### Parameters * `picklistId` (path, string, required) Picklist id * `ids` (query, array of string, style: form, explode: false) Comma separated multiple ids * `fields` (query, array of string, style: form, explode: false) Fields to return in response * `includeInResponse` (query, array of string, style: form, explode: false) Additional information to return in response #### Responses * **200** successful operation Media type: `application/json`. Schema: `array of EPCResponse`. Array of `EPCResponse`. * **400** Invalid status value ### DELETE Deletes Picklist by picklsit Id `DELETE /picklists/{picklistId}` Operation ID: `Deletes Picklist`. Tags: Picklists. Deletes Picklist by picklsit Id #### Parameters * `picklistId` (path, string, required) Picklist Id * `ids` (query, array of string, style: form, explode: false) Comma separated multiple ids #### Responses * **200** successful operation Media type: `application/json`. Schema: `array of EPCResponse`. Array of `EPCResponse`. * **400** Invalid status value ### GET Get version picklist `GET /picklists/{picklistId}/versions` Operation ID: `Get version picklist`. Tags: Picklists. Get version picklist #### Parameters * `picklistId` (path, string, required) Picklist id * `fields` (query, array of string, style: form, explode: false) Fields to return in response * `includeInResponse` (query, array of string, style: form, explode: false) Additional information to return in response #### Responses * **200** successful operation Media type: `application/json`. Schema: `array of EPCResponse`. Array of `EPCResponse`. * **400** Invalid status value ### POST Create version picklist `POST /picklists/{picklistId}/versions` Operation ID: `Create version picklist`. Tags: Picklists. Create version picklist #### Parameters * `picklistId` (path, string, required) Picklist Id #### Request body (required) #### Create version picklist Request Example ```json { "epcRequest": { "entity": { "Id": "picklist id", "vlocity_cmt__VersionLabel__c": "V2.0", "vlocity_cmt__VersionStartDateTime__c":"2020-09-01 00:00:00", "vlocity_cmt__VersionEndDateTime__c" : "2021-09-01 00:00:00" } } } ``` Media type: `application/json`. Schema: `EPCRequestSingleUpdate`. #### Responses * **200** successful operation Media type: `application/json`. Schema: `array of EPCResponse`. Array of `EPCResponse`. * **400** Invalid status value ### PUT Update an existing picklist item `PUT /picklists/{picklistId}/items` Operation ID: `Update picklist item`. Tags: Picklist Items. Update an existing picklist item #### Parameters * `picklistId` (path, string, required) Picklist Id * `fields` (query, array of string, style: form, explode: false) Fields to return in response * `includeInResponse` (query, array of string, style: form, explode: false) Additional information to return in response #### Request body (required) #### Update picklist item Request Example ```json { "epcRequest": { "entity": { "Id": "Picklist item Id", "vlocity_cmt__TextValue__c": "Bangalore", "vlocity_cmt__Sequence__c": 1, "vlocity_cmt__IsActive__c": true } } } ``` In the above example few fields is populated, but any number of field of PicklistValue\_\_c can be populated as and when it needed. Media type: `application/json`. Schema: `EPCRequestSingleUpdate | EPCRequestMultiUpdate`. One of: `EPCRequestSingleUpdate`, `EPCRequestMultiUpdate`. #### Responses * **200** Success Media type: `application/json`. Schema: `EPCResponse`. * **400** Invalid ID supplied * **405** Validation exception ### POST Create a picklist item `POST /picklists/{picklistId}/items` Operation ID: `Create a picklist item`. Tags: Picklist Items. Creates a picklist item based on request body. #### Parameters * `picklistId` (path, string, required) Picklist id * `fields` (query, array of string, style: form, explode: false) Fields to return in response * `includeInResponse` (query, array of string, style: form, explode: false) Additional information to return in response #### Request body (required) #### Create picklist item Request Example ```json { "epcRequest": { "entity": { "Name": "Bangalore", "vlocity_cmt__TextValue__c": "Bangalore", "vlocity_cmt__Code__c": "Bangalore", "vlocity_cmt__Abbreviation__c": "Bangalore", "vlocity_cmt__Sequence__c": 1, "vlocity_cmt__IsActive__c": true, "vlocity_cmt__PicklistId__c": "a2u4T000003xGYQQA2" } } } ``` In the above example few fields is populated, but any number of field of PicklistValue\_\_c can be populated as and when it needed. Media type: `application/json`. Schema: `EPCRequestSingleCreate | EPCRequestMultiCreate`. One of: `EPCRequestSingleCreate`, `EPCRequestMultiCreate`. #### Responses * **200** Success Media type: `application/json`. Schema: `EPCResponse`. * **405** Invalid input ### GET Finds picklist item by picklist Id and picklist item id `GET /picklists/{picklistId}/items/{picklisitemId}` Operation ID: `Finds picklist item by ID`. Tags: Picklist Items. Finds picklist item by product Id and picklist item id #### Parameters * `picklistId` (path, string, required) Picklist Id * `picklisitemId` (path, string, required) Picklist item Id * `ids` (query, array of string, style: form, explode: false) Comma separated multiple ids * `fields` (query, array of string, style: form, explode: false) Fields to return in response * `includeInResponse` (query, array of string, style: form, explode: false) Additional information to return in response #### Responses * **200** successful operation Media type: `application/json`. Schema: `array of EPCResponse`. Array of `EPCResponse`. * **400** Invalid status value ### DELETE Deletes picklist item by picklist item Id `DELETE /picklists/{picklistId}/items/{picklisitemId}` Operation ID: `Delete picklist item by ID`. Tags: Picklist Items. Deletes picklist item by picklist item Id #### Parameters * `picklisitemId` (path, string, required) Picklist item Id * `picklistId` (path, string, required) Picklist Id * `ids` (query, array of string, style: form, explode: false) Comma separated multiple ids #### Responses * **200** successful operation Media type: `application/json`. Schema: `array of EPCResponse`. Array of `EPCResponse`. * **400** Invalid status value ### PUT Update an existing promotion `PUT /promotions` Operation ID: `Update promotion`. Tags: Promotions. #### Parameters * `fields` (query, array of string, style: form, explode: false) Fields to return in response * `includeInResponse` (query, array of string, style: form, explode: false) Additional information to return in response #### Request body (required) #### Update promotion Request Example ```json { "epcRequest": { "entity": { "Id": "Promotion Id", Name": "Promotion-3", "vlocity_cmt__PriceListId__c": "a343h000001ACXFAA4", "vlocity_cmt__Code__c": "Promotion-3", "vlocity_cmt__Description__c": "Promotion-3", "vlocity_cmt__IsOrderable__c": true, "vlocity_cmt__EnableAutoAddProducts__c": false, "vlocity_cmt__IsActive__c": true } } } ``` In the above example few fields is populated, but any number of field of Promotiont\_\_c can be populated as and when it needed. Media type: `application/json`. Schema: `EPCRequestMultiUpdate | EPCRequestSingleUpdate`. One of: `EPCRequestMultiUpdate`, `EPCRequestSingleUpdate`. #### Responses * **200** Success Media type: `application/json`. Schema: `EPCResponse`. * **400** Invalid ID supplied * **405** Validation exception ### POST Create a promotion `POST /promotions` Operation ID: `Create a promotion`. Tags: Promotions. Creates a promotion based on request body. #### Parameters * `fields` (query, array of string, style: form, explode: false) Fields to return in response * `includeInResponse` (query, array of string, style: form, explode: false) Additional information to return in response #### Request body (required) #### Create product Request Example ```json { "epcRequest": { "entity": { Name": "Promotion-3", "vlocity_cmt__PriceListId__c": "a343h000001ACXFAA4", "vlocity_cmt__Code__c": "Promotion-3", "vlocity_cmt__Description__c": "Promotion-3", "vlocity_cmt__IsOrderable__c": true, "vlocity_cmt__EnableAutoAddProducts__c": false, "vlocity_cmt__IsActive__c": true } } } ``` In the above example few fields is populated, but any number of field of Promotion\_\_c can be populated as and when it needed. Media type: `application/json`. Schema: `EPCRequestSingleCreate`. #### Responses * **200** Success Media type: `application/json`. Schema: `EPCResponse`. * **405** Invalid input ### GET Finds promotion by promotion Id `GET /promotions/{promotionId}` Operation ID: `Find promotion`. Tags: Promotions. Finds promotion by promotion Id #### Parameters * `promotionId` (path, string, required) promotion Id * `ids` (query, array of string, style: form, explode: false) Comma separated multiple ids * `fields` (query, array of string, style: form, explode: false) Fields to return in response * `includeInResponse` (query, array of string, style: form, explode: false) Additional information to return in response #### Responses * **200** successful operation Media type: `application/json`. Schema: `array of EPCResponse`. Array of `EPCResponse`. * **400** Invalid status value ### DELETE Deletes Promotion by promotion Id `DELETE /promotions/{promotionId}` Operation ID: `Delete Promotion`. Tags: Promotions. Deletes Promotion by promotion Ids #### Parameters * `promotionId` (path, string, required) Promotion Id * `ids` (query, array of string, style: form, explode: false) Comma separated multiple ids #### Responses * **200** successful operation Media type: `application/json`. Schema: `array of EPCResponse`. Array of `EPCResponse`. * **400** Invalid status value ### PUT Update promotion item `PUT /promotions/{promotionId}/items` Operation ID: `Update promotion item`. Tags: Promotion Items. #### Parameters * `promotionId` (path, string, required) Promotion Id * `fields` (query, array of string, style: form, explode: false) Fields to return in response * `includeInResponse` (query, array of string, style: form, explode: false) Additional information to return in response #### Request body (required) #### Update promotion item Request Example ```json { "epcRequest": { "entity": { "Id": "Promotion item Id", "vlocity_cmt__PromotionId__c": "a3K3h0000006Ae0EAE", "vlocity_cmt__Description__c": "", "vlocity_cmt__ProductId__c": "01t3h000002TMciAAG", "vlocity_cmt__IsActive__c": true, "vlocity_cmt__ActionType__c": "Add", "vlocity_cmt__MaxQuantity__c": 10, "vlocity_cmt__MinQuantity__c": 1, "vlocity_cmt__Quantity__c": 1, "vlocity_cmt__UpdateScope__c": "Update Item Only", } } } ``` In the above example few fields is populated, but any number of field of PromotiontItem\_\_c can be populated as and when it needed. Media type: `application/json`. Schema: `EPCRequestMultiUpdate | EPCRequestSingleUpdate`. One of: `EPCRequestMultiUpdate`, `EPCRequestSingleUpdate`. #### Responses * **200** Success Media type: `application/json`. Schema: `EPCResponse`. * **400** Invalid ID supplied * **405** Validation exception ### POST Create a promotion item `POST /promotions/{promotionId}/items` Operation ID: `Create a promotion item`. Tags: Promotion Items. Creates a promotion item based on request body. #### Parameters * `promotionId` (path, string, required) Promotion Id * `fields` (query, array of string, style: form, explode: false) Fields to return in response * `includeInResponse` (query, array of string, style: form, explode: false) Additional information to return in response #### Request body (required) #### Create promotion item Request Example ```json { "epcRequest": { "entity": { "vlocity_cmt__PromotionId__c": "a3K3h0000006Ae0EAE", "vlocity_cmt__Description__c": "", "vlocity_cmt__ProductId__c": "01t3h000002TMciAAG", "vlocity_cmt__IsActive__c": true, "vlocity_cmt__ActionType__c": "Add", "vlocity_cmt__MaxQuantity__c": 10, "vlocity_cmt__MinQuantity__c": 1, "vlocity_cmt__Quantity__c": 1, "vlocity_cmt__UpdateScope__c": "Update Item Only", "vlocity_cmt__ContextProductId__c": "" } } } ``` In the above example few fields is populated, but any number of field of PromotionItem\_\_c can be populated as and when it needed. Media type: `application/json`. Schema: `EPCRequestSingleCreate | EPCRequestMultiCreate`. One of: `EPCRequestSingleCreate`, `EPCRequestMultiCreate`. #### Responses * **200** Success Media type: `application/json`. Schema: `EPCResponse`. * **405** Invalid input ### GET Finds promotion item by promotion Id and promotion item id `GET /promotions/{promotionId}/items/{promotionitemId}` Operation ID: `Find promotion item by ID`. Tags: Promotion Items. Finds promotion item by promotion Id and promotion item id #### Parameters * `promotionId` (path, string, required) Promotion Id * `promotionitemId` (path, string, required) Promotion item Id * `ids` (query, array of string, style: form, explode: false) Comma separated multiple ids * `fields` (query, array of string, style: form, explode: false) Fields to return in response * `includeInResponse` (query, array of string, style: form, explode: false) Additional information to return in response #### Responses * **200** successful operation Media type: `application/json`. Schema: `array of EPCResponse`. Array of `EPCResponse`. * **400** Invalid status value ### DELETE Deletes promotion item by promotion item Id `DELETE /promotions/{promotionId}/items/{promotionitemId}` Operation ID: `Delete promotion item by ID`. Tags: Promotion Items. Deletes promotion item by promotion item Id #### Parameters * `promotionitemId` (path, string, required) Promotion item Id * `promotionId` (path, string, required) Promotion Id * `ids` (query, array of string, style: form, explode: false) Comma separated multiple ids #### Responses * **200** successful operation Media type: `application/json`. Schema: `array of EPCResponse`. Array of `EPCResponse`. * **400** Invalid status value ### PUT Update an existing product child item `PUT /productchilditems` Operation ID: `Update product child item`. Tags: Product Child Items. #### Parameters * `fields` (query, array of string, style: form, explode: false) Fields to return in response * `includeInResponse` (query, array of string, style: form, explode: false) Additional information to return in response #### Request body (required) #### Update product child item Request Example ```json { "epcRequest": { "entity": { "vlocity_cmt__ParentProductId__c": "01t3h000002TDJQAA4", "vlocity_cmt__ChildProductId__c": "01t3h000002Stj3AAC", "vlocity_cmt__RelationshipType__c": "Child", "vlocity_cmt__ChildLineNumber__c": "1" } } } ``` In the above example few fields is populated, but any number of field of ProductChildItem\_\_c can be populated as and when it needed. Media type: `application/json`. Schema: `EPCRequestSingleUpdate | EPCRequestMultiUpdate`. One of: `EPCRequestSingleUpdate`, `EPCRequestMultiUpdate`. #### Responses * **200** Success Media type: `application/json`. Schema: `EPCResponse`. * **400** Invalid ID supplied * **405** Validation exception ### POST Create a product child item `POST /productchilditems` Operation ID: `Create a product child item`. Tags: Product Child Items. Creates a product child item based on request body. #### Parameters * `fields` (query, array of string, style: form, explode: false) Fields to return in response * `includeInResponse` (query, array of string, style: form, explode: false) Additional information to return in response #### Request body (required) #### Create product child item Request Example ```json { "epcRequest": { "entity": { "vlocity_cmt__ParentProductId__c": "01t3h000002TDJQAA4", "vlocity_cmt__ChildProductId__c": "01t3h000002Stj3AAC", "vlocity_cmt__RelationshipType__c": "Child", "vlocity_cmt__ChildLineNumber__c": "1" } } } ``` In the above example few fields is populated, but any number of field of ProductChildItem\_\_c can be populated as and when it needed. Media type: `application/json`. Schema: `EPCRequestSingleCreate | EPCRequestMultiCreate`. One of: `EPCRequestSingleCreate`, `EPCRequestMultiCreate`. #### Responses * **200** Success Media type: `application/json`. Schema: `EPCResponse`. * **405** Invalid input ### GET Finds product child item by id `GET /productchilditems/{productChildItemId}` Operation ID: `Find product child item by ID`. Tags: Product Child Items. Finds product child item by id #### Parameters * `productChildItemId` (path, string, required) Product Child Item Id * `ids` (query, array of string, style: form, explode: false) Comma separated multiple ids * `fields` (query, array of string, style: form, explode: false) Fields to return in response * `includeInResponse` (query, array of string, style: form, explode: false) Additional information to return in response #### Responses * **200** successful operation Media type: `application/json`. Schema: `array of EPCResponse`. Array of `EPCResponse`. * **400** Invalid status value ### DELETE Deletes product child item by Id `DELETE /productchilditems/{productChildItemId}` Operation ID: `Delete product child item by ID`. Tags: Product Child Items. Deletes product child item by Id #### Parameters * `productChildItemId` (path, string, required) Product Child Item Id * `ids` (query, array of string, style: form, explode: false) Comma separated multiple ids #### Responses * **200** successful operation Media type: `application/json`. Schema: `array of EPCResponse`. Array of `EPCResponse`. * **400** Invalid status value ## Schemas ### EPCRequestSingleUpdate * `epcRequest` (_object_) * `entity` (_entity_) ### EPCResponse * `epcResponse` (_object_) * `entities` (_array of responseEntity_) * `pageInfo` (_pageInfo_) * `overallResult` (_string_) Overall result Allowed values: `success`, `failure`, `timeout`, `parsingError`, `validationError`, `missingMandatoryData`. * `warningMessage` (_array of string_) ### EPCRequestSingleCreate * `epcRequest` (_object_) * `entity` (_createEntity_) ### EPCRequestMultiUpdate * `epcRequest` (_object_) * `entities` (_array of requestEntitiesUpdate_) ### EPCRequestMultiCreate * `epcRequest` (_object_) * `entities` (_array of requestEntities_) ### entity * `id` (_string_) * `name` (_string_) ### responseEntity * `entity` (_entity_) * `hierarchy` (_hierarchy_) * `supplimentryEntity` (_array of entity_) ### pageInfo * `currentPage` (_integer_) * `totalPages` (_integer_) * `pageSize` (_integer_) * `totalCount` (_integer_) ### createEntity * `name` (_string_) ### requestEntitiesUpdate * `entity` (_entity_) ### requestEntities * `entity` (_createEntity_) ### hierarchy * `chidren` (_array of hierarchy_) * `PCI` (_entity_) * `entity` (_entity_) # EPC API Response Format The EPC REST API uses the DomainResponse class to represent the output for REST calls. The API responses permit a structured interaction between the requesting entities and back-end operations and are composed of objects wrapped in a result epcResponse object. The wrapper object is represented by the following properties or elements: - overallResult: Specifies the overall result of the API call. - failureReason: If the API call fails, this element describes the reason for the failure. - warningMessage: If the API call is successful but encounters errors, this field lists the errors. - entities: Lists the objects specified in the API call - supplimentaryEntity: Lists any additional objects or information related to the objects specified in the API call. - hierarchy: If applicable, displays the children of objects specified by the API call. - children: If the hierarchy is displayed, lists the children of the objects specified by the API call. - pageInfo: Specifies various properties related to pagination such as: - currentPage: Specifies the current page. - pageSize: Specifies the number of items on the page. - totalCount: Specifies the total number of records. - totalPages: Specifies the total pages. The total number of pages is the totalCount divided by pageSize. - numberOfProduct: Lists the number of products returned. # EPC API Swagger Reference The APIs for Industries EPC have Swagger (OpenAPI) reference documentation. [Admin Configure for Product, Picklist and Promotion Web APIs v2 Documentation](https://developer.salesforce.com/docs/industries/cme/references/epc?meta=Summary) # Execute the Administration Tasks Before using the optimized cart-based APIs, run these administrations tasks in your org. Navigate to Vlocity CMT Administration and run these jobs. 1. From the App Launcher, find and select **Vlocity CMT Administration**. 2. Maintenance job: [Field Maps Maintenance](https://help.salesforce.com/s/articleView?id=ind.comms_field_maps_maintenance.htm&language=en_US&type=5). This job populates the mappings and pricing plan meta data. 3. EPC job: Generate EPC Compile data. This job initializes the cache data. Starting in Winter '24, for Standard Cart APIs, you can select price lists and compile data for products specific to those price lists. - On the EPC Jobs page, click **Start** next to GENERATE COMPILE DATA. From the Price List dropdown list, select the price lists, and then click **Apply**. **NOTE:** From Winter'25 you can enable incremental caching. See [Enable incremental caching](#enable-incremental-caching).
You need to execute the following step only after completing the above step 3 at least once. To enable incremental caching, perform these steps. 1. From Setup, enter `Custom Settings` in the Quick Find box, select **Custom Settings**, then select **Trigger Setup**. 2. Click **Manage**. Click **New**. 3. Select `StandardIncrementalCache`. Ensure that **Trigger On** checkbox is selected. ## Enable Incremental Caching To leverage incremental caching, you need to activate a new trigger named `StandardIncrementalCache`. This trigger has following functionality. - Change Data Capture: Enables the capture of changes made to EPC data, providing the foundation for identifying updates during incremental refreshes. - Job Execution Control: Controls the ability to run the incremental caching jobs themselves. **important:** Upgrading to Winter'25 does not automatically enable change data capture or job execution. You need to enable the `StandardIncrementalCache` trigger following the steps mentioned above. You can initiate data change capture and subsequently run the incremental caching jobs. This provides granular control over when change data is captured and how the jobs are utilized. # Expand Items Retrieves the next level of children of product in a bundle (in cart). The intent of this API is to improve performance when refreshing big product bundles in carts by returning child items when parent items are clicked. ```nolang GET /v2/cpq/carts/{cart_ID}/items/{item_ID}/expand ``` ## Remote Method ```nolang getExpandedItems ``` ## Handlers ```nolang REST Endpoint: APIExpandItemCartsCpqv2.cls Implementation: CpqExpandCartItemActionV2.cls ``` ## Apex remote service ```nolang CpqAppHandler ``` ## Apex remote input map ```nolang { methodName: getExpandedItems productHierarchyPath:"01t36000004hM92AAE<01t36000004hM8xAAE" itemId: 80236000009E2InAAK cartId: 80136000000OXQvAAO } ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | ------------------------------------------------------------------------------ | | Resource URL | `/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/items/{item_ID}/expand` | ## Example Request ```nolang GET /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000iwCx/items/80236000009E2InAAK/expand?productHierarchyPath=01t36000004hM92AAE<01t36000004hM8xAAE ``` ## Example Result ```nolang { "totalSize": 1, "messages": [], "records": [{ "messages": [], "actions": { "expanditems": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80136000000OXQvAAO/items/80236000009E2InAAK/expand?cartId=80136000000OXQvAAO&itemId=80236000009E2InAAK&productHierarchyPath=01t36000004hM92AAE<01t36000004hM8xAAE" }, "remote": { "params": { "methodName": "getExpandedItems", "productHierarchyPath": "01t36000004hM92AAE<01t36000004hM8xAAE", "itemId": "80236000009E2InAAK", "cartId": "80136000000OXQvAAO" } }, "client": { "params": {} } } }, "displaySequence": -1, "Id": { "label": "Price Book Entry ID", "value": "01u36000009qFdRAAU" }, "Pricebook2Id": { "label": "Price Book ID", "value": "01s36000006iLkuAAE" }, "Product2Id": { "label": "Product ID", "value": "01t36000004hM8xAAE" }, "ProductCode": { "label": "Product Code", "value": "es-aug-vhcild1" }, "UnitPrice": { "label": "List Price", "value": null }, "Name": { "label": "Product Name", "value": "es-aug-vhcild1" }, "vlocity_cmt__RecurringPrice__c": { "label": "Recurring Price", "value": null }, "IsActive": { "label": "Active", "value": true }, "Product2": { "attributes": { "type": "Product2", "url": "/services/data/v41.0/sobjects/Product2/01t36000004hM8xAAE" }, "Description": "es-aug-vhcild1", "Name": "es-aug-vhcild1", "vlocity_cmt__IsConfigurable__c": false, "vlocity_cmt__Type__c": "None", "vlocity_cmt__SubType__c": "None", "Id": "01t36000004hM8xAAE", "vlocity_cmt__JSONAttribute__c": null }, "productId": "01t36000004hM8xAAE", "defaultQuantity": 1.0, "minQuantity": 0.0, "maxQuantity": 99999.0, "groupMinQuantity": 0, "groupMaxQuantity": 99999, "sequenceNumber": 1.00, "productChildItemId": "a1x36000002sB2zAAE", "productChildItemDefinition": { "attributes": { "type": "vlocity_cmt__ProductChildItem__c", "url": "/services/data/v41.0/sobjects/vlocity_cmt__ProductChildItem__c/a1x36000002sB2zAAE" }, "vlocity_cmt__IsVirtualItem__c": true, "vlocity_cmt__ChildLineNumber__c": "1", "Name": "a1x36000002sB2z", "vlocity_cmt__SeqNumber__c": 1.00, "Id": "a1x36000002sB2zAAE", "vlocity_cmt__ChildProductId__r": { "attributes": { "type": "Product2", "url": "/services/data/v41.0/sobjects/Product2/01t36000004hM8xAAE" }, "Name": "es-aug-vhcild1", "Id": "01t36000004hM8xAAE" }, "vlocity_cmt__Quantity__c": 1, "vlocity_cmt__ParentProductId__c": "01t36000004hM92AAE", "vlocity_cmt__MinimumChildItemQuantity__c": 0, "vlocity_cmt__MaxQuantity__c": 99999, "vlocity_cmt__MaximumChildItemQuantity__c": 99999, "vlocity_cmt__IsRootProductChildItem__c": false, "vlocity_cmt__MinQuantity__c": 0, "vlocity_cmt__CollapseHierarchy__c": false, "vlocity_cmt__ParentProductId__r": { "attributes": { "type": "Product2", "url": "/services/data/v41.0/sobjects/Product2/01t36000004hM92AAE" }, "Name": "es-aug-bundle", "Id": "01t36000004hM92AAE" }, "vlocity_cmt__ChildProductId__c": "01t36000004hM8xAAE", "vlocity_cmt__IsOverride__c": false }, "productHierarchyPath": "01t36000004hM92AAE<01t36000004hM8xAAE", "isVirtualItem": true, "attributeValues": {}, "hasChildren": true, "itemType": "productGroup", "parentLineItemId": "80236000009E2InAAK", "productCategories": { "totalSize": 0, "messages": [] }, "childProducts": { "totalSize": 0, "messages": [], "records": [{ "messages": [], "actions": { "addtocart": { "rest": { "params": { "items": [{ "parentId": "80236000009E2InAAK", "parentHierarchyPath": "01t36000004hM92AAE<01t36000004hM8xAAE", "itemId": "01u36000009qFeFAAU" }], "cartId": "80136000000OXQvAAO", "price": true, "validate": true, "includeAttachment": false, "pagesize": 20, "lastRecordId": null, "query": null }, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80136000000OXQvAAO/items" }, "remote": { "params": { "methodName": "postCartsItems", "items": [{ "parentId": "80236000009E2InAAK", "parentHierarchyPath": "01t36000004hM92AAE<01t36000004hM8xAAE", "itemId": "01u36000009qFeFAAU" }], "cartId": "80136000000OXQvAAO", "price": true, "validate": true, "includeAttachment": false, "pagesize": 20, "lastRecordId": null, "query": null } }, "client": { "params": {} } }, "getproductbyid": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80136000000OXQvAAO/products?cartId=80136000000OXQvAAO&id=01u36000009qFeFAAU" }, "remote": { "params": { "methodName": "getCartsProductsById", "id": "01u36000009qFeFAAU", "cartId": "80136000000OXQvAAO" } }, "client": { "params": { "cartId": "80136000000OXQvAAO", "id": "01u36000009qFeFAAU", "methodName": "getCartsProductsById" } } } }, "displaySequence": -1, "Id": { "label": "Price Book Entry ID", "value": "01u36000009qFeFAAU" }, "Pricebook2Id": { "label": "Price Book ID", "value": "01s36000006iLkuAAE" }, "Product2Id": { "label": "Product ID", "value": "01t36000004hM97AAE" }, "ProductCode": { "label": "Product Code", "value": "es-aug-addon1" }, "UnitPrice": { "label": "List Price", "value": null }, "Name": { "label": "Product Name", "value": "es-aug-addon1" }, "vlocity_cmt__RecurringPrice__c": { "label": "Recurring Price", "value": null }, "IsActive": { "label": "Active", "value": true }, "Product2": { "attributes": { "type": "Product2", "url": "/services/data/v41.0/sobjects/Product2/01t36000004hM97AAE" }, "Description": "es-aug-addon1", "Name": "es-aug-addon1", "vlocity_cmt__IsConfigurable__c": false, "vlocity_cmt__Type__c": "None", "vlocity_cmt__SubType__c": "None", "Id": "01t36000004hM97AAE", "vlocity_cmt__JSONAttribute__c": null }, "productId": "01t36000004hM97AAE", "defaultQuantity": 0.0, "minQuantity": 0.0, "maxQuantity": 5.0, "groupMinQuantity": 0, "groupMaxQuantity": 99999, "sequenceNumber": 1.00, "productChildItemId": "a1x36000002sB39AAE", "productChildItemDefinition": { "attributes": { "type": "vlocity_cmt__ProductChildItem__c", "url": "/services/data/v41.0/sobjects/vlocity_cmt__ProductChildItem__c/a1x36000002sB39AAE" }, "vlocity_cmt__IsVirtualItem__c": false, "vlocity_cmt__ChildLineNumber__c": "1", "Name": "a1x36000002sB39", "vlocity_cmt__SeqNumber__c": 1.00, "Id": "a1x36000002sB39AAE", "vlocity_cmt__ChildProductId__r": { "attributes": { "type": "Product2", "url": "/services/data/v41.0/sobjects/Product2/01t36000004hM97AAE" }, "Name": "es-aug-addon1", "Id": "01t36000004hM97AAE" }, "vlocity_cmt__Quantity__c": 0, "vlocity_cmt__ParentProductId__c": "01t36000004hM8xAAE", "vlocity_cmt__MinimumChildItemQuantity__c": 0, "vlocity_cmt__MaxQuantity__c": 5, "vlocity_cmt__MaximumChildItemQuantity__c": 99999, "vlocity_cmt__IsRootProductChildItem__c": false, "vlocity_cmt__MinQuantity__c": 0, "vlocity_cmt__CollapseHierarchy__c": false, "vlocity_cmt__ParentProductId__r": { "attributes": { "type": "Product2", "url": "/services/data/v41.0/sobjects/Product2/01t36000004hM8xAAE" }, "Name": "es-aug-vhcild1", "Id": "01t36000004hM8xAAE" }, "vlocity_cmt__ChildProductId__c": "01t36000004hM97AAE", "vlocity_cmt__IsOverride__c": false }, "productHierarchyPath": "01t36000004hM92AAE<01t36000004hM8xAAE<01t36000004hM97AAE", "isVirtualItem": false, "attributeValues": {}, "hasChildren": false, "itemType": "childProduct", "productCategories": { "totalSize": 0, "messages": [] } }] } }] } ``` # ExternalPricingKeyValTier Represents a single volume/quantity tier (a threshold and its associated pricing value) within an ExternalPricingKeyValue pricing condition record, used by the Penny Perfect Pricing feature to support tiered/scale pricing. This object is available in API version 68.0 and later. ## Supported Calls `create()`, `delete()`, `describeLayout()`, `describeSObjects()`, `getDeleted()`, `getUpdated()`, `query()`, `retrieve()`, `undelete()`, `update()`, `upsert()` ## Special Access Rules Available only in orgs with the Manufacturing Cloud, Automotive Cloud, or Consumer Goods Cloud Penny Perfect Pricing feature enabled. ## Fields ### CurrencyIsoCode **Type:** picklist **Properties:** Create, Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** ISO code for the currency of this record. Possible values are: AED (UAE Dirham), USD (U.S. Dollar), and every other active currency ISO code configured for the org. The default value is USD. ### ExternalPricingKeyValueId **Type:** reference **Properties:** Create, Filter, Group, Sort, Update **Description:** The ID of the parent ExternalPricingKeyValue (pricing condition) record this tier belongs to. This field is a relationship field. It's the master in a master-detail relationship. **Relationship Name:** ExternalPricingKeyValue **Refers To:** ExternalPricingKeyValue ### FreeProductId **Type:** reference **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The ID of the Product2 record given for free when this tier's threshold is met (used for free-goods pricing conditions). This field is a relationship field. **Relationship Name:** FreeProduct **Refers To:** Product2 ### FreeProductUnitofMeasureId **Type:** reference **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The ID of the UnitOfMeasure record that applies to the free product quantity for this tier. This field is a relationship field. **Relationship Name:** FreeProductUnitofMeasure **Refers To:** UnitOfMeasure ### LastReferencedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** The timestamp for when the current user last accessed a record related to this tier. ### LastViewedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** The timestamp for when the current user last viewed this record. ### Name **Type:** string **Properties:** Autonumber, Defaulted on create, Filter, idLookup, Sort **Description:** An auto-generated name for the tier record. ### PricingValue **Type:** double **Properties:** Create, Filter, Sort, Update **Description:** The price, discount, or surcharge value that applies once this tier's threshold is reached. ### Status **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The synchronization/lifecycle status of the tier record relative to its source pricing data. Possible values are Deleted, New, and Updated. ### TierThresholdValue **Type:** double **Properties:** Create, Filter, Sort, Update **Description:** The quantity, value, or volume threshold that must be met or exceeded for this tier's pricing to apply. ## Associated Objects This object has the following associated objects. If the API version isn't specified, they're available in the same API versions as this object. Otherwise, they're available in the specified API version and later. - [ExternalPricingKeyValTierChangeEvent](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/associated-objects/change-event.md): Change events are available for the object. - [ExternalPricingKeyValTierFeed](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/associated-objects/feed.md): Feed tracking is available for the object. - [ExternalPricingKeyValTierHistory](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/associated-objects/history.md): History is available for tracked fields of the object. - [ExternalPricingKeyValTierOwnerSharingRule](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/associated-objects/owner-sharing-rule.md): Sharing rules are available for the object. - [ExternalPricingKeyValTierShare](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/associated-objects/share.md): Sharing is available for the object. # ExternalPricingKeyValue Represents a single resolved pricing condition record in the Penny Perfect Pricing engine, a specific, priced combination of key attribute values (a "pricing condition") produced when a Pricing Search Strategy resolves a Pricing Specification against a given context (account, product, unit of measure, date range, and so on). This object is available in API version 68.0 and later. ## Supported Calls `create()`, `delete()`, `describeLayout()`, `describeSObjects()`, `getDeleted()`, `getUpdated()`, `query()`, `retrieve()`, `undelete()`, `update()`, `upsert()` ## Special Access Rules Available only in orgs with the Manufacturing Cloud, Automotive Cloud, or Consumer Goods Cloud Penny Perfect Pricing feature enabled. ## Fields ### AccountId **Type:** reference **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The account this pricing condition record applies to, when the condition is scoped to a specific customer account. This field is a relationship field. **Relationship Name:** Account **Refers To:** Account ### BaseQuantity **Type:** double **Properties:** Create, Filter, Nillable, Sort, Update **Description:** The quantity denominator used when calculating the price for this condition (for example, price per 100 units). Corresponds to the "Denominator" concept in the pricing engine. ### CurrencyIsoCode **Type:** picklist **Properties:** Create, Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The ISO currency code for the monetary fields on this record. Possible values are: AED (UAE Dirham), USD (U.S. Dollar), and every other active currency ISO code configured for the org. The default value is USD. ### DistributionCategory **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** Indicates which entity this pricing condition is distributed or scoped to. Possible values are Account and All. ### ExternalPricingKeyTypeId **Type:** reference **Properties:** Create, Filter, Group, Sort, Update **Description:** References the Expression Set (rules-engine runtime artifact) that represents the Pricing Key Type used to define this condition's key attribute structure. This field is a relationship field. **Relationship Name:** ExternalPricingKeyType **Refers To:** ExpressionSet ### ExternalPricingSpecId **Type:** reference **Properties:** Create, Filter, Group, Sort, Update **Description:** References the Expression Set (rules-engine runtime artifact) that represents the Pricing Specification (Pricing Condition Template) this condition record was generated from. This field is a relationship field. **Relationship Name:** ExternalPricingSpec **Refers To:** ExpressionSet ### InternalOrganizationUnitId **Type:** reference **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The internal organization unit (business unit or org unit) that owns or scopes this pricing condition. This field is a relationship field. **Relationship Name:** InternalOrganizationUnit **Refers To:** InternalOrganizationUnit ### KeyValue01 – KeyValue10 **Type:** string **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** Ten generic key-value slots holding the actual attribute values (for example, product code, customer group, region) that make up this condition's unique pricing key, as defined by the associated Pricing Key Type. ### LastReferencedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** The timestamp when the current user last accessed this record or a related record. ### LastViewedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** The timestamp when the current user last viewed this record. ### MergedKeyValue **Type:** textarea **Properties:** None **Description:** The concatenated/merged representation of all populated KeyValue fields, generated and used internally for fast key matching during price search. ### Name **Type:** string **Properties:** Autonumber, Defaulted on create, Filter, idLookup, Sort **Description:** The autonumber name that uniquely identifies this pricing condition record. ### OwnerId **Type:** reference **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** The user or queue that owns this record. This field is a polymorphic relationship field. **Relationship Name:** Owner **Refers To:** Group, User ### PricingValue **Type:** double **Properties:** Create, Filter, Nillable, Sort, Update **Description:** The resolved price or pricing amount associated with this condition. ### ProductReferenceRecordId **Type:** reference **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The product or product category this pricing condition applies to. This field is a relationship field. **Relationship Name:** ProductReferenceRecord **Refers To:** Product2, ProductCategory ### ProductUnitofMeasureId **Type:** reference **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The unit of measure the pricing value is expressed in. This field is a relationship field. **Relationship Name:** ProductUnitofMeasure **Refers To:** UnitOfMeasure ### SourceSystemIdentifier **Type:** string **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** An external identifier used to correlate this record with the same pricing condition in an external or source system. ### Status **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The lifecycle status of this pricing condition record. Possible values are Deleted, New, and Updated. ### TierProductUnitofMeasureId **Type:** reference **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The unit of measure used for tiered/scale pricing on this condition, when scale pricing (via ExternalPricingKeyValTier) applies. This field is a relationship field. **Relationship Name:** TierProductUnitofMeasure **Refers To:** UnitOfMeasure ### UniqueKeyHashValue **Type:** string **Properties:** Filter, Group, Sort **Description:** A hash of the merged key value, generated and used internally to enforce uniqueness and speed up lookups during price search. ### UniqueKeyValue **Type:** textarea **Properties:** None **Description:** The full unique key string this condition record is indexed and matched by, generated and used internally. ### ValidFrom **Type:** date **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The date this pricing condition becomes effective. ### ValidTo **Type:** date **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The date this pricing condition expires. ## Associated Objects This object has the following associated objects. If the API version isn't specified, they're available in the same API versions as this object. Otherwise, they're available in the specified API version and later. - [ExternalPricingKeyValueChangeEvent](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/associated-objects/change-event.md): Change events are available for the object. - [ExternalPricingKeyValueFeed](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/associated-objects/feed.md): Feed tracking is available for the object. - [ExternalPricingKeyValueHistory](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/associated-objects/history.md): History is available for tracked fields of the object. - [ExternalPricingKeyValueOwnerSharingRule](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/associated-objects/owner-sharing-rule.md): Sharing rules are available for the object. - [ExternalPricingKeyValueShare](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/associated-objects/share.md): Sharing is available for the object. # Flatten Account Internal Organization Unit Hierarchy (POST) Flattens the account hierarchies of the specified accounts under the specified internal organization unit. ## Resource ``` /connect/industries/retail/flatten-account-iou-hierarchy ``` ## Resource example ``` https://yourInstance.salesforce.com/services/data/v68.0/connect/industries/retail/flatten-account-iou-hierarchy ``` ## Available version 68.0 ## Requires Chatter No ## HTTP methods POST ## Request body for POST See [Flatten Account Internal Organization Unit Hierarchy Input](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/requests/flatten-account-iou-hierarchy-input.md). ```json { "internalOrganizationUnitId": "0gJxx00000000srEAA", "accountIds": ["001xx000003GadmAAC"] } ``` | Name | Type | Description | Required or Optional | Available Version | | ---------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ----------------- | | `internalOrganizationUnitId` | String | Specifies the ID of the internal organization unit under which the specified accounts are flattened. | Optional | 68.0 | | `accountIds` | String[] | Specifies the IDs of account records to flatten under the specified internal organization unit. Maximum number of Account Ids per call: 2000. | Optional | 68.0 | ## Response body for POST See [Flatten Account Internal Organization Unit Hierarchy Output](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/responses/flatten-account-iou-hierarchy-output.md). # Flatten Account Internal Organization Unit Hierarchy Failed Record Provides details of an account that failed to process. ## Properties | Property Name | Type | Description | Available Version | | -------------- | ------ | ------------------------------------------------------------ | ----------------- | | `recordId` | String | Specifies the ID of the account that failed to process. | 68.0 | | `errorMessage` | String | Provides the error message describing why the record failed. | 68.0 | # Flatten Account Internal Organization Unit Hierarchy Input Input representation to flatten the account hierarchies of the specified accounts under an internal organization unit. ## JSON example ```json { "internalOrganizationUnitId": "0gJxx00000000srEAA", "accountIds": ["001xx000003GadmAAC"] } ``` ## Properties | Name | Type | Description | Required or Optional | Available Version | | ---------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ----------------- | | `internalOrganizationUnitId` | String | Specifies the ID of the internal organization unit under which the specified accounts are flattened. | Optional | 68.0 | | `accountIds` | String[] | Specifies the IDs of account records to flatten under the specified internal organization unit. Maximum number of Account Ids per call: 2000. | Optional | 68.0 | # Flatten Account Internal Organization Unit Hierarchy Output Output representation of the flatten account IOU hierarchy operation. ## JSON example ```json { "isSuccess": true, "submittedCount": 1, "failedCount": 0, "failedRecords": [] } ``` ## Properties | Property Name | Type | Description | Available Version | | ---------------- | ------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------- | ----------------- | | `isSuccess` | Boolean | Specifies whether every submitted account was processed successfully. | 68.0 | | `submittedCount` | Integer | Specifies the number of accounts submitted in the request. | 68.0 | | `failedCount` | Integer | Specifies the number of submitted accounts that failed to process. | 68.0 | | `failedRecords` | [Flatten Account Internal Organization Unit Hierarchy Failed Record](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/penny-perfect-pricing-rest/flatten-account-iou-failed-record.md)[] | Provides details of accounts that failed to process. Empty when isSuccess is true. | 68.0 | # Freeze Order Freeze the order's fulfillment in the order management system. ```nolang POST /v2/cpq/carts/{order_ID}/prevalidate ``` Before canceling an order, call the order management system and return the real-time point of no return (PONR) status to confirm that the order can be canceled. With CME Winter '20 and later releases, clicking the **Cancel** button calls the CPQ/CancelOrder OmniScript, which calls the preValidate and createSupplementalOrder methods. Prior to CME Winter '20, the **Cancel Order** button was displayed and it would call the submitCancelOrder method. For backward compatibility, you can adjust the value of the [CPQ Configuration Settings Reference](https://help.salesforce.com/s/articleView?id=ind.comms_t_cpq_configuration_settings_reference_148927.htm) configuration setting. The preValidate method freezes the order's fulfillment in the order management system, which can respond with one of the following: - Accepted: The fulfillment is (or can be eventually) frozen. When the order management system accepts the freeze order request, Odin will set the Order.OrderStatus\_\_c to the Frozen state. - Rejected: The fulfillment cannot be Frozen. Odin looks for the reasonCode field. If the reasonCode value is PONR, Odin sets the Changes Allowed flag in the Order and OrderItem to false. ## Remote Method ```nolang preValidate ``` ## REST Handler ```nolang APIPrevalidateCartsCPQV2 ``` ## Apex ```nolang public static void preValidate(Id orderId) { vlocity_cmt.CpqAppHandler handler = new vlocity_cmt.CpqAppHandler(); /** Setup Input and Output maps **/ Map inputMap = new Map { 'cartId' => orderId }; Map outputMap = new Map(); Map optionsMap = new Map(); handler.invokeMethod('preValidate', inputMap, outputMap, optionsMap); } ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | -------------------------------------------------------------------- | | Resource URL | `/services/apexrest/{namespace}/v2/cpq/carts/{order_ID}/prevalidate` | | Request Body | `{"cartId": "order_ID"}` | ## Message Codes | Code | Description | | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | FREEZE-1026 | The preValidate API can make a Freeze Order request to the Order Management System (OM). This code indicates that OM accepted the Freeze Order request. | | FREEZE-1027 | The preValidate API can make a Freeze Order request to the Order Management System (OM). This code indicates that OM rejected the Freeze Order request. | | FREEZE-1028 | The preValidate API can make a Freeze Order request to the Order Management System (OM). This code indicates that parameters required by OdinAPIHandler (orderIdList) were not passed. To avoid this, use standard provided implementations for OdinAPIHandler interface. | | FREEZE-1029 | The preValidate API can make a Freeze Order request to the Order Management System (OM). If OM returns an unrecognized response, then this code is returned by preValidate API. Only Accepted and Rejected are recognized responses for Freeze Order request. | | FREEZE-1030 | The preValidate API can make a Freeze Order request to the Order Management System (OM). If the OM rejects the request, it can send the reasonCode field to specify why the request was rejected. Recognized reasonCode values include `PONR`, `UNKNOWN`, and `EXCEPTION`. If OM returns any other reasonCode, the preValidate API returns this error code. | | INVOKE-500 | The preValidate API was called with an incorrect cart ID. | **See Also** - [In-Flight Order Cancellation](https://help.salesforce.com/s/articleView?id=ind.comms_in_flight_order_cancellation.htm) - [Unfreeze Order](https://developer.salesforce.com/docs/industries/cme/guide/comms-unfreeze-order.md) # Frequently Asked Questions (FAQ) Get answers to these common questions about the Standard Cart APIs. - **What are the steps for migrating to Standard Cart APIs?** Customers must follow the required migration steps to enable Standard Cart APIs. See [Migrate to Standard Cart APIs](https://developer.salesforce.com/docs/industries/cme/guide/comms-migrate-to-std-cart.md). - **Are Standard Cart APIs backward compatible with Classic Cart APIs?** Standard Cart APIs retain the same API names, inputs, and response formats as Classic Cart APIs unless otherwise noted in changes to response. Enabling the JSON V2 Attribute Schema may introduce response changes. Any customizations or hooks on existing interfaces and implementations must be migrated to the Cart Document model. - **Is there feature parity between original and Standard Cart APIs on Core?** Refer to the [Check Feature Compatibility](https://developer.salesforce.com/docs/industries/cme/guide/review-the-considerations.md) list and [Known Limitations](https://developer.salesforce.com/docs/industries/cme/guide/standard-cart-known-limitations.md). Standard Cart APIs are compatible with most Industries CPQ capabilities, but some Classic behaviors still differ. For example, `replaceOffers` does not support complex multi-play transformations, and several Cart APIs continue to run on the Classic Apex path. - **Which Cart APIs run as Standard Cart APIs?** Only the APIs listed in [Standard Cart APIs](https://developer.salesforce.com/docs/industries/cme/guide/std-cart-get-started.md) run on Salesforce core when Standard Cart APIs are enabled. Other Cart APIs continue to use Apex libraries. See [Cart APIs vs Standard Cart APIs](https://developer.salesforce.com/docs/industries/cme/guide/comms-cart-based-apis-for-industries-cpq.md#cart-apis-vs-standard-cart-apis). - **Can Standard DC APIs be used with non-standard DC APIs?** No, this is not possible, as enabling Standard DC APIs is an organization-wide setting. - **Can Standard DC APIs be used with Classic Cart APIs and vice versa?** Yes, this is possible. Standard DC APIs and Standard Cart APIs have separate enablement settings. - **Which interfaces, besides `vlocity_cmt.PricingPlanService`, need to be replaced during the refactor?** Implementations must use `CpqCartDocument`. The `PricingPlanService` does not need to be replaced. When Standard Cart APIs are enabled, the pricing interface used for non-Standard APIs will no longer be invoked, so no replacement is required. - **What new interfaces are introduced with Standard APIs, and how should they be set up?** To configure the new interfaces introduced with Standard APIs - Yes, you need to add new records to the Interface Implementations list. - Each interface requires a corresponding Active Implementation Class.For details on specific interfaces and their associated Active Implementation Classes. These are the new interfaces: - CpqPricing - CpqValidation - CpqPricingHook - CpqContextRule - CpqPricingEligibility - CartResponse - CpqTightestMatch - CpqTimePolicy - CpqPricingVariableCalc For more information, see [Interfaces and Implementations](https://developer.salesforce.com/docs/industries/cme/guide/comms-migration-consideration-cart.html#interfaces-and-implementations). - **How do the new interfaces introduced with Standard APIs map to non-standard API interfaces?** The new interfaces serve as a mapping reference for non-standard API interfaces. The list helps customers identify where to add pre/post-hooks to customize input/output for the corresponding implementation. The active default implementation classes for each interface are provided in the table mentioned above for reference. - **Can customers replace the default implementation of the new interfaces?** - Yes, customers can replace the entire default implementation with a custom one to implement their logic. - However, it is recommended to use pre/post-hooks on these interfaces instead of replacing the full implementation. - These interfaces will not be available in the Interface Implementation tab. - To modify them, go to **Setup > Custom Settings > Custom Class Implementation**. - **Can we operate on the Cart Document in CpqAppHandler pre- and post-hooks?** No. The Cart Document is available only within individual service interface hooks, not in CpqAppHandler hooks. However, existing CpqAppHandler hooks from Classic CPQ will continue to work by relying on input/output maps and the relevant database records. - **Will the OOTB Attribute Propagation for Relies On related offers work with Standard APIs?** Yes, OOTB Attribute Propagation works only with Standard Cart APIs. It will not function if Standard Cart APIs are disabled. - **Is caching calculation matrices still required when moving to Business Rules Engine for pricing calculations?** Yes, caching calculation matrices is still required to improve performance for pricing calculations, even when using Business Rules Engine. - **Do we need to increase the size of the CPQPartition platform cache for Standard APIs, or define a new cache partition?** No, Standard cart APIs rarely depend on the platform cache partition. Instead, compiled data entries for Standard Cart APIs are stored in the `CachedAPIResponse__c` object table and Scale Cache. No need to increase CPQPartition size or create a new cache partition. - **How do we replace `vlocity_cmt.PricingPlanService.putInPricingContext` calls with Standard Cart APIs?** - Replacing `getFromPricingContext`: Use `cartDocument.getCartFields()` and `getItemFields()` instead, as described in the documentation. - Replacing `putInPricingContext`: Previously, `putInPricingContext` stored key-value pairs in a static map for retrieval through `getFromPricingContext`. - With Standard Cart APIs enabled, customers can now access the Cart Document object directly from the input map. - For retrieving header (order/quote/opp) & line item objects, refer to the Cart Document documentation. Additional pricing-related information is available in the input map. Handling Custom Entries: If customers are manually adding and fetching data through `putInPricingContext`, they can implement the same functionality by creating a custom static map and handling read/write operations independently. # Future Dated Cache The Future Dated Cache feature allows you to enter the date and time when you want the cached records to become effective. For example, suppose you update your product catalog on March 31 but want the updates to become effective at midnight on April 1st. Setting the date and time to 12:00 a.m. on April 1 updates the cache data so that subsequent to the effective date, API calls retrieve the updated cached data. When the job is run, the following window displays: ![Regenerate Cached API Records](https://developer.salesforce.com/docs/media/regen_cached_records.png) **note:** You must set CacheAPI.RegenerateFutureDatedCache=true for the Regenerate Cached API Records window to display. See [CPQ Configuration Settings Reference](https://help.salesforce.com/s/articleView?id=ind.comms_t_cpq_configuration_settings_reference_148927.htm&type=5). When the Regenerate Cached API Records batch job is run with a selected date, it can only be rerun on or after that specified date and time. See [Regenerate Cache Batch Process Examples and Best Practices](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-regenerate-cache-batch-process-examples-and-best-practices.md). **important:** The Regenerate Cache batch job does not support the Future Dated Cache feature when Product Versioning is enabled. # Generate Affected Response API As part of the generation of records, a cachedAPIChangeEntryId query parameter generates the cache data for the change entry Id passed in the input. This call is required if the generateAction node is present in the response from Get Affected Cache. If you have at least one offer availability change based on the response you received from the Get Affected Cache, then you must execute certain populate cache APIs again using the catalog codes provided in the response. For example, you may receive the generateAction asking you to perform five of the populate cache APIs with the catalog code AS_hierarchywithpromotion. The Generate Affected Response API: - Checks if the Id is valid and the corresponding cachedAPIChangeEntryId record is unprocessed. - Gets the cachedAPIchange Id and checks if the dependent change entry is processed. If not, then the API throws an error to indicate that the dependent records are not processed. - If the generation is successful, the API marks the cachedAPIChangeEntryId record as processed. This is the predefined sequence for specific types of records to generate: | Sequence for the itemType | Priority | | ----------------------------- | -------- | | dataProfileResultItem | 1 | | ruleSetCombinationResultItem | 2 | | contextDimensionsResultItem | 3 | | contextCombinationsResultItem | 4 | | catalogCtxEligibilityResult | 5 | | offerItem | 6 | | hierarchyResult | 8 | | priceResult | 9 | | itemDetails | 10 | | bundleWrapper | 11 | | promotionWrapper | 11 | | item | 12 | | orderConfiguration | 13 | For example, if you execute changeEntryId for bundle wrapper with sequence 11, but there is an unprocessed ChangeEntryId in the cachedAPIChange entry table for itemDetails with sequence 10 for the same offer, then an error occurs for violating the dependency check. You can obtain the ChangeEntryId required as a query parameter in the API from the Affected Cache API records.regenerateAction.bundleWrapper.params.ChangeEntryId node. ## Action Nodes An action node contains the request format in the REST Node. These are the action node fields: | Action Node Fields | Description | | ------------------ | ----------------------------------------------------------------------------- | | requestBody | Indicates if there are any request bodies to provide in the respective API. | | params | Indicates if there are any query parameters to provide in the respective API. | | link | Specifies the API URI to invoke the service. | | method | Indicates if the respective API is a GET or POST request. | ## HTTP Headers | Header | Description | | ------------ | ---------------- | | Content-Type | application/json | ## HTTP Response Codes | Code | Description | | ---- | --------------------- | | 200 | OK | | 500 | Internal Server Error | # Get Account Details Retrieve the details for a specified account ID. ```nolang GET /v2/accounts/{account_ID} ``` ## Remote Method ```nolang getAccounts ``` ## Handlers ```nolang REST Endpoint: APIAccountsV2.cls Implementation: CpqGetAccountsActionV2.cls ``` ## Apex Remote Service CpqAppHandler ## Apex Remote Input Map ```nolang { methodName: getAccounts id: 0011I000007lzDO } ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | ------------------------------------------------------- | | Resource URL | /services/apexrest/{namespace}/v2/accounts/{account_ID} | ## Example Request ```nolang GET /services/apexrest/vlocity_cmt/v2/accounts/0011I000007lzDO?fields=OwnerId,Name ``` ## Example Response ```nolang { "totalSize": 1, "messages": [], "records": [ { "messages": [], "displaySequence": -1, "OwnerId": "0051I000000Qvb4QAC", "Name": "AR3" } ] } ``` # Get Applied or Available Promotions for Cart Get a list of promotions. The API can return a sorted list of promotions based on the `sortBy` input parameter. ```nolang GET /v2/cpq/carts/{cart_ID}/promotions ``` The `filters` parameter specifies the filters to use to determine the subset of promotions to return. Each `filters` parameter specifies the field and values to match. The `fields` parameter specifies the Promotion\_\_c fields to return in the API response. The `filters` parameter input is a comma-separated list of sObject fields and values. If one of the fields does not match any sObject fields, it will be discarded. If the `filters` parameter specifies multiple values separated by underscores, the API matches the field value with OR, for example, `SubClass_c:HD_SD` will match `SubClassc='HD'`OR `SubClass_c='SD'`. To specify a promotion name using a locale other than the user's locale, set the localeCode parameter to the desired locale and the query parameter to the name of the promotion. For example: ```nolang GET /services/apexrest/vlocity_cmt/v2/cpq/carts/8011N000002BL2P/promotions?localeCode=fr&query=échantillon ``` 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 ```nolang getPromotionList ``` ## REST Handler ```nolang APIPromotionsCartsCpqV2 ``` ## Apex Remote Service ```nolang CpqAppHandler ``` ## Apex Remote Input Map ```nolang { "methodName": "getPromotionList", "cartId": "801360000008eNU" } ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | ------------------------------------------------------------------ | | Resource URL | `/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/promotions` | ## Example Request ```nolang GET /services/apexrest/vlocity_cmt/v2/cpq/carts/80141000000bARD/promotions?filters=vlocity_cmt_Codec:Test1,Name:Promo1_Promo2&fields=Name,vlocity_cmtCodec,vlocity_cmtIsActive_c ``` ## Example Result ```nolang { "totalSize" => 2, "messages" => [], "records" => [{ "messages" => [], "actions" => { "addtocart" => { "rest" => { "params" => { "items" => [{ "itemId" => "a2f6A000000hDwJQAU" }] }, "method" => "POST", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwG3QAI/promotions" }, "remote" => { "params" => { "items" => [{ "itemId" => "a2f6A000000hDwJQAU" }], "promotionId" => "a2f6A000000hDwJQAU", "cartId" => "8016A000000bwG3QAI", "methodName" => "postCartsPromoItems" } }, "client" => { "params" => {} } }, "validatecart" => { "rest" => { "params" => {}, "method" => "POST", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwG3QAI/validate" }, "remote" => { "params" => { "cartId" => "8016A000000bwG3QAI", "methodName" => "runCartValidation" } }, "client" => { "params" => {} } } }, "displaySequence" => 0, "name" => "PromoOne", "code" => "PromoOne", "id" => "a2f6A000000hDwJQAU", "category" => "Qualified" }, { "messages" => [], "actions" => { "addtocart" => { "rest" => { "params" => { "items" => [{ "itemId" => "a2f6A000000hpOHQAY" }] }, "method" => "POST", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwG3QAI/promotions" }, "remote" => { "params" => { "items" => [{ "itemId" => "a2f6A000000hpOHQAY" }], "promotionId" => "a2f6A000000hpOHQAY", "cartId" => "8016A000000bwG3QAI", "methodName" => "postCartsPromoItems" } }, "client" => { "params" => {} } }, "validatecart" => { "rest" => { "params" => {}, "method" => "POST", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwG3QAI/validate" }, "remote" => { "params" => { "cartId" => "8016A000000bwG3QAI", "methodName" => "runCartValidation" } }, "client" => { "params" => {} } } }, "displaySequence" => 1, "name" => "2146PROMO", "code" => "2146PROMO", "id" => "a2f6A000000hpOHQAY", "category" => "Qualified" } ] } ``` # Get Applied Promotions for Account Return the applied promotions for a specified account ID. ```nolang GET /v2/accounts/{account_ID}/promotions ``` ## Remote Method ```nolang getAppliedPromotionsByAccount ``` ## Handlers ```nolang REST Endpoint: APIAppliedPromotionsAccountsV2.cls Implementation: CpqAppliedPromotionsAccountActionV2.cls ``` ## Apex Remote Service ```nolang CpqAppHandler ``` ## Apex Remote Input Map ```nolang { methodName:getAppliedPromotionsByAccount accounttId:0011I000007lzDO cartId:801Dn0000002YPA, fields:"vlocity_cmt__CancellationDate__c,vlocity_cmt__AppliesTo__c" pagesize:2 filters:vlocity_cmt__AppliesTo__c:Account_Contract commitmentDateFilter:2017-04-05T07:00:00.000Z appliedPromoStatusFilter:Active } ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | ---------------------------------------------------------------------------------------------------------- | | Resource URL | `/services/apexrest/vlocity_cmt/v2/cpq/carts/{account_ID}/promotions?subaction=getPromotionsAppliedToCart` | ## Example Request ```nolang GET /services/apexrest/vlocity_cmt/v2/cpq/carts/801360000000oQ9/promotions ``` ## Example Response ```nolang { "totalSize": 1, "messages": [], "records": [ { "messages": [], "displaySequence": -1, "Id": { "value": "a1if4000000Z1wTAAS", "previousValue": null, "originalValue": null, "messages": [], "label": "Record ID", "hidden": true, "fieldName": "Id", "editable": false, "dataType": "ID", "actions": {} }, "vlocity_cmt__BillingAccountId__c": { "value": "001f40000093uqMAAQ", "previousValue": null, "originalValue": null, "messages": [], "label": "Account", "hidden": true, "fieldName": "vlocity_cmt__BillingAccountId__c", "editable": false, "dataType": "REFERENCE", "actions": {} }, "vlocity_cmt__PromotionId__c": { "value": "a2ff4000000cHPMAA2", "previousValue": null, "originalValue": null, "messages": [], "label": "Promotion", "hidden": true, "fieldName": "vlocity_cmt__PromotionId__c", "editable": true, "dataType": "REFERENCE", "actions": {} }, "vlocity_cmt__Sequence__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Sequence", "hidden": true, "fieldName": "vlocity_cmt__Sequence__c", "editable": true, "dataType": "DOUBLE", "actions": {} }, "vlocity_cmt__CancellationDate__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Cancellation Date", "hidden": true, "fieldName": "vlocity_cmt__CancellationDate__c", "editable": true, "dataType": "DATETIME", "actions": {} }, "vlocity_cmt__CommitmentStartDate__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Commitment Start Date", "hidden": true, "fieldName": "vlocity_cmt__CommitmentStartDate__c", "editable": true, "dataType": "DATETIME", "actions": {} }, "vlocity_cmt__AppliesTo__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Applies To", "hidden": true, "fieldName": "vlocity_cmt__AppliesTo__c", "editable": true, "dataType": "PICKLIST", "actions": {} }, "vlocity_cmt__CancellationStatus__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Cancellation Status", "hidden": true, "fieldName": "vlocity_cmt__CancellationStatus__c", "editable": true, "dataType": "PICKLIST", "actions": {} }, "vlocity_cmt__ReasonForCancellation__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Reason for Cancellation", "hidden": true, "fieldName": "vlocity_cmt__ReasonForCancellation__c", "editable": true, "dataType": "STRING", "actions": {} }, "vlocity_cmt__CommitmentEndDate__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Commitment End Date", "hidden": true, "fieldName": "vlocity_cmt__CommitmentEndDate__c", "editable": true, "dataType": "DATETIME", "actions": {} }, "vlocity_cmt__PricingStartDate__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Benefit Start Date", "hidden": true, "fieldName": "vlocity_cmt__PricingStartDate__c", "editable": true, "dataType": "DATETIME", "actions": {} }, "vlocity_cmt__PricingEndDate__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Benefit End Date", "hidden": true, "fieldName": "vlocity_cmt__PricingEndDate__c", "editable": true, "dataType": "DATETIME", "actions": {} }, "Name": "BundleJul19Promo", "Description": "BundleJul19Promo" } ] }{ "totalSize": 1, "messages": [], "records": [ { "messages": [], "displaySequence": -1, "Id": { "value": "a1if4000000Z1wTAAS", "previousValue": null, "originalValue": null, "messages": [], "label": "Record ID", "hidden": true, "fieldName": "Id", "editable": false, "dataType": "ID", "actions": {} }, "cmt_araov100_1__BillingAccountId__c": { "value": "001f40000093uqMAAQ", "previousValue": null, "originalValue": null, "messages": [], "label": "Account", "hidden": true, "fieldName": "cmt_araov100_1__BillingAccountId__c", "editable": false, "dataType": "REFERENCE", "actions": {} }, "cmt_araov100_1__PromotionId__c": { "value": "a2ff4000000cHPMAA2", "previousValue": null, "originalValue": null, "messages": [], "label": "Promotion", "hidden": true, "fieldName": "cmt_araov100_1__PromotionId__c", "editable": true, "dataType": "REFERENCE", "actions": {} }, "cmt_araov100_1__Sequence__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Sequence", "hidden": true, "fieldName": "cmt_araov100_1__Sequence__c", "editable": true, "dataType": "DOUBLE", "actions": {} }, "cmt_araov100_1__CancellationDate__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Cancellation Date", "hidden": true, "fieldName": "cmt_araov100_1__CancellationDate__c", "editable": true, "dataType": "DATETIME", "actions": {} }, "cmt_araov100_1__CommitmentStartDate__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Commitment Start Date", "hidden": true, "fieldName": "cmt_araov100_1__CommitmentStartDate__c", "editable": true, "dataType": "DATETIME", "actions": {} }, "cmt_araov100_1__AppliesTo__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Applies To", "hidden": true, "fieldName": "cmt_araov100_1__AppliesTo__c", "editable": true, "dataType": "PICKLIST", "actions": {} }, "cmt_araov100_1__CancellationStatus__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Cancellation Status", "hidden": true, "fieldName": "cmt_araov100_1__CancellationStatus__c", "editable": true, "dataType": "PICKLIST", "actions": {} }, "cmt_araov100_1__ReasonForCancellation__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Reason for Cancellation", "hidden": true, "fieldName": "cmt_araov100_1__ReasonForCancellation__c", "editable": true, "dataType": "STRING", "actions": {} }, "cmt_araov100_1__CommitmentEndDate__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Commitment End Date", "hidden": true, "fieldName": "cmt_araov100_1__CommitmentEndDate__c", "editable": true, "dataType": "DATETIME", "actions": {} }, "cmt_araov100_1__PricingStartDate__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Benefit Start Date", "hidden": true, "fieldName": "cmt_araov100_1__PricingStartDate__c", "editable": true, "dataType": "DATETIME", "actions": {} }, "cmt_araov100_1__PricingEndDate__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Benefit End Date", "hidden": true, "fieldName": "cmt_araov100_1__PricingEndDate__c", "editable": true, "dataType": "DATETIME", "actions": {} }, "Name": "BundleJul19Promo", "Description": "BundleJul19Promo" } ] } ``` # Get Asset Pricing Retrieve pricing details for a price field for the specified cart and line item. Supported by Pricing ElementServiceImplementation. ```nolang GET /v2/assets/{ID}/pricing?accountId={account_ID} ``` ## Remote Method ```nolang getAssetPriceDetail ``` ## Handlers ```nolang REST endpoint: APIAssetsPricingV2.cls Implementation: CpqAssetsAccountsActionV2.cls ``` ## Apex Remote Service ```nolang CpqAppHandler ``` ## Apex Remote Input Map ```nolang { "methodName": "getAssetPriceDetail", "id": "02i46000000htMrAAI", "accountId": "0014600000qExFDAA0", "effectiveAssetsDateFilter": "2017-11-06T00:00:00Z" } ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | ---------------------------------------------------------------------------- | | Resource URL | /services/apexrest/{namespace}/v2/assets/{ID}/pricing?accountId={account_ID} | ## Example Request ```nolang GET /services/apexrest/vlocity_cmt/v2/assets/02i46000000htMrAAI/pricing?accountId=0014600000qExFDAA0&effectiveAssetsDateFilter=2017-11-06T00:00:00Z ``` ## Example Response ```nolang { "totalSize": 1, "messages": [], "records": [ { "messages": [], "displaySequence": -1, "id": "02i46000000htMrAAI", "vlocity_cmt__OneTimeCharge__c": { "pricedetail": [ { "actions": {}, "DetailType": "PRICE", "Description": "Product B Base $100 Charge", "StartValue": 100, "EndValue": 100, "AdjustmentType": "None", "AdjustmentMethod": null, "AdjustmentValue": 0 } ] }, "vlocity_cmt__OneTimeCalculatedPrice__c": { "pricedetail": [ { "actions": {}, "DetailType": null, "Description": "One Time Charge (100.00) - One Time Manual Discount (0.00%)", "StartValue": null, "EndValue": null, "AdjustmentType": null, "AdjustmentMethod": null, "AdjustmentValue": null } ] }, "vlocity_cmt__OneTimeTotal__c": { "pricedetail": [ { "actions": {}, "DetailType": null, "Description": "[One Time Calculated Price (100.00) + Rollup One Time Total (0.00)] x Quantity (1.00)", "StartValue": null, "EndValue": null, "AdjustmentType": null, "AdjustmentMethod": null, "AdjustmentValue": null } ] }, "vlocity_cmt__RecurringCharge__c": { "pricedetail": [ { "actions": {}, "DetailType": "PRICE", "Description": "$10 MRC", "StartValue": 10, "EndValue": 10, "AdjustmentType": "None", "AdjustmentMethod": null, "AdjustmentValue": 0 }, { "actions": {}, "DetailType": "ADJUSTMENT", "Description": "Markup applied by Agent", "StartValue": 10, "EndValue": 15, "AdjustmentType": "Markup", "AdjustmentMethod": "Percent", "AdjustmentValue": 50 } ] }, "vlocity_cmt__RecurringCalculatedPrice__c": { "pricedetail": [ { "actions": {}, "DetailType": null, "Description": "Recurring Charge (15.0000) - Recurring Manual Discount (0.00%)", "StartValue": null, "EndValue": null, "AdjustmentType": null, "AdjustmentMethod": null, "AdjustmentValue": null } ] }, "vlocity_cmt__RecurringTotal__c": { "pricedetail": [ { "actions": {}, "DetailType": null, "Description": "[Recurring Calculated Price (15.00) + Rollup Recurring Total (0.00)] x Quantity (1.00)", "StartValue": null, "EndValue": null, "AdjustmentType": null, "AdjustmentMethod": null, "AdjustmentValue": null } ] } } ] } ``` # Get Assets for Account Retrieve the assets for a specified account ID. ```nolang GET /v2/assets/{ID}/pricing?accountId={account_ID} ``` ## Remote Method ```nolang getAssetsByAccount ``` ## Handlers ```nolang REST Endpoint: APIAssetsContractsV2.cls Implementation: CpqAssetsContractsActionV2.cls ``` ## Apex Remote Service ```nolang CpqAppHandler ``` ## Apex Remote Input Map ```nolang methodName: getAssetsByAccount accountId: 0011I000007lzDO includes: noContractAssets effectiveAssetsDateFilter: 2019-04-05T07:00:00.000Z pagesize: 2 ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | ---------------------------------------------------------------- | | Resource URL | `/services/apexrest/{namespace}/v2/accounts/{account_ID}/assets` | ## Example Request ```nolang GET /services/apexrest/vlocity_cmt/v2/accounts/0011I000007lzDO/assets?pagesize=2&includes=noContractAssets&effectiveAssetsDateFilter=2019-04-05T07:00:00.000Z ``` To populate the attributeCategories node in the response for getAsset API, provide one of the two fields Product2.AttributeMetadata**c or JSONAttribute**c as an input. If V2AttributeModel is enabled, then provide Product2.AttributeMetadata**c. If V2AttributeModel is disabled, then pass JSONAttribute**c. ``` GET /services/apexrest/vlocity_cmt/v2/accounts/{accountId}/assets?fields=vlocity_cmt**JSONAttribute**c ``` From Spring'25, the Get Assets for Account API applies the `timeOffset` in the `effectiveAssetsDateFilte`. If no offset is provided, it defaults to 00:00:00. To resolve this, append the time to the effectiveAssetsDateFilter parameter. Customers can set up a pre-hook to apply this adjustment automatically. ### Pre-hook for getAssetsByAccount The CPQ APIs allow you to write custom pre and post hooks for each API to implement custom logic. The pre-hook runs before the API executes, while the post-hook runs after the API executes. 1. Write the custom class to implement the pre and post hook. Here's the sample code that appends the `timeoffset` to the `effectiveAssetsDateFilter` when only a date is provided. ``` global with sharing class CPQCustomHookImplementation implements vlocity_cmt.VlocityOpenInterface{ global Boolean invokeMethod(String methodName, Map input, Map output, Map options) { if( methodName.equalsIgnoreCase('getAssetsByAccount.PreInvoke')) { getAssetsByAccount_PreInvoke(methodName, input, output,options); return true; } return false; } private void getAssetsByAccount_PreInvoke(String methodName, Map input, Map output, Map options) { //This method gets called before getAssetsByAccount String dateStr = (String)input.get('effectiveAssetsDateFilter'); if(dateStr.length() == 10){ dateStr = dateStr+'T23:59:59.000Z'; input.put('effectiveAssetsDateFilter',dateStr); } } } ``` 2. Create the interface implementation. For example: Interface Name = `CpqAppHandlerHookInterface` Implementation = `CPQCustomHookImplementation` ## Example Response ```nolang { "totalSize": 1, "messages": [], "records": [{ "messages": [], "actions": { "assetchangesite": { "rest": { "params": {}, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/carts?subaction=assetChangeSite" }, "remote": { "params": { "assetList": ["02i1I00000058doQAA"], "moveDate": null, "toServiceLocation": null, "fromServiceLocation": null } }, "client": { "params": {} } }, "assettoquote": { "rest": { "params": {}, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/carts?subaction=assetToQuote" }, "remote": { "params": { "assetList": ["02i1I00000058doQAA"], "requestDate": null } }, "client": { "params": {} } }, "assettoorder": { "rest": { "params": {}, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/carts?subaction=assetToOrder" }, "remote": { "params": { "assetList": ["02i1I00000058doQAA"], "requestDate": null } }, "client": { "params": {} } } }, "displaySequence": -1, "Id": { "value": "02i1I00000058doQAA", "previousValue": null, "originalValue": null, "messages": [], "label": "Asset ID", "hidden": true, "fieldName": "Id", "editable": false, "dataType": "ID", "actions": {} }, "Quantity": { "value": 1.00, "previousValue": null, "originalValue": null, "messages": [], "label": "Quantity", "hidden": true, "fieldName": "Quantity", "editable": false, "dataType": "DOUBLE", "actions": {} }, "vlocity_cmt__ProvisioningStatus__c": { "value": "Active", "previousValue": null, "originalValue": null, "messages": [], "label": "Provisioning Status", "hidden": true, "fieldName": "vlocity_cmt__ProvisioningStatus__c", "editable": false, "dataType": "STRING", "actions": {} }, "vlocity_cmt__RecurringTotal__c": { "value": 10.00, "previousValue": null, "originalValue": null, "messages": [], "label": "Recurring Total", "hidden": true, "fieldName": "vlocity_cmt__RecurringTotal__c", "editable": false, "dataType": "CURRENCY", "actions": { "pricedetail": { "rest": { "params": {}, "method": "GET", link ": " / services / apexrest / vlocity_cmt / v2 / assets / 02 i1I00000058doQAA / pricing ? accountId = 0011 I000007ms8TQAQ & priceDetailsFields = vlocity_cmt__RecurringTotal__c & effectiveAssetsDateFilter = 2019 - 04 - 05 T07 : 00: 00.000 Z " }, "remote": { "params": { "effectiveAssetsDateFilter": "2019-04-05T07:00:00.000Z", "priceDetailsFields": "vlocity_cmt__RecurringTotal__c", "priceDetail": true, "id": "02i1I00000058doQAA", "accountId": "0011I000007ms8TQAQ", "methodName": "getAssetPriceDetail" } }, "client": { "records": [], "params": {} } } } }, "vlocity_cmt__OneTimeTotal__c": { "value": 100.00, "previousValue": null, "originalValue": null, "messages": [], "label": "One Time Total", "hidden": true, "fieldName": "vlocity_cmt__OneTimeTotal__c", "editable": false, "dataType": "CURRENCY", "actions": { "pricedetail": { "rest": { "params": {}, "method": "GET", link ": " / services / apexrest / vlocity_cmt / v2 / assets / 02 i1I00000058doQAA / pricing ? accountId = 0011 I000007ms8TQAQ & priceDetailsFields = vlocity_cmt__RecurringTotal__c & effectiveAssetsDateFilter = 2019 - 04 - 05 T07 : 00: 00.000 Z " }, "remote": { "params": { "effectiveAssetsDateFilter": "2019-04-05T07:00:00.000Z", "priceDetailsFields": "vlocity_cmt__OneTimeTotal__c", "priceDetail": true, "id": "02i1I00000058doQAA", "accountId": "0011I000007ms8TQAQ", "methodName": "getAssetPriceDetail" } }, "client": { "records": [], "params": {} } } } }, "vlocity_cmt__ContractId__c": { "value": "8001I0000000ThqQAE", "previousValue": null, "originalValue": null, "messages": [], "label": "Contract", "hidden": false, "fieldName": "vlocity_cmt__ContractId__c", "editable": false, "dataType": "REFERENCE", "actions": {} }, "vlocity_cmt__LineNumber__c": { "value": "0001", "previousValue": null, "originalValue": null, "messages": [], "label": "Line Number", "hidden": true, "fieldName": "vlocity_cmt__LineNumber__c", "editable": false, "dataType": "STRING", "actions": {} }, "vlocity_cmt__RootItemId__c": { "value": "02i1I00000058doQAA", "previousValue": null, "originalValue": null, "messages": [], "label": "RootItemId", "hidden": true, "fieldName": "vlocity_cmt__RootItemId__c", "editable": false, "dataType": "STRING", "actions": {} }, "vlocity_cmt__OneTimeCharge__c": { "value": 100.00, "previousValue": null, "originalValue": null, "messages": [], "label": "One Time Charge", "hidden": true, "fieldName": "vlocity_cmt__OneTimeCharge__c", "editable": false, "dataType": "CURRENCY", "actions": { "pricedetail": { "rest": { "params": {}, "method": "GET", link ": " / services / apexrest / vlocity_cmt / v2 / assets / 02 i1I00000058doQAA / pricing ? accountId = 0011 I000007ms8TQAQ & priceDetailsFields = vlocity_cmt__RecurringTotal__c & effectiveAssetsDateFilter = 2019 - 04 - 05 T07 : 00: 00.000 Z " }, "remote": { "params": { "effectiveAssetsDateFilter": "2019-04-05T07:00:00.000Z", "priceDetailsFields": "vlocity_cmt__OneTimeCharge__c", "priceDetail": true, "id": "02i1I00000058doQAA", "accountId": "0011I000007ms8TQAQ", "methodName": "getAssetPriceDetail" } }, "client": { "records": [], "params": {} } } } }, "vlocity_cmt__OneTimeCalculatedPrice__c": { "value": 100.00, "previousValue": null, "originalValue": null, "messages": [], "label": "One Time Calculated Price", "hidden": true, "fieldName": "vlocity_cmt__OneTimeCalculatedPrice__c", "editable": false, "dataType": "CURRENCY", "actions": { "pricedetail": { "rest": { "params": {}, "method": "GET", link ": " / services / apexrest / vlocity_cmt / v2 / assets / 02 i1I00000058doQAA / pricing ? accountId = 0011 I000007ms8TQAQ & priceDetailsFields = vlocity_cmt__RecurringTotal__c & effectiveAssetsDateFilter = 2019 - 04 - 05 T07 : 00: 00.000 Z " }, "remote": { "params": { "effectiveAssetsDateFilter": "2019-04-05T07:00:00.000Z", "priceDetailsFields": "vlocity_cmt__OneTimeCalculatedPrice__c", "priceDetail": true, "id": "02i1I00000058doQAA", "accountId": "0011I000007ms8TQAQ", "methodName": "getAssetPriceDetail" } }, "client": { "records": [], "params": {} } } } }, "vlocity_cmt__OneTimeManualDiscount__c": { "value": 0.00, "previousValue": null, "originalValue": null, "messages": [], "label": "One Time Manual Discount", "hidden": true, "fieldName": "vlocity_cmt__OneTimeManualDiscount__c", "editable": false, "dataType": "PERCENT", "actions": {} }, "vlocity_cmt__RecurringCharge__c": { "value": 10.00, "previousValue": null, "originalValue": null, "messages": [], "label": "Recurring Charge", "hidden": true, "fieldName": "vlocity_cmt__RecurringCharge__c", "editable": false, "dataType": "CURRENCY", "actions": { "pricedetail": { "rest": { "params": {}, "method": "GET", link ": " / services / apexrest / vlocity_cmt / v2 / assets / 02 i1I00000058doQAA / pricing ? accountId = 0011 I000007ms8TQAQ & priceDetailsFields = vlocity_cmt__RecurringTotal__c & effectiveAssetsDateFilter = 2019 - 04 - 05 T07 : 00: 00.000 Z " }, "remote": { "params": { "effectiveAssetsDateFilter": "2019-04-05T07:00:00.000Z", "priceDetailsFields": "vlocity_cmt__RecurringCharge__c", "priceDetail": true, "id": "02i1I00000058doQAA", "accountId": "0011I000007ms8TQAQ", "methodName": "getAssetPriceDetail" } }, "client": { "records": [], "params": {} } } } }, "vlocity_cmt__RecurringCalculatedPrice__c": { "value": 10.00, "previousValue": null, "originalValue": null, "messages": [], "label": "Recurring Calculated Price", "hidden": true, "fieldName": "vlocity_cmt__RecurringCalculatedPrice__c", "editable": false, "dataType": "CURRENCY", "actions": { "pricedetail": { "rest": { "params": {}, "method": "GET", link ": " / services / apexrest / vlocity_cmt / v2 / assets / 02 i1I00000058doQAA / pricing ? accountId = 0011 I000007ms8TQAQ & priceDetailsFields = vlocity_cmt__RecurringTotal__c & effectiveAssetsDateFilter = 2019 - 04 - 05 T07 : 00: 00.000 Z " }, "remote": { "params": { "effectiveAssetsDateFilter": "2019-04-05T07:00:00.000Z", "priceDetailsFields": "vlocity_cmt__RecurringCalculatedPrice__c", "priceDetail": true, "id": "02i1I00000058doQAA", "accountId": "0011I000007ms8TQAQ", "methodName": "getAssetPriceDetail" } }, "client": { "records": [], "params": {} } } } }, "vlocity_cmt__RecurringManualDiscount__c": { "value": 0.00, "previousValue": null, "originalValue": null, "messages": [], "label": "Recurring Manual Discount", "hidden": true, "fieldName": "vlocity_cmt__RecurringManualDiscount__c", "editable": false, "dataType": "PERCENT", "actions": {} }, "vlocity_cmt__ServiceAccountId__c": { "value": "0011I000007ms8TQAQ", "previousValue": null, "originalValue": null, "messages": [], "label": "Service Account", "hidden": false, "fieldName": "vlocity_cmt__ServiceAccountId__c", "editable": false, "dataType": "REFERENCE", "actions": {} }, "vlocity_cmt__BillingAccountId__c": { "value": "0011I000007ms8TQAQ", "previousValue": null, "originalValue": null, "messages": [], "label": "Billing Account", "hidden": false, "fieldName": "vlocity_cmt__BillingAccountId__c", "editable": false, "dataType": "REFERENCE", "actions": {} }, "vlocity_cmt__PricingLogData__c": { "value": "{\"LogData\":{\"OT_STD_PRC\":[{\"PriceListEntryId\":\"a2X1I0000009iFXUAY\",\"LogType\":\"PRICE\",\"PricingElementGlobalKey\":\"775e358f-31c4-e8de-e23d-e00bbbfedfa6\",\"StartValue\":100.00,\"SubType\":\"Standard\",\"Frequency\":null,\"ChargeTiming\":\"One-time\",\"EndValue\":100.00,\"DisplayText\":\"100$ OTSP\",\"PricingVariableCode\":\"OT_STD_PRC\",\"PricingElementId\":\"a2a1I000000Bar6QAC\",\"PromotionId\":null,\"OfferId\":null,\"PriceListId\":\"a2Y1I000000TlsrUAC\",\"BaseAdjustment\":null,\"BaseValue\":100.00,\"AdjustmentMethod\":null,\"AdjustmentValue\":0.00,\"Amount\":100.00,\"AdjustmentType\":\"None\",\"LogSequence\":0}],\"REC_MNTH_STD_PRC\":[{\"PriceListEntryId\":\"a2X1I0000009iFcUAI\",\"LogType\":\"PRICE\",\"PricingElementGlobalKey\":\"9ef41d53-1bba-017e-625a-b06ac2de2c28\",\"StartValue\":10.00,\"SubType\":\"Standard\",\"Frequency\":\"Monthly\",\"ChargeTiming\":\"Recurring\",\"EndValue\":10.00,\"DisplayText\":\"10$ RMSP\",\"PricingVariableCode\":\"REC_MNTH_STD_PRC\",\"PricingElementId\":\"a2a1I000000Bar1QAC\",\"PromotionId\":null,\"OfferId\":null,\"PriceListId\":\"a2Y1I000000TlsrUAC\",\"BaseAdjustment\":null,\"BaseValue\":10.00,\"AdjustmentMethod\":null,\"AdjustmentValue\":0.00,\"Amount\":10.00,\"AdjustmentType\":\"None\",\"LogSequence\":0}],\"OT_STD_PRC_CALC\":[{\"LogSequence\":0,\"DisplayText\":\"One Time Charge (100.00) - One Time Manual Discount (0.00%)\"}],\"OT_STD_PRC_TOTAL\":[{\"LogSequence\":0,\"DisplayText\":\"[One Time Calculated Price (100.00) + Rollup One Time Total (0.00)] x Quantity (1.00)\"}],\"REC_MNTH_STD_PRC_CALC\":[{\"LogSequence\":0,\"DisplayText\":\"Recurring Charge (10.00) - Recurring Manual Discount (0.00%)\"}],\"REC_MNTH_STD_PRC_TOTAL\":[{\"LogSequence\":0,\"DisplayText\":\"[Recurring Calculated Price (10.00) + Rollup Recurring Total (0.00)] x Quantity (1.00)\"}]},\"PricingVariableCodeFieldBinding\":{\"Quantity\":\"LINE_QUANTITY\",\"vlocity_cmt__EffectiveRecurringTotal__c\":\"EFF_REC_MNTH_STD_PRC_TOTAL\",\"vlocity_cmt__EffectiveOneTimeTotal__c\":\"EFF_OT_STD_PRC_TOTAL\",\"vlocity_cmt__OneTimeCalculatedPrice__c\":\"OT_STD_PRC_CALC\",\"vlocity_cmt__OneTimeManualDiscount__c\":\"OT_STD_PRC_DISC_PCT_MAN\",\"vlocity_cmt__OneTimeCharge__c\":\"OT_STD_PRC\",\"vlocity_cmt__RecurringTotal__c\":\"REC_MNTH_STD_PRC_TOTAL\",\"vlocity_cmt__RecurringCalculatedPrice__c\":\"REC_MNTH_STD_PRC_CALC\",\"vlocity_cmt__RecurringManualDiscount__c\":\"REC_MNTH_STD_PRC_DISC_PCT_MAN\",\"vlocity_cmt__RecurringCharge__c\":\"REC_MNTH_STD_PRC\",\"vlocity_cmt__OneTimeTotal__c\":\"OT_STD_PRC_TOTAL\",\"vlocity_cmt__EffectiveQuantity__c\":\"EFFECTIVE_QUANTITY\"},\"PriceAdjustmentPromoKeys\":[],\"PricingVariableCodeValues\":{\"LINE_QUANTITY\":1.00,\"OT_STD_PRC_DISC_PCT_MAN\":0.00,\"REC_MNTH_STD_PRC_DISC_PCT_MAN\":0.00,\"OT_STD_PRC\":100.00,\"OT_STD_PRC_CALC\":100.00,\"OT_STD_PRC_TOTAL\":100.00,\"REC_MNTH_STD_PRC\":10.00,\"REC_MNTH_STD_PRC_CALC\":10.00,\"REC_MNTH_STD_PRC_TOTAL\":10.00,\"ROLLUP_OT_STD_PRC_TOTAL\":0.00,\"ROLLUP_REC_MNTH_STD_PRC_TOTAL\":0.00,\"EFF_OT_STD_PRC_TOTAL\":100.00,\"EFF_REC_MNTH_STD_PRC_TOTAL\":10.00,\"EFFECTIVE_QUANTITY\":1.00},\"PricingVariableCodeBaseValues\":{\"OT_STD_PRC\":100.00,\"REC_MNTH_STD_PRC\":10.00},\"LogVersion\":\"1.0\",\"LastPricingTime\":\"2019-11-07T10:21:55.572Z\"}", "previousValue": null, "originalValue": null, "messages": [], "label": "Pricing Log", "hidden": true, "fieldName": "vlocity_cmt__PricingLogData__c", "editable": false, "dataType": "TEXTAREA", "actions": {} }, "vlocity_cmt__SequenceNumber__c": { "value": 1, "previousValue": null, "originalValue": null, "messages": [], "label": "Sequence Number", "hidden": true, "fieldName": "vlocity_cmt__SequenceNumber__c", "editable": false, "dataType": "DOUBLE", "actions": {} }, "vlocity_cmt__PricebookEntryId__c": { "value": "01u1I000000ZY4nQAG", "previousValue": null, "originalValue": null, "messages": [], "label": "PricebookEntryId", "hidden": true, "fieldName": "vlocity_cmt__PricebookEntryId__c", "editable": false, "dataType": "STRING", "actions": {} }, "vlocity_cmt__EffectiveQuantity__c": { "value": 1.00, "previousValue": null, "originalValue": null, "messages": [], "label": "Effective Quantity", "hidden": true, "fieldName": "vlocity_cmt__EffectiveQuantity__c", "editable": false, "dataType": "DOUBLE", "actions": {} }, "vlocity_cmt__EffectiveRecurringTotal__c": { "value": 10.00, "previousValue": null, "originalValue": null, "messages": [], "label": "Effective Recurring Total", "hidden": true, "fieldName": "vlocity_cmt__EffectiveRecurringTotal__c", "editable": false, "dataType": "CURRENCY", "actions": {} }, "vlocity_cmt__EffectiveOneTimeTotal__c": { "value": 100.00, "previousValue": null, "originalValue": null, "messages": [], "label": "Effective One Time Total", "hidden": true, "fieldName": "vlocity_cmt__EffectiveOneTimeTotal__c", "editable": false, "dataType": "CURRENCY", "actions": {} }, "Name": "TestA", "promotions": { "totalSize": 0, "messages": [] } }] } ``` # Get Assets for Contract Retrieve the assets for a specified contract ID. ```nolang GET /v2/contracts/{contract_ID}/assets ``` ## Remote Method ```nolang getAssetsByContract ``` ## Handlers ```nolang REST Endpoint: APIAssetsContractsV2.cls Implementation: CpqAssetsContractsActionV2.cls ``` ## Apex Remote Service ```nolang CpqAppHandler ``` ## Apex Remote Input Map ```nolang methodName: getAssetsByContract contractId: 8001I0000000Thq effectiveAssetsDateFilter: 2020-04-05T07:00:00.000Z pagesize: 2 ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | ------------------------------------------------------------------ | | Resource URL | `/services/apexrest/{namespace}/v2/contracts/{contract_ID}/assets` | ## Example Request ```nolang GET /services/apexrest/vlocity_cmt/v2/contracts/8001I0000000Thq/assets?pagesize=2&includes=noContractAssets&effectiveAssetsDateFilter=2020-04-05T07:00:00.000Z ``` ## Example Response ```nolang { "totalSize": 1, "messages": [], "records": [ { "messages": [], "actions": { "assetchangesite": { "rest": { "params": {}, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/carts?subaction=assetChangeSite" }, "remote": { "params": { "assetList": [ "02i1I00000058doQAA" ], "moveDate": null, "toServiceLocation": null, "fromServiceLocation": null } }, "client": { "params": {} } }, "assettoquote": { "rest": { "params": {}, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/carts?subaction=assetToQuote" }, "remote": { "params": { "assetList": [ "02i1I00000058doQAA" ], "requestDate": null } }, "client": { "params": {} } }, "assettoorder": { "rest": { "params": {}, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/carts?subaction=assetToOrder" }, "remote": { "params": { "assetList": [ "02i1I00000058doQAA" ], "requestDate": null } }, "client": { "params": {} } } }, "displaySequence": -1, "Id": { "value": "02i1I00000058doQAA", "previousValue": null, "originalValue": null, "messages": [], "label": "Asset ID", "hidden": true, "fieldName": "Id", "editable": false, "dataType": "ID", "actions": {} }, "Quantity": { "value": 1, "previousValue": null, "originalValue": null, "messages": [], "label": "Quantity", "hidden": true, "fieldName": "Quantity", "editable": false, "dataType": "DOUBLE", "actions": {} }, "vlocity_cmt__ProvisioningStatus__c": { "value": "Active", "previousValue": null, "originalValue": null, "messages": [], "label": "Provisioning Status", "hidden": true, "fieldName": "vlocity_cmt__ProvisioningStatus__c", "editable": false, "dataType": "STRING", "actions": {} }, "vlocity_cmt__RecurringTotal__c": { "value": 10, "previousValue": null, "originalValue": null, "messages": [], "label": "Recurring Total", "hidden": true, "fieldName": "vlocity_cmt__RecurringTotal__c", "editable": false, "dataType": "CURRENCY", "actions": { "pricedetail": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/assets/02i1I00000058doQAA/pricing?accountId=0011I000007ms8TQAQ&priceDetailsFields=vlocity_cmt__RecurringTotal__c&effectiveAssetsDateFilter=2020-04-05T07:00:00.000Z" }, "remote": { "params": { "effectiveAssetsDateFilter": "2020-04-05T07:00:00.000Z", "priceDetailsFields": "vlocity_cmt__RecurringTotal__c", "priceDetail": true, "id": "02i1I00000058doQAA", "accountId": "0011I000007ms8TQAQ", "methodName": "getAssetPriceDetail" } }, "client": { "records": [], "params": {} } } } }, "vlocity_cmt__OneTimeTotal__c": { "value": 100, "previousValue": null, "originalValue": null, "messages": [], "label": "One Time Total", "hidden": true, "fieldName": "vlocity_cmt__OneTimeTotal__c", "editable": false, "dataType": "CURRENCY", "actions": { "pricedetail": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/assets/02i1I00000058doQAA/pricing?accountId=0011I000007ms8TQAQ&priceDetailsFields=vlocity_cmt__OneTimeTotal__c&effectiveAssetsDateFilter=2020-04-05T07:00:00.000Z" }, "remote": { "params": { "effectiveAssetsDateFilter": "2020-04-05T07:00:00.000Z", "priceDetailsFields": "vlocity_cmt__OneTimeTotal__c", "priceDetail": true, "id": "02i1I00000058doQAA", "accountId": "0011I000007ms8TQAQ", "methodName": "getAssetPriceDetail" } }, "client": { "records": [], "params": {} } } } }, "vlocity_cmt__ContractId__c": { "value": "8001I0000000ThqQAE", "previousValue": null, "originalValue": null, "messages": [], "label": "Contract", "hidden": false, "fieldName": "vlocity_cmt__ContractId__c", "editable": false, "dataType": "REFERENCE", "actions": {} }, "vlocity_cmt__LineNumber__c": { "value": "0001", "previousValue": null, "originalValue": null, "messages": [], "label": "Line Number", "hidden": true, "fieldName": "vlocity_cmt__LineNumber__c", "editable": false, "dataType": "STRING", "actions": {} }, "vlocity_cmt__RootItemId__c": { "value": "02i1I00000058doQAA", "previousValue": null, "originalValue": null, "messages": [], "label": "RootItemId", "hidden": true, "fieldName": "vlocity_cmt__RootItemId__c", "editable": false, "dataType": "STRING", "actions": {} }, "vlocity_cmt__OneTimeCharge__c": { "value": 100, "previousValue": null, "originalValue": null, "messages": [], "label": "One Time Charge", "hidden": true, "fieldName": "vlocity_cmt__OneTimeCharge__c", "editable": false, "dataType": "CURRENCY", "actions": { "pricedetail": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/assets/02i1I00000058doQAA/pricing?accountId=0011I000007ms8TQAQ&priceDetailsFields=vlocity_cmt__OneTimeCharge__c&effectiveAssetsDateFilter=2020-04-05T07:00:00.000Z" }, "remote": { "params": { "effectiveAssetsDateFilter": "2020-04-05T07:00:00.000Z", "priceDetailsFields": "vlocity_cmt__OneTimeCharge__c", "priceDetail": true, "id": "02i1I00000058doQAA", "accountId": "0011I000007ms8TQAQ", "methodName": "getAssetPriceDetail" } }, "client": { "records": [], "params": {} } } } }, "vlocity_cmt__OneTimeCalculatedPrice__c": { "value": 100, "previousValue": null, "originalValue": null, "messages": [], "label": "One Time Calculated Price", "hidden": true, "fieldName": "vlocity_cmt__OneTimeCalculatedPrice__c", "editable": false, "dataType": "CURRENCY", "actions": { "pricedetail": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/assets/02i1I00000058doQAA/pricing?accountId=0011I000007ms8TQAQ&priceDetailsFields=vlocity_cmt__OneTimeCalculatedPrice__c&effectiveAssetsDateFilter=2020-04-05T07:00:00.000Z" }, "remote": { "params": { "effectiveAssetsDateFilter": "2020-04-05T07:00:00.000Z", "priceDetailsFields": "vlocity_cmt__OneTimeCalculatedPrice__c", "priceDetail": true, "id": "02i1I00000058doQAA", "accountId": "0011I000007ms8TQAQ", "methodName": "getAssetPriceDetail" } }, "client": { "records": [], "params": {} } } } }, "vlocity_cmt__OneTimeManualDiscount__c": { "value": 0, "previousValue": null, "originalValue": null, "messages": [], "label": "One Time Manual Discount", "hidden": true, "fieldName": "vlocity_cmt__OneTimeManualDiscount__c", "editable": false, "dataType": "PERCENT", "actions": {} }, "vlocity_cmt__RecurringCharge__c": { "value": 10, "previousValue": null, "originalValue": null, "messages": [], "label": "Recurring Charge", "hidden": true, "fieldName": "vlocity_cmt__RecurringCharge__c", "editable": false, "dataType": "CURRENCY", "actions": { "pricedetail": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/assets/02i1I00000058doQAA/pricing?accountId=0011I000007ms8TQAQ&priceDetailsFields=vlocity_cmt__RecurringCharge__c&effectiveAssetsDateFilter=2020-04-05T07:00:00.000Z" }, "remote": { "params": { "effectiveAssetsDateFilter": "2020-04-05T07:00:00.000Z", "priceDetailsFields": "vlocity_cmt__RecurringCharge__c", "priceDetail": true, "id": "02i1I00000058doQAA", "accountId": "0011I000007ms8TQAQ", "methodName": "getAssetPriceDetail" } }, "client": { "records": [], "params": {} } } } }, "vlocity_cmt__RecurringCalculatedPrice__c": { "value": 10, "previousValue": null, "originalValue": null, "messages": [], "label": "Recurring Calculated Price", "hidden": true, "fieldName": "vlocity_cmt__RecurringCalculatedPrice__c", "editable": false, "dataType": "CURRENCY", "actions": { "pricedetail": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/assets/02i1I00000058doQAA/pricing?accountId=0011I000007ms8TQAQ&priceDetailsFields=vlocity_cmt__RecurringCalculatedPrice__c&effectiveAssetsDateFilter=2020-04-05T07:00:00.000Z" }, "remote": { "params": { "effectiveAssetsDateFilter": "2020-04-05T07:00:00.000Z", "priceDetailsFields": "vlocity_cmt__RecurringCalculatedPrice__c", "priceDetail": true, "id": "02i1I00000058doQAA", "accountId": "0011I000007ms8TQAQ", "methodName": "getAssetPriceDetail" } }, "client": { "records": [], "params": {} } } } }, "vlocity_cmt__RecurringManualDiscount__c": { "value": 0, "previousValue": null, "originalValue": null, "messages": [], "label": "Recurring Manual Discount", "hidden": true, "fieldName": "vlocity_cmt__RecurringManualDiscount__c", "editable": false, "dataType": "PERCENT", "actions": {} }, "vlocity_cmt__ServiceAccountId__c": { "value": "0011I000007ms8TQAQ", "previousValue": null, "originalValue": null, "messages": [], "label": "Service Account", "hidden": false, "fieldName": "vlocity_cmt__ServiceAccountId__c", "editable": false, "dataType": "REFERENCE", "actions": {} }, "vlocity_cmt__BillingAccountId__c": { "value": "0011I000007ms8TQAQ", "previousValue": null, "originalValue": null, "messages": [], "label": "Billing Account", "hidden": false, "fieldName": "vlocity_cmt__BillingAccountId__c", "editable": false, "dataType": "REFERENCE", "actions": {} }, "vlocity_cmt__PricingLogData__c": { "value": "{\"LogData\":{\"OT_STD_PRC\":[{\"PriceListEntryId\":\"a2X1I0000009iFXUAY\",\"LogType\":\"PRICE\",\"PricingElementGlobalKey\":\"775e358f-31c4-e8de-e23d-e00bbbfedfa6\",\"StartValue\":100.00,\"SubType\":\"Standard\",\"Frequency\":null,\"ChargeTiming\":\"One-time\",\"EndValue\":100.00,\"DisplayText\":\"100$ OTSP\",\"PricingVariableCode\":\"OT_STD_PRC\",\"PricingElementId\":\"a2a1I000000Bar6QAC\",\"PromotionId\":null,\"OfferId\":null,\"PriceListId\":\"a2Y1I000000TlsrUAC\",\"BaseAdjustment\":null,\"BaseValue\":100.00,\"AdjustmentMethod\":null,\"AdjustmentValue\":0.00,\"Amount\":100.00,\"AdjustmentType\":\"None\",\"LogSequence\":0}],\"REC_MNTH_STD_PRC\":[{\"PriceListEntryId\":\"a2X1I0000009iFcUAI\",\"LogType\":\"PRICE\",\"PricingElementGlobalKey\":\"9ef41d53-1bba-017e-625a-b06ac2de2c28\",\"StartValue\":10.00,\"SubType\":\"Standard\",\"Frequency\":\"Monthly\",\"ChargeTiming\":\"Recurring\",\"EndValue\":10.00,\"DisplayText\":\"10$ RMSP\",\"PricingVariableCode\":\"REC_MNTH_STD_PRC\",\"PricingElementId\":\"a2a1I000000Bar1QAC\",\"PromotionId\":null,\"OfferId\":null,\"PriceListId\":\"a2Y1I000000TlsrUAC\",\"BaseAdjustment\":null,\"BaseValue\":10.00,\"AdjustmentMethod\":null,\"AdjustmentValue\":0.00,\"Amount\":10.00,\"AdjustmentType\":\"None\",\"LogSequence\":0}],\"OT_STD_PRC_CALC\":[{\"LogSequence\":0,\"DisplayText\":\"One Time Charge (100.00) - One Time Manual Discount (0.00%)\"}],\"OT_STD_PRC_TOTAL\":[{\"LogSequence\":0,\"DisplayText\":\"[One Time Calculated Price (100.00) + Rollup One Time Total (0.00)] x Quantity (1.00)\"}],\"REC_MNTH_STD_PRC_CALC\":[{\"LogSequence\":0,\"DisplayText\":\"Recurring Charge (10.00) - Recurring Manual Discount (0.00%)\"}],\"REC_MNTH_STD_PRC_TOTAL\":[{\"LogSequence\":0,\"DisplayText\":\"[Recurring Calculated Price (10.00) + Rollup Recurring Total (0.00)] x Quantity (1.00)\"}]},\"PricingVariableCodeFieldBinding\":{\"Quantity\":\"LINE_QUANTITY\",\"vlocity_cmt__EffectiveRecurringTotal__c\":\"EFF_REC_MNTH_STD_PRC_TOTAL\",\"vlocity_cmt__EffectiveOneTimeTotal__c\":\"EFF_OT_STD_PRC_TOTAL\",\"vlocity_cmt__OneTimeCalculatedPrice__c\":\"OT_STD_PRC_CALC\",\"vlocity_cmt__OneTimeManualDiscount__c\":\"OT_STD_PRC_DISC_PCT_MAN\",\"vlocity_cmt__OneTimeCharge__c\":\"OT_STD_PRC\",\"vlocity_cmt__RecurringTotal__c\":\"REC_MNTH_STD_PRC_TOTAL\",\"vlocity_cmt__RecurringCalculatedPrice__c\":\"REC_MNTH_STD_PRC_CALC\",\"vlocity_cmt__RecurringManualDiscount__c\":\"REC_MNTH_STD_PRC_DISC_PCT_MAN\",\"vlocity_cmt__RecurringCharge__c\":\"REC_MNTH_STD_PRC\",\"vlocity_cmt__OneTimeTotal__c\":\"OT_STD_PRC_TOTAL\",\"vlocity_cmt__EffectiveQuantity__c\":\"EFFECTIVE_QUANTITY\"},\"PriceAdjustmentPromoKeys\":[],\"PricingVariableCodeValues\":{\"LINE_QUANTITY\":1.00,\"OT_STD_PRC_DISC_PCT_MAN\":0.00,\"REC_MNTH_STD_PRC_DISC_PCT_MAN\":0.00,\"OT_STD_PRC\":100.00,\"OT_STD_PRC_CALC\":100.00,\"OT_STD_PRC_TOTAL\":100.00,\"REC_MNTH_STD_PRC\":10.00,\"REC_MNTH_STD_PRC_CALC\":10.00,\"REC_MNTH_STD_PRC_TOTAL\":10.00,\"ROLLUP_OT_STD_PRC_TOTAL\":0.00,\"ROLLUP_REC_MNTH_STD_PRC_TOTAL\":0.00,\"EFF_OT_STD_PRC_TOTAL\":100.00,\"EFF_REC_MNTH_STD_PRC_TOTAL\":10.00,\"EFFECTIVE_QUANTITY\":1.00},\"PricingVariableCodeBaseValues\":{\"OT_STD_PRC\":100.00,\"REC_MNTH_STD_PRC\":10.00},\"LogVersion\":\"1.0\",\"LastPricingTime\":\"2020-11-07T10:21:55.572Z\"}", "previousValue": null, "originalValue": null, "messages": [], "label": "Pricing Log", "hidden": true, "fieldName": "vlocity_cmt__PricingLogData__c", "editable": false, "dataType": "TEXTAREA", "actions": {} }, "vlocity_cmt__SequenceNumber__c": { "value": 1, "previousValue": null, "originalValue": null, "messages": [], "label": "Sequence Number", "hidden": true, "fieldName": "vlocity_cmt__SequenceNumber__c", "editable": false, "dataType": "DOUBLE", "actions": {} }, "vlocity_cmt__PricebookEntryId__c": { "value": "01u1I000000ZY4nQAG", "previousValue": null, "originalValue": null, "messages": [], "label": "PricebookEntryId", "hidden": true, "fieldName": "vlocity_cmt__PricebookEntryId__c", "editable": false, "dataType": "STRING", "actions": {} }, "vlocity_cmt__EffectiveQuantity__c": { "value": 1, "previousValue": null, "originalValue": null, "messages": [], "label": "Effective Quantity", "hidden": true, "fieldName": "vlocity_cmt__EffectiveQuantity__c", "editable": false, "dataType": "DOUBLE", "actions": {} }, "vlocity_cmt__EffectiveRecurringTotal__c": { "value": 10, "previousValue": null, "originalValue": null, "messages": [], "label": "Effective Recurring Total", "hidden": true, "fieldName": "vlocity_cmt__EffectiveRecurringTotal__c", "editable": false, "dataType": "CURRENCY", "actions": {} }, "vlocity_cmt__EffectiveOneTimeTotal__c": { "value": 100, "previousValue": null, "originalValue": null, "messages": [], "label": "Effective One Time Total", "hidden": true, "fieldName": "vlocity_cmt__EffectiveOneTimeTotal__c", "editable": false, "dataType": "CURRENCY", "actions": {} }, "Name": "TestA", "promotions": { "totalSize": 0, "messages": [] } } ] } ``` # Get Available Sites Get the available records for the billing account or service account lookup field. ```nolang GET /v2/cpq/carts/{cart_ID}/sites?id={item_ID},lookupField={field_name},fields={field names to return} ``` ## Remote Method ```nolang getAvailableSites ``` ## REST Handler ```nolang APISitesCartsCpqV2 ``` ## Apex Remote Service ```nolang CpqAppHandler ``` ## Apex Remote Input Map ```nolang { "methodName": "priceCart", "cartId": "801360000008eNU", "id":"01t36000000pfcKAAQ" "lookupField": "vlocity_cmt__BillingAccountId__c" } ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Example Request ```nolang GET /services/apexrest/vlocity_cmt/v2/cpq/carts/8014100000009fU/sites ``` ## Example Result ```nolang { "totalSize" => 2, "messages" => [], "actions" => { "newsite" => { "rest" => { "params" => { "fields" => "'Id'", "inputFields" => "[{\"value\":null,\"previousValue\":null,\"originalValue\":null,\"messages\":[],\"label\":\"Account Name\",\"hidden\":null,\"fieldName\":\"name\",\"editable\":true,\"dataType\":\"STRING\",\"actions\":{}}]", "objectType" => "Account" }, "method" => "POST", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwG8QAI/sites" }, "remote" => { "params" => { "fields" => "'Id'", " inputFields" => "[{\"value\":null,\"previousValue\":null,\"originalValue\":null,\"messages\":[],\"label\":\"Account Name\",\"hidden\":null,\"fieldName\":\"name\",\"editable\":true,\"dataType\":\"STRING\",\"actions\":{}}]", "objectType" => "Account", "cartId" => "8016A000000bwG8QAI", "methodName" => "newSite" } }, "client" => { "params" => {} } } }, "records" => [{ "messages" => [], "displaySequence" => -1, "Id" => "0016A000006baXeQAI", "Name" => "SFA1" }, { "messages" => [], "displaySequence" => -1, "Id" => "0016A000006bNfzQAE", "Name" => "SA" } ] } ``` # Get Basket Details API This API retrieves details about a basket. This API supports the **isloggedin** flag to indicate whether a user is logged in or anonymous. If the **isloggedin** flag is true, it indicates a logged-in user, and an accountId must be specified in the context parameter of the API call. If the **isloggedin** flag is false, it indicates that the user is anonymous. If the isloggedin flag is not specified or if the isloggedin flag is set to false then Context dimension values should be specified in the following format: dimension1:val1,dimension2:val2. The key-value pairs specify Context Dimension values that describe the context to be used in rule processing. If a value for a context dimension defined in the Product Catalog is not provided, the default value specified on the Context Dimension is used to determine eligibility and pricing. If isloggedin=true is specified, you must also specify one of the following: accountId, contractId , or rootAssetIds. The Fall '20 release includes an Attribute Basket Cache feature. See [Attribute Basket Cache Exclusion](/docs/commerce/commerce/guide/comms-t-attribute-basket-cache-exclusion.html). ## Rules Supported This API does not run any rules. ## Prerequisites - Products must have ProductCode populated (no spaces are allowed in ProductCode). - Promotions must have Code**c populated (no spaces are allowed in Code**c). - A catalog must be present with products and promotions attached to it as records under the CatalogProductRelationship**c object. The catalog should have CatalogCode**c populated (no spaces are allowed in CatalogCode\_\_c). - The catalog must be attached to a default price list through the DefaultPriceList**c field on the Catalog**c object. - Price list entries must exist for all the products that are attached to the catalog. - Optional: To populate the cache, the following batch jobs may be run: - Context combinations - Offer details - Pricing results - Create a custom setting called [CacheAPIFields](https://help.salesforce.com/s/articleView?id=ind.comms_t_cpq_configuration_settings_reference_148927.htm) with a value of true. CacheAPIFields is not required for CME 103.1.14 and later versions. ## Parameters and Response Information For API parameter names, descriptions, and response information, see [Digital Commerce REST API](https://developer.salesforce.com/docs/industries/cme/references/dc-rest1?meta=Summary). ## Get Basket Details for an Anonymous User Retrieves details about a basket. ```nolang GET /v3/catalogs/{catalog_code}/basket/{basket_key} ``` ```nolang GET /services/apexrest/vlocity_cmt/v3/catalogs/Mobile/basket/bdbe113c6fd2d90835372d104f7a4a8b ``` ## Get Basket Details for a Known User After one or more items have been added to a basket, you can view the basket contents for a known user using a format similar to the following: ```nolang GET /v3/catalogs/{catalog_code}/basket/{cart_context_key}?context="accountId":"{account_id}"&isloggedin=true ``` ```nolang GET /services/apexrest/vlocity_cmt/v3/catalogs/TEST/basket/bdbe113c6fd2d90835372d104f7a4a8b?context={"accountId":"xxxxxxxxxxxxxx"}&isloggedin=true ``` # Get Cart Items Return cart items and their configurable attributes based on specified criteria. - Item name, description, and price - Configurable attributes for the item - Links to further actions - Messages per item - [Whether to expand all the child items in the bundle](https://help.salesforce.com/s/articleView?id=ind.comms_configuring_cart_item_refresh_levels.htm) ```nolang GET /v2/cpq/carts/{cart_ID}/items?query={query}&lastRecordId=(n)&pagesize={n}&filters={filter}&fields={field1,field2}&validate={true/false}&price={true/false} ``` **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. - Customers can search for specific products even with over 10,000 `PriceListEntry` records if the these conditions are met. - The product must be orderable. - Filter parameters should not contain underscores. - Only Product2-related fields can be queried or filtered. Fieldset as a parameter for this API is not supported. If the fieldset parameter is passed, a runtime error occurs. This API can be called either through REST or through Apex remote calls. The default value for the `price` parameter is `true`. If `price=false` is not specified, pricing is executed by default. Specify `price=false` if you do not want to execute pricing. In ​Salesforce Industries Communications, Media, and Energy Fall '20 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. ## Get Cart Items Trim Mode Trim Mode is an optimization feature that reduces the payload size of the GetCartItems API response. Instead of returning the full set of cart item fields, Trim Mode restricts the response to only what is explicitly required. When enabled, the API response includes these: - A fixed set of 22 default fields (identity, hierarchy, and status) - Fields specified via the fields query parameter - Fields defined in the `GCITrimFieldsToInclude` field set in Salesforce All other fields are removed from the response. Structural nodes such as `PricebookEntry`, `Product2`, and `productChildItemDefinition` are always preserved. **important:** Trim Mode applies only to: - getCartItemList - getCartItemListById See, [Enabling Trim Mode](#enabling-trim-mode). ## Remote Method ```nolang getCartsItems ``` ## REST Handler ```nolang APIItemsCartsCpqV2 ``` ## Apex Remote Service ```nolang CpqAppHandler ``` ## Apex Remote Input Map ```nolang { methodName: getCartsItems, cartId: 801360000008 eNU, query: "iphone", lastItemId: "01t36000000pfcKAAQ", pagesize: 20, includeAttachment: false, fields: fields = Quantity, vlocity_cmt__RecurringCharge__c, vlocity_cmt__OneTimeTotal__c, vlocity_cmt__BillingAccountId__r.Name, vlocity_cmt__ServiceAccountId__r.Name, vlocity_cmt__PremisesId__r.Name filter: vlocity_cmt__ServiceAccountId__c: 991360000008 eNU_991360000008eNY, vlocity_cmt__BillingAccount__c: 01 t36000000pfcKAAQ_01t36000000pfcKAAQ } cartId = order.Id, opportunity.Id, quote.Id ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | Resource URL | `/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/items?query={query}&lastRecordId=(n)&pagesize={n}&filters={filter}&fields={field1,field2}&validate={true/false}&price={true/false}` | ## Example Request ```nolang GET /services/apexrest/vlocity_cmt/v2/cpq/carts/80141000000Cg8H/items?pagesize=5 ``` ## Example Response ```nolang { "totalSize": 1, "messages": [], "records": [{ "messages": [], "actions": { "addtocart": { "rest": { "params": { "includeAttachment": false, "pagesize": 5, "lastRecordId": null, "query": null, "items": [{ "parentId": "80241000000HalcAAC", "quantity": 1, "itemId": "01u41000001QPtsAAG" }] }, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80141000000Cg8HAAS/items" }, "remote": { "params": { "price": true, "validate": true, "includeAttachment": false, "pagesize": 5, "lastRecordId": null, "query": null, "items": [{ "parentId": "80241000000HalcAAC", "quantity": 1, "itemId": "01u41000001QPtsAAG" }], "cartId": "80141000000Cg8HAAS", "methodName": "postCartsItems" } }, "client": { "params": {} } }, "updateitems": { "rest": { "params": { "fields": null, "price": true, "validate": true, "filters": null, "includeAttachment": false, "pagesize": 5, "lastRecordId": null, "query": null, "items": [{ "itemId": "80241000000HalcAAC" }] }, "method": "PUT", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80141000000Cg8HAAS/items" }, "remote": { "params": { "fields": null, "price": true, "validate": true, "filters": null, "includeAttachment": false, "pagesize": 5, "lastRecordId": null, "query": null, "items": [{ "itemId": "80241000000HalcAAC" }], "cartId": "80141000000Cg8HAAS", "methodName": "putCartsItems" } }, "client": { "params": {} } }, "deleteitem": { "rest": { "params": {}, "method": "DELETE", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80141000000Cg8HAAS/items/80241000000HalcAAC?pagesize=5&includeAttachment=false&validate=true&price=true" }, "remote": { "params": { "price": true, "validate": true, "filters": null, "includeAttachment": false, "pagesize": 5, "lastRecordId": null, "query": null, "id": "80241000000HalcAAC", "cartId": "80141000000Cg8HAAS", "methodName": "deleteCartsItems" } }, "client": { "params": {} } }, "cloneitem": { "rest": { "params": { "items": [{ "itemId": "80241000000HalcAAC" }] }, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80141000000Cg8HAAS/items/clone" }, "remote": { "params": { "id": "80241000000HalcAAC", "cartId": "80141000000Cg8HAAS", "methodName": "cloneItems" } }, "client": { "params": {} } }, "modifyattributes": { "rest": { "params": { "fields": null, "items": [{ "itemId": "80241000000HalcAAC" }] }, "method": "PUT", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80141000000Cg8HAAS/items/80241000000HalcAAC/itemattributes" }, "remote": { "params": { "fields": null, "items": [{ "itemId": "80241000000HalcAAC" }], "itemId": "80241000000HalcAAC", "cartId": "80141000000Cg8HAAS", "methodName": "putItemAttributes" } }, "client": { "params": {} } } }, "displaySequence": -1, "Id": { "value": "80241000000HalcAAC", "messages": [], "label": "Order Product ID", "hidden": false, "fieldName": "Id", "editable": false, "dataType": "ID", "actions": {} }, "Pricebook2Id": "01s41000005dPYQAA2", "Product2Id": "01t41000000sYaSAAU", "UnitPrice": { "value": 1.00, "messages": [], "label": "Unit Price", "hidden": false, "fieldName": "UnitPrice", "editable": true, "dataType": "CURRENCY", "actions": {} }, "Name": "GC 2", "IsActive": true, "Product2": { "attributes": { "type": "Product2", "url": "/services/data/v38.0/sobjects/Product2/01t41000000sYaSAAU" }, "Id": "01t41000000sYaSAAU", "Name": "GC 2", "vlocity_cmt__IsConfigurable__c": false, "vlocity_cmt__Type__c": "None", "vlocity_cmt__SubType__c": "None", "RecordTypeId": "012410000006OWUAA2", "vlocity_cmt__JSONAttribute__c": null }, "productId": "01t41000000sYaSAAU", "defaultQuantity": 1.0, "minQuantity": 0.0, "maxQuantity": 99999.0, "groupMinQuantity": 0, "groupMaxQuantity": 99999, "sequenceNumber": 1.00, "productChildItemDefinition": { "attributes": { "type": "vlocity_cmt__ProductChildItem__c", "url": "/services/data/v38.0/sobjects/vlocity_cmt__ProductChildItem__c/a2541000000G0AGAA0" }, "Id": "a2541000000G0AGAA0", "Name": "Root PCI", "vlocity_cmt__IsVirtualItem__c": false, "vlocity_cmt__Quantity__c": 1, "vlocity_cmt__MaxQuantity__c": 99999, "vlocity_cmt__MinQuantity__c": 0, "vlocity_cmt__MaximumChildItemQuantity__c": 99999, "vlocity_cmt__MinimumChildItemQuantity__c": 0, "vlocity_cmt__IsOverride__c": false, "vlocity_cmt__ParentProductId__c": "01t41000000sYaSAAU", "vlocity_cmt__ChildLineNumber__c": "1", "vlocity_cmt__SeqNumber__c": 1.00, "vlocity_cmt__CollapseHierarchy__c": false, "vlocity_cmt__IsRootProductChildItem__c": true, "vlocity_cmt__ParentProductId__r": { "attributes": { "type": "Product2", "url": "/services/data/v38.0/sobjects/Product2/01t41000000sYaSAAU" }, "Id": "01t41000000sYaSAAU", "Name": "GC 2" } }, "productHierarchyPath":"01t41000000sYaSAAU", "name": "GC 2", "isVirtualItem": false, "itemType": "lineItem", "PricebookEntryId": { "value": "01u41000001QPtsAAG", "messages": [], "label": "Price Book Entry ID", "hidden": false, "fieldName": "PricebookEntryId", "editable": false, "dataType": "REFERENCE", "actions": {} }, "Quantity": { "value": 1.00, "messages": [], "label": "Quantity", "hidden": false, "fieldName": "Quantity", "editable": true, "dataType": "DOUBLE", "actions": {} }, "vlocity_cmt__OneTimeTotal__c": { "value": 1.00, "messages": [], "label": "One Time Total", "hidden": false, "fieldName": "vlocity_cmt__OneTimeTotal__c", "editable": false, "dataType": "CURRENCY", "actions": {} }, "vlocity_cmt__RecurringTotal__c": { "value": 0.00, "messages": [], "label": "Recurring Total", "hidden": false, "fieldName": "vlocity_cmt__RecurringTotal__c", "editable": false, "dataType": "CURRENCY", "actions": {} }, "vlocity_cmt__ProvisioningStatus__c": { "value": "New", "messages": [], "label": "Provisioning Status", "hidden": false, "fieldName": "vlocity_cmt__ProvisioningStatus__c", "editable": false, "dataType": "STRING", "actions": {} }, "vlocity_cmt__BillingAccountId__c": "00141000007uyWYAAY", "vlocity_cmt__ServiceAccountId__c": "00141000007uyWYAAY", "vlocity_cmt__ProductHierarchyPath__c": { "value": "01t41000000sYaSAAU", "messages": [], "label": "Product Hierarchy Path", "hidden": false, "fieldName": "vlocity_cmt__ProductHierarchyPath__c", "editable": true, "dataType": "STRING", "actions": {} }, "vlocity_cmt__LineNumber__c": { "value": "0001", "messages": [], "label": "LineNumber", "hidden": true, "fieldName": "vlocity_cmt__LineNumber__c", "editable": true, "dataType": "STRING", "actions": {} }, "vlocity_cmt__RootItemId__c": { "value": "80241000000HalcAAC", "messages": [], "label": "RootItemId", "hidden": true, "fieldName": "vlocity_cmt__RootItemId__c", "editable": true, "dataType": "STRING", "actions": {} }, "ListPrice": { "value": 1.00, "messages": [], "label": "List Price", "hidden": false, "fieldName": "ListPrice", "editable": false, "dataType": "CURRENCY", "actions": {} }, "vlocity_cmt__OneTimeCharge__c": { "value": 1.00, "messages": [], "label": "One Time Charge", "hidden": false, "fieldName": "vlocity_cmt__OneTimeCharge__c", "editable": false, "dataType": "CURRENCY", "actions": {} }, "vlocity_cmt__OneTimeCalculatedPrice__c": { "value": 1.00, "messages": [], "label": "One Time Calculated Price", "hidden": false, "fieldName": "vlocity_cmt__OneTimeCalculatedPrice__c", "editable": true, "dataType": "CURRENCY", "actions": {} }, "vlocity_cmt__OneTimeManualDiscount__c": { "value": 0.00, "messages": [], "label": "One Time Manual Discount", "hidden": false, "fieldName": "vlocity_cmt__OneTimeManualDiscount__c", "editable": true, "dataType": "PERCENT", "actions": {} }, "vlocity_cmt__RecurringCharge__c": { "value": 0.00, "messages": [], "label": "Recurring Charge", "hidden": false, "fieldName": "vlocity_cmt__RecurringCharge__c", "editable": false, "dataType": "CURRENCY", "actions": {} }, "vlocity_cmt__RecurringCalculatedPrice__c": { "value": 0.00, "messages": [], "label": "Recurring Calculated Price", "hidden": false, "fieldName": "vlocity_cmt__RecurringCalculatedPrice__c", "editable": true, "dataType": "CURRENCY", "actions": {} }, "vlocity_cmt__RecurringManualDiscount__c": { "value": 0.00, "messages": [], "label": "Recurring Manual Discount", "hidden": false, "fieldName": "vlocity_cmt__RecurringManualDiscount__c", "editable": true, "dataType": "PERCENT", "actions": {} }, "PricebookEntry": { "attributes": { "type": "PricebookEntry", "url": "/services/data/v38.0/sobjects/PricebookEntry/01u41000001QPtsAAG" }, "Id": "01u41000001QPtsAAG", "Product2Id": "01t41000000sYaSAAU", "Pricebook2Id": "01s41000005dPYQAA2", "Product2": { "attributes": { "type": "Product2", "url": "/services/data/v38.0/sobjects/Product2/01t41000000sYaSAAU" }, "Id": "01t41000000sYaSAAU", "Name": "GC 2", "vlocity_cmt__Type__c": "None", "vlocity_cmt__IsConfigurable__c": false } }, "vlocity_cmt__ServiceAccountId__r": { "attributes": { "type": "Account", "url": "/services/data/v38.0/sobjects/Account/00141000007uyWYAAY" }, "Id": "00141000007uyWYAAY", "Name": "Telco test" }, "vlocity_cmt__BillingAccountId__r": { "attributes": { "type": "Account", "url": "/services/data/v38.0/sobjects/Account/00141000007uyWYAAY" }, "Id": "00141000007uyWYAAY", "Name": "Telco test" }, "vlocity_cmt__InCartQuantityMap__c": { "value": null, "messages": [], "label": "InCartQuantityMap", "hidden": false, "fieldName": "vlocity_cmt__InCartQuantityMap__c", "editable": true, "dataType": "TEXTAREA", "actions": {} }, "vlocity_cmt__JSONAttribute__c": { "value": null, "messages": [], "label": "JSONAttribute", "hidden": false, "fieldName": "vlocity_cmt__JSONAttribute__c", "editable": true, "dataType": "TEXTAREA", "actions": {} }, "vlocity_cmt__ParentItemId__c": { "value": null, "messages": [], "label": "ParentItemId", "hidden": true, "fieldName": "vlocity_cmt__ParentItemId__c", "editable": true, "dataType": "STRING", "actions": {} }, "vlocity_cmt__RecurringDiscountPrice__c": { "value": null, "messages": [], "label": "Recurring Discount Price", "hidden": false, "fieldName": "vlocity_cmt__RecurringDiscountPrice__c", "editable": false, "dataType": "CURRENCY", "actions": {} } }] } ``` **See Also** - [Configure OmniScript for Guided Selling](https://help.salesforce.com/s/articleView?id=ind.comms_configure_omniscript_for_guided_selling.htm) ## Enabling Trim Mode **Option 1: Per-Request (Recommended for Controlled Adoption)** Enable Trim Mode for specific API calls using a query parameter: `/services/apexrest/vlocity_cmt/v2/cpq/carts/{cartId}/items?gciTrimMode=true` `/services/apexrest/vlocity_cmt/v2/cpq/carts/{cartId}/items?gciTrimMode=true&fields=UnitPrice,vlocity_cmt\_\_OneTimeCost\_\_c` Use this approach for: - Targeted integrations - Specific UI components - Testing and gradual rollout **Option 2: Org-Wide Configuration** Enable Trim Mode globally via CPQ configuration: - Set `gciTrimMode = true` in CPQ Configuration Setup. This applies to all GetCartItems API calls across the organization. - Configure field set: - Product2.Name - UnitPrice - TotalPrice - Description All responses include default fields, field set fields, and additional fields via fields parameter (if provided). **important:** - Trim Mode removes fields from the API response. Any code, UI, or integration that depends on those fields will break unless the fields are explicitly requested. - Out-of-the-box CPQ UI components and standard integrations expect the complete set of response fields. Enabling `GCITrimMode` at the org level can cause these components and integrations to fail unless all required fields are explicitly included using the `fields` request parameter or the `GCITrimFieldsToInclude` field set. ### Precedence Rules | API Parameter | Config Setting | Result | | ------------- | -------------- | -------- | | TRUE | any | Trim ON | | FALSE | any | Trim OFF | | not provided | TRUE | Trim ON | | not provided | false / unset | Trim OFF | The API parameter always takes precedence. Use `gciTrimMode = false` to override org-wide settings per request. ### Default Fields (Always Included) These 22 fields are always present when trim mode is on, without needing to request them: Id, RootItemId, ParentItemId, AssetReferenceId, LineNumber, Product2Id, PricebookEntryId, OrderId, QuoteId, OpportunityId, Quantity, Status, Action, IsRootItem, ProductHierarchyPath, ProductHierarchyGroupKeyPath, BillingAccountId, ServiceAccountId, InCartQuantityMap, CpqMessageData, CpqCardinalityMessage, CpqPricingMessage ## Usage Examples ### Minimal Cart (Mobile Optimization) `/services/apexrest/vlocity_cmt/v2/cpq/carts/{cartId}/items?gciTrimMode=true&fields=Product2.Name,TotalPrice` Returns a lightweight payload (~24 fields vs 150+). ### Cost Analysis Dashboard `/services/apexrest/vlocity_cmt/v2/cpq/carts/{cartId}/items?gciTrimMode=true&fields=UnitPrice,vlocity_cmt__OneTimeCost__c,vlocity_cmt__RecurringCost__c,vlocity_cmt__OneTimeMargin__c` ### Override Org-Wide Trim Mode `/services/apexrest/vlocity_cmt/v2/cpq/carts/{cartId}/items?gciTrimMode=false` Returns full response regardless of org settings. # Get Cart Items Return cart items and their configurable attributes based on specified criteria. - Item name, description, and price - Configurable attributes for the item - Links to further actions - Messages per item - [Whether to expand all the child items in the bundle](https://help.salesforce.com/s/articleView?id=ind.comms_configuring_cart_item_refresh_levels.htm) ```nolang GET /v2/cpq/carts/{cart_ID}/items?query={query}&lastRecordId=(n)&pagesize={n}&filters={filter}&fields={field1,field2}&validate={true/false}&price={true/false} ``` Fieldset as a parameter for this API is not supported. If the fieldset parameter is passed, a runtime error occurs. This API can be called either through REST or through Apex remote calls. The default value for the `price` parameter is `true`. If `price=false` is not specified, pricing is executed by default. Specify `price=false` if you do not want to execute pricing. In ​Salesforce Industries Communications, Media, and Energy Fall '20 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. ## Get Cart Items Trim Mode Trim Mode is an optimization feature that reduces the payload size of the GetCartItems API response. Instead of returning the full set of cart item fields, Trim Mode restricts the response to only what is explicitly required. When enabled, the API response includes these: - A fixed set of 22 default fields (identity, hierarchy, and status) - Fields specified via the fields query parameter - Fields defined in the `GCITrimFieldsToInclude` field set in Salesforce All other fields are removed from the response. Structural nodes such as `PricebookEntry`, `Product2`, and `productChildItemDefinition` are always preserved. **important:** Trim Mode applies only to: - getCartItemList - getCartItemListById See, [Enabling Trim Mode](#enabling-trim-mode). ## Remote Method ```nolang getCartsItems ``` ## REST Handler ```nolang APIItemsCartsCpqV2 ``` ## Apex Remote Service ```nolang CpqAppHandler ``` ## Apex Remote Input Map ```nolang { methodName: getCartsItems, cartId: 801360000008 eNU, query: "iphone", lastItemId: "01t36000000pfcKAAQ", pagesize: 20, includeAttachment: false, fields: fields = Quantity, vlocity_cmt__RecurringCharge__c, vlocity_cmt__OneTimeTotal__c, vlocity_cmt__BillingAccountId__r.Name, vlocity_cmt__ServiceAccountId__r.Name, vlocity_cmt__PremisesId__r.Name filter: vlocity_cmt__ServiceAccountId__c: 991360000008 eNU_991360000008eNY, vlocity_cmt__BillingAccount__c: 01 t36000000pfcKAAQ_01t36000000pfcKAAQ } cartId = order.Id, opportunity.Id, quote.Id ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | Resource URL | `/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/items?query={query}&lastRecordId=(n)&pagesize={n}&filters={filter}&fields={field1,field2}&validate={true/false}&price={true/false}` | ## Example Request ```nolang GET /services/apexrest/vlocity_cmt/v2/cpq/carts/80141000000Cg8H/items?pagesize=5 ``` ## Example Response ```nolang { "totalSize": 1, "messages": [], "actions": { "itempricesupdated": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/801xx000003H0UlAAK/price?price=false&cartId=801xx000003H0UlAAK" }, "remote": { "params": {} }, "client": { "params": {} } } }, "records": [ { "messages": [], "actions": { "addtocart": { "rest": { "params": { "validate": true, "items": [ { "quantity": 1, "itemId": "01uxx0000009Ua7AAE" } ], "pagesize": 20, "cartId": "801xx000003H0UlAAK", "hierarchy": -1, "query": null, "price": true, "includeAttachment": true, "lastRecordId": null }, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/801xx000003H0UlAAK/items" }, "remote": { "params": {} }, "client": { "params": {} } }, "cloneitem": { "rest": { "params": { "items": [ { "itemId": "802xx000001o0B1AAI" } ], "id": "802xx000001o0B1AAI", "cartId": "801xx000003H0UlAAK" }, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/801xx000003H0UlAAK/items/clone" }, "remote": { "params": {} }, "client": { "params": {} } }, "updateitems": { "rest": { "params": { "validate": true, "items": [ { "itemId": "802xx000001o0B1AAI" } ], "fields": null, "filters": null, "pagesize": 20, "cartId": "801xx000003H0UlAAK", "hierarchy": -1, "query": null, "price": true, "includeAttachment": true, "lastRecordId": null }, "method": "PUT", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/801xx000003H0UlAAK/items" }, "remote": { "params": {} }, "client": { "params": {} } }, "modifyattributes": { "rest": { "params": { "items": [ { "itemId": "802xx000001o0B1AAI" } ], "filters": null, "id": "802xx000001o0B1AAI", "cartId": "801xx000003H0UlAAK", "itemId": "802xx000001o0B1AAI" }, "method": "PUT", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/801xx000003H0UlAAK/items/802xx000001o0B1AAI/itemAttributes" }, "remote": { "params": {} }, "client": { "params": {} } }, "deleteitem": { "rest": { "params": {}, "method": "DELETE", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/801xx000003H0UlAAK/items/802xx000001o0B1AAI?includeAttachment=true&price=true&hierarchy=-1&cartId=801xx000003H0UlAAK&pagesize=20&id=802xx000001o0B1AAI&validate=true" }, "remote": { "params": {} }, "client": { "params": {} } }, "configdelete": { "rest": { "params": { "id": "802xx000001o0B1AAI", "cartId": "801xx000003H0UlAAK" }, "method": null, "link": null }, "remote": { "params": {} }, "client": { "params": {} } } }, "displaySequence": -1, "productChildItemDefinition": { "vlocity_cmt__ParentProductId__c": "01txx0000007CBoAAM", "Name": "Root PCI", "vlocity_cmt__ParentProductId__r": { "vlocity_cmt__ProductSpecId__c": null, "Id": "01txx0000007CBoAAM", "Name": "Iphone16", "vlocity_cmt__GlobalGroupKey__c": "f3b86b92-81ce-2541-07e5-83b46d640d71" }, "vlocity_cmt__MinQuantity__c": 0, "vlocity_cmt__MaxQuantity__c": 99999, "vlocity_cmt__MinimumChildItemQuantity__c": 0, "vlocity_cmt__MaximumChildItemQuantity__c": 99999, "vlocity_cmt__Quantity__c": 1, "vlocity_cmt__SeqNumber__c": 1, "vlocity_cmt__ChildLineNumber__c": "1.0", "vlocity_cmt__IsRootProductChildItem__c": true, "vlocity_cmt__IsOverride__c": false, "Id": "a3Pxx0000004ni4EAA", "vlocity_cmt__CollapseHierarchy__c": false, "vlocity_cmt__IsVirtualItem__c": false }, "isVirtualItem": false, "sequenceNumber": 1, "groupMinQuantity": 0, "productId": "01txx0000007CBoAAM", "Product2": { "ProductCode": "Iphone16", "vlocity_cmt__ProductSpecId__r": null, "Id": "01txx0000007CBoAAM", "vlocity_cmt__IsOrderable__c": true, "Description": "Iphone16", "IsActive": true, "vlocity_cmt__Type__c": "None", "vlocity_cmt__LifecycleStatus__c": "Draft", "vlocity_cmt__SubType__c": "None", "Name": "Iphone16", "vlocity_cmt__IsConfigurable__c": false, "vlocity_cmt__GlobalGroupKey__c": "f3b86b92-81ce-2541-07e5-83b46d640d71", "vlocity_cmt__AttributeDefaultValues__c": null, "vlocity_cmt__SpecificationType__c": "Product" }, "maxQuantity": 99999, "ProductCode": "Iphone16", "IsActive": true, "hasChildren": false, "defaultQuantity": 1, "groupMaxQuantity": 99999, "PricebookEntry": { "Product2": { "vlocity_cmt__SpecificationType__c": "Product", "vlocity_cmt__AttributeDefaultValues__c": null, "vlocity_cmt__GlobalGroupKey__c": "f3b86b92-81ce-2541-07e5-83b46d640d71", "vlocity_cmt__IsConfigurable__c": false, "Name": "Iphone16", "vlocity_cmt__SubType__c": "None", "vlocity_cmt__LifecycleStatus__c": "Draft", "vlocity_cmt__Type__c": "None", "IsActive": true, "vlocity_cmt__IsOrderable__c": true, "Id": "01txx0000007CBoAAM", "vlocity_cmt__ProductSpecId__r": null, "ProductCode": "Iphone16" }, "Pricebook2Id": "01sxx0000005qRhAAI", "Product2Id": "01txx0000007CBoAAM", "Id": "01uxx0000009Ua7AAE" }, "Name": "Iphone16", "UnitPrice": { "value": 0, "previousValue": null, "originalValue": null, "messages": [], "label": "Unit Price", "hidden": true, "fieldName": "UnitPrice", "editable": false, "dataType": "CURRENCY", "alternateValues": null, "actions": {} }, "Product2Id": "01txx0000007CBoAAM", "productChildItemId": "a3Pxx0000004ni4EAA", "minQuantity": 0, "name": "Iphone16", "Pricebook2Id": "01sxx0000005qRhAAI", "action": "Add", "productHierarchyPath": "01txx0000007CBoAAM", "vlocity_cmt__RecurringPrice__c": 50, "orderActive": false, "itemType": "lineItem", "SellingPeriod": "Present", "vlocity_cmt__ProductGroupKey__c": { "value": "f3b86b92-81ce-2541-07e5-83b46d640d71", "previousValue": null, "originalValue": null, "messages": [], "label": "Product Group Key", "hidden": false, "fieldName": "vlocity_cmt__ProductGroupKey__c", "editable": false, "dataType": "STRING", "alternateValues": null, "actions": { } }, "vlocity_cmt__RecurringDiscountPrice__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Recurring Discount Price", "hidden": true, "fieldName": "vlocity_cmt__RecurringDiscountPrice__c", "editable": false, "dataType": "CURRENCY", "alternateValues": null, "actions": {} }, "vlocity_cmt__ParentItemId__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Parent Item ID", "hidden": true, "fieldName": "vlocity_cmt__ParentItemId__c", "editable": false, "dataType": "STRING", "alternateValues": null, "actions": {} }, "vlocity_cmt__ItemName__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Item Name", "hidden": false, "fieldName": "vlocity_cmt__ItemName__c", "editable": true, "dataType": "STRING", "alternateValues": null, "actions": {} }, "vlocity_cmt__EffectiveOneTimeTotal__c": { "value": 100, "previousValue": null, "originalValue": null, "messages": [], "label": "Effective One Time Total", "hidden": false, "fieldName": "vlocity_cmt__EffectiveOneTimeTotal__c", "editable": true, "dataType": "CURRENCY", "alternateValues": null, "actions": { "adjustmentcodes": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/listsofvalues?cartId=801xx000003H0UlAAK&listkeys=AdjustmentCodes&id=802xx000001o0B1AAI&fields=vlocity_cmt__EffectiveOneTimeTotal__c&PricingVariableCode=EFF_OT_STD_PRC_TOTAL" }, "remote": { "params": {} }, "client": { "records": [], "params": {} } }, "pricedetail": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/801xx000003H0UlAAK/items/802xx000001o0B1AAI/pricing?cartId=801xx000003H0UlAAK&id=802xx000001o0B1AAI&fields=vlocity_cmt__EffectiveOneTimeTotal__c" }, "remote": { "params": {} }, "client": { "records": [], "params": {} } } } }, "vlocity_cmt__EffectiveRecurringTotal__c": { "value": 50, "previousValue": null, "originalValue": null, "messages": [], "label": "Effective Recurring Total", "hidden": false, "fieldName": "vlocity_cmt__EffectiveRecurringTotal__c", "editable": true, "dataType": "CURRENCY", "alternateValues": null, "actions": { "adjustmentcodes": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/listsofvalues?cartId=801xx000003H0UlAAK&listkeys=AdjustmentCodes&id=802xx000001o0B1AAI&fields=vlocity_cmt__EffectiveRecurringTotal__c&PricingVariableCode=EFF_REC_MNTH_STD_PRC_TOTAL" }, "remote": { "params": {} }, "client": { "records": [], "params": {} } }, "pricedetail": { "rest": { "params": { }, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/801xx000003H0UlAAK/items/802xx000001o0B1AAI/pricing?cartId=801xx000003H0UlAAK&id=802xx000001o0B1AAI&fields=vlocity_cmt__EffectiveRecurringTotal__c" }, "remote": { "params": {} }, "client": { "records": [], "params": {} } } } }, "vlocity_cmt__CatalogItemReferenceDateTime__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Reference Time", "hidden": false, "fieldName": "vlocity_cmt__CatalogItemReferenceDateTime__c", "editable": true, "dataType": "DATETIME", "alternateValues": null, "actions": {} }, "ListPrice": { "value": 0, "previousValue": null, "originalValue": null, "messages": [], "label": "List Price", "hidden": true, "fieldName": "ListPrice", "editable": false, "dataType": "CURRENCY", "alternateValues": null, "actions": {} }, "vlocity_cmt__CpqCardinalityMessage__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Cpq Cardinality Message", "hidden": false, "fieldName": "vlocity_cmt__CpqCardinalityMessage__c", "editable": true, "dataType": "TEXTAREA", "alternateValues": null, "actions": {} }, "vlocity_cmt__RecurringManualDiscount__c": { "value": 0, "previousValue": null, "originalValue": null, "messages": [], "label": "Recurring Manual Discount", "hidden": false, "fieldName": "vlocity_cmt__RecurringManualDiscount__c", "editable": true, "dataType": "PERCENT", "alternateValues": null, "actions": { "applyadjustment": { "rest": { "params": { "adjustments": [ { "AdjustmentValue": 0, "PricingVariableCode": "REC_MNTH_STD_PRC_DISC_PCT_MAN", "AdjustmentMethod": "Percent", "AdjustmentCode": "", "DetailType": "ADJUSTMENT", "Field": "vlocity_cmt__RecurringManualDiscount__c" } ], "id": "802xx000001o0B1AAI", "cartId": "801xx000003H0UlAAK" }, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/801xx000003H0UlAAK/items/802xx000001o0B1AAI/pricing" }, "remote": { "params": {} }, "client": { "records": [], "params": {} } }, "adjustmentcodes": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/listsofvalues?cartId=801xx000003H0UlAAK&listkeys=AdjustmentCodes&id=802xx000001o0B1AAI&fields=vlocity_cmt__RecurringManualDiscount__c&PricingVariableCode=REC_MNTH_STD_PRC_DISC_PCT_MAN" }, "remote": { "params": {} }, "client": { "records": [], "params": {} } }, "pricedetail": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/801xx000003H0UlAAK/items/802xx000001o0B1AAI/pricing?cartId=801xx000003H0UlAAK&id=802xx000001o0B1AAI&fields=vlocity_cmt__RecurringManualDiscount__c" }, "remote": { "params": {} }, "client": { "records": [], "params": {} } } } }, "vlocity_cmt__IsChangesAllowed__c": { "value": true, "previousValue": null, "originalValue": null, "messages": [], "label": "Changes Allowed", "hidden": false, "fieldName": "vlocity_cmt__IsChangesAllowed__c", "editable": true, "dataType": "BOOLEAN", "alternateValues": null, "actions": {} }, "vlocity_cmt__CpqPricingMessage__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Cpq Pricing Message", "hidden": false, "fieldName": "vlocity_cmt__CpqPricingMessage__c", "editable": true, "dataType": "TEXTAREA", "alternateValues": null, "actions": {} }, "vlocity_cmt__OneTimeTotal__c": { "value": 100, "previousValue": null, "originalValue": null, "messages": [], "label": "One Time Total", "hidden": false, "fieldName": "vlocity_cmt__OneTimeTotal__c", "editable": false, "dataType": "CURRENCY", "alternateValues": null, "actions": { "adjustmentcodes": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/listsofvalues?cartId=801xx000003H0UlAAK&listkeys=AdjustmentCodes&id=802xx000001o0B1AAI&fields=vlocity_cmt__OneTimeTotal__c&PricingVariableCode=OT_STD_PRC_TOTAL" }, "remote": { "params": {} }, "client": { "records": [], "params": {} } }, "pricedetail": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/801xx000003H0UlAAK/items/802xx000001o0B1AAI/pricing?cartId=801xx000003H0UlAAK&id=802xx000001o0B1AAI&fields=vlocity_cmt__OneTimeTotal__c" }, "remote": { "params": {} }, "client": { "records": [], "params": {} } } } }, "vlocity_cmt__FulfilmentStatus__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Fulfillment Status", "hidden": false, "fieldName": "vlocity_cmt__FulfilmentStatus__c", "editable": true, "dataType": "PICKLIST", "alternateValues": null, "actions": {} }, "vlocity_cmt__LineNumber__c": { "value": "0001", "previousValue": null, "originalValue": null, "messages": [], "label": "Line Number", "hidden": true, "fieldName": "vlocity_cmt__LineNumber__c", "editable": false, "dataType": "STRING", "alternateValues": null, "actions": {} }, "vlocity_cmt__ServiceAccountId__c": { "value": "001xx000003H0T9AAK", "previousValue": null, "originalValue": null, "messages": [], "label": "Service Account", "hidden": false, "fieldName": "vlocity_cmt__ServiceAccountId__c", "editable": true, "dataType": "REFERENCE", "alternateValues": null, "actions": {} }, "vlocity_cmt__RecurringCharge__c": { "value": 50, "previousValue": null, "originalValue": null, "messages": [], "label": "Recurring Charge", "hidden": true, "fieldName": "vlocity_cmt__RecurringCharge__c", "editable": false, "dataType": "CURRENCY", "alternateValues": null, "actions": { "timelists": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/listsofvalues?listkeys=TimePlans,TimePolicies" }, "remote": { "params": {} }, "client": { "records": [], "params": {} } }, "applyadjustment": { "rest": { "params": { "adjustments": [ { "AdjustmentValue": 0, "PricingVariableCode": "REC_MNTH_STD_PRC", "AdjustmentMethod": "Percent", "AdjustmentCode": "", "DetailType": "ADJUSTMENT", "Field": "vlocity_cmt__RecurringCharge__c" } ], "id": "802xx000001o0B1AAI", "cartId": "801xx000003H0UlAAK" }, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/801xx000003H0UlAAK/items/802xx000001o0B1AAI/pricing" }, "remote": { "params": {} }, "client": { "records": [], "params": {} } }, "adjustmentcodes": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/listsofvalues?cartId=801xx000003H0UlAAK&listkeys=AdjustmentCodes&id=802xx000001o0B1AAI&fields=vlocity_cmt__RecurringCharge__c&PricingVariableCode=REC_MNTH_STD_PRC" }, "remote": { "params": {} }, "client": { "records": [], "params": {} } }, "pricedetail": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/801xx000003H0UlAAK/items/802xx000001o0B1AAI/pricing?cartId=801xx000003H0UlAAK&id=802xx000001o0B1AAI&fields=vlocity_cmt__RecurringCharge__c" }, "remote": { "params": {} }, "client": { "records": [], "params": {} } } } }, "vlocity_cmt__OneTimeCharge__c": { "value": 100, "previousValue": null, "originalValue": null, "messages": [], "label": "One Time Charge", "hidden": true, "fieldName": "vlocity_cmt__OneTimeCharge__c", "editable": false, "dataType": "CURRENCY", "alternateValues": null, "actions": { "applyadjustment": { "rest": { "params": { "adjustments": [ { "AdjustmentValue": 0, "PricingVariableCode": "OT_STD_PRC", "AdjustmentMethod": "Percent", "AdjustmentCode": "", "DetailType": "ADJUSTMENT", "Field": "vlocity_cmt__OneTimeCharge__c" } ], "id": "802xx000001o0B1AAI", "cartId": "801xx000003H0UlAAK" }, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/801xx000003H0UlAAK/items/802xx000001o0B1AAI/pricing" }, "remote": { "params": {} }, "client": { "records": [], "params": {} } }, "adjustmentcodes": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/listsofvalues?cartId=801xx000003H0UlAAK&listkeys=AdjustmentCodes&id=802xx000001o0B1AAI&fields=vlocity_cmt__OneTimeCharge__c&PricingVariableCode=OT_STD_PRC" }, "remote": { "params": {} }, "client": { "records": [], "params": {} } }, "pricedetail": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/801xx000003H0UlAAK/items/802xx000001o0B1AAI/pricing?cartId=801xx000003H0UlAAK&id=802xx000001o0B1AAI&fields=vlocity_cmt__OneTimeCharge__c" }, "remote": { "params": {} }, "client": { "records": [], "params": {} } } } }, "vlocity_cmt__SubAction__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Sub Action", "hidden": false, "fieldName": "vlocity_cmt__SubAction__c", "editable": true, "dataType": "PICKLIST", "alternateValues": null, "actions": {} }, "vlocity_cmt__CurrencyPaymentMode__c": { "value": "Currency", "previousValue": null, "originalValue": null, "messages": [], "label": "Currency Payment Mode", "hidden": true, "fieldName": "vlocity_cmt__CurrencyPaymentMode__c", "editable": true, "dataType": "PICKLIST", "alternateValues": null, "actions": {} }, "vlocity_cmt__ProductHierarchyGroupKeyPath__c": { "value": "f3b86b92-81ce-2541-07e5-83b46d640d71", "previousValue": null, "originalValue": null, "messages": [], "label": "Product Hierarchy Group Key Path", "hidden": false, "fieldName": "vlocity_cmt__ProductHierarchyGroupKeyPath__c", "editable": true, "dataType": "TEXTAREA", "alternateValues": null, "actions": {} }, "vlocity_cmt__SupersededOrderItemId__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Superseded Order Product", "hidden": true, "fieldName": "vlocity_cmt__SupersededOrderItemId__c", "editable": false, "dataType": "REFERENCE", "alternateValues": null, "actions": {} }, "vlocity_cmt__RecurringTotal__c": { "value": 50, "previousValue": null, "originalValue": null, "messages": [], "label": "Recurring Total", "hidden": false, "fieldName": "vlocity_cmt__RecurringTotal__c", "editable": false, "dataType": "CURRENCY", "alternateValues": null, "actions": { "adjustmentcodes": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/listsofvalues?cartId=801xx000003H0UlAAK&listkeys=AdjustmentCodes&id=802xx000001o0B1AAI&fields=vlocity_cmt__RecurringTotal__c&PricingVariableCode=REC_MNTH_STD_PRC_TOTAL" }, "remote": { "params": {} }, "client": { "records": [], "params": {} } }, "pricedetail": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/801xx000003H0UlAAK/items/802xx000001o0B1AAI/pricing?cartId=801xx000003H0UlAAK&id=802xx000001o0B1AAI&fields=vlocity_cmt__RecurringTotal__c" }, "remote": { "params": {} }, "client": { "records": [], "params": {} } } } }, "vlocity_cmt__SupplementalAction__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Supplemental Action", "hidden": false, "fieldName": "vlocity_cmt__SupplementalAction__c", "editable": true, "dataType": "PICKLIST", "alternateValues": null, "actions": {} }, "vlocity_cmt__Product2Id__c": { "value": "01txx0000007CBoAAM", "previousValue": null, "originalValue": null, "messages": [], "label": "Product", "hidden": false, "fieldName": "vlocity_cmt__Product2Id__c", "editable": true, "dataType": "REFERENCE", "alternateValues": null, "actions": {} }, "vlocity_cmt__OrderGroupId__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Order Group", "hidden": true, "fieldName": "vlocity_cmt__OrderGroupId__c", "editable": false, "dataType": "REFERENCE", "alternateValues": null, "actions": {} }, "vlocity_cmt__Action__c": { "value": "Add", "previousValue": null, "originalValue": null, "messages": [], "label": "Action", "hidden": false, "fieldName": "vlocity_cmt__Action__c", "editable": true, "dataType": "PICKLIST", "alternateValues": null, "actions": {} }, "Quantity": { "value": 1, "previousValue": null, "originalValue": null, "messages": [], "label": "Quantity", "hidden": false, "fieldName": "Quantity", "editable": true, "dataType": "DOUBLE", "alternateValues": null, "actions": {} }, "vlocity_cmt__OneTimeManualDiscount__c": { "value": 0, "previousValue": null, "originalValue": null, "messages": [], "label": "One Time Manual Discount", "hidden": false, "fieldName": "vlocity_cmt__OneTimeManualDiscount__c", "editable": true, "dataType": "PERCENT", "alternateValues": null, "actions": { "applyadjustment": { "rest": { "params": { "adjustments": [ { "AdjustmentValue": 0, "PricingVariableCode": "OT_STD_PRC_DISC_PCT_MAN", "AdjustmentMethod": "Percent", "AdjustmentCode": "", "DetailType": "ADJUSTMENT", "Field": "vlocity_cmt__OneTimeManualDiscount__c" } ], "id": "802xx000001o0B1AAI", "cartId": "801xx000003H0UlAAK" }, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/801xx000003H0UlAAK/items/802xx000001o0B1AAI/pricing" }, "remote": { "params": {} }, "client": { "records": [], "params": {} } }, "adjustmentcodes": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/listsofvalues?cartId=801xx000003H0UlAAK&listkeys=AdjustmentCodes&id=802xx000001o0B1AAI&fields=vlocity_cmt__OneTimeManualDiscount__c&PricingVariableCode=OT_STD_PRC_DISC_PCT_MAN" }, "remote": { "params": {} }, "client": { "records": [], "params": {} } }, "pricedetail": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/801xx000003H0UlAAK/items/802xx000001o0B1AAI/pricing?cartId=801xx000003H0UlAAK&id=802xx000001o0B1AAI&fields=vlocity_cmt__OneTimeManualDiscount__c" }, "remote": { "params": {} }, "client": { "records": [], "params": {} } } } }, "OrderId": { "value": "801xx000003H0UlAAK", "previousValue": null, "originalValue": null, "messages": [], "label": "Order ID", "hidden": false, "fieldName": "OrderId", "editable": false, "dataType": "REFERENCE", "alternateValues": null, "actions": {} }, "vlocity_cmt__EffectiveQuantity__c": { "value": 1, "previousValue": null, "originalValue": null, "messages": [], "label": "Effective Quantity", "hidden": false, "fieldName": "vlocity_cmt__EffectiveQuantity__c", "editable": true, "dataType": "DOUBLE", "alternateValues": null, "actions": {} }, "vlocity_cmt__BillingAccountId__c": { "value": "001xx000003H0T9AAK", "previousValue": null, "originalValue": null, "messages": [], "label": "Billing Account", "hidden": false, "fieldName": "vlocity_cmt__BillingAccountId__c", "editable": true, "dataType": "REFERENCE", "alternateValues": null, "actions": {} }, "vlocity_cmt__ProvisioningStatus__c": { "value": "New", "previousValue": null, "originalValue": null, "messages": [], "label": "Provisioning Status", "hidden": true, "fieldName": "vlocity_cmt__ProvisioningStatus__c", "editable": false, "dataType": "STRING", "alternateValues": null, "actions": {} }, "vlocity_cmt__AssetReferenceId__c": { "value": "87a0aafe-d379-4339-8b54-ceacf04e279e", "previousValue": null, "originalValue": null, "messages": [], "label": "Asset Reference Id", "hidden": true, "fieldName": "vlocity_cmt__AssetReferenceId__c", "editable": true, "dataType": "STRING", "alternateValues": null, "actions": {} }, "vlocity_cmt__InCartQuantityMap__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "In Cart Quantity Map", "hidden": true, "fieldName": "vlocity_cmt__InCartQuantityMap__c", "editable": false, "dataType": "TEXTAREA", "alternateValues": null, "actions": {} }, "vlocity_cmt__FirstVersionOrderItemId__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "First Order Product Version", "hidden": true, "fieldName": "vlocity_cmt__FirstVersionOrderItemId__c", "editable": false, "dataType": "REFERENCE", "alternateValues": null, "actions": {} }, "PricebookEntryId": { "value": "01uxx0000009Ua7AAE", "previousValue": null, "originalValue": null, "messages": [], "label": "Price Book Entry ID", "hidden": false, "fieldName": "PricebookEntryId", "editable": false, "dataType": "REFERENCE", "alternateValues": null, "actions": {} }, "vlocity_cmt__ProductHierarchyPath__c": { "value": "01txx0000007CBoAAM", "previousValue": null, "originalValue": null, "messages": [], "label": "Product Hierarchy Path", "hidden": true, "fieldName": "vlocity_cmt__ProductHierarchyPath__c", "editable": false, "dataType": "STRING", "alternateValues": null, "actions": {} }, "vlocity_cmt__RootItemId__c": { "value": "802xx000001o0B1AAI", "previousValue": null, "originalValue": null, "messages": [], "label": "Root Item ID", "hidden": true, "fieldName": "vlocity_cmt__RootItemId__c", "editable": false, "dataType": "STRING", "alternateValues": null, "actions": {} }, "vlocity_cmt__CpqMessageData__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Cpq Message Data", "hidden": true, "fieldName": "vlocity_cmt__CpqMessageData__c", "editable": true, "dataType": "TEXTAREA", "alternateValues": null, "actions": {} }, "Id": { "value": "802xx000001o0B1AAI", "previousValue": null, "originalValue": null, "messages": [], "label": "Order Product ID", "hidden": false, "fieldName": "Id", "editable": false, "dataType": "ID", "alternateValues": null, "actions": {} }, "vlocity_cmt__RecurringCalculatedPrice__c": { "value": 50, "previousValue": null, "originalValue": null, "messages": [], "label": "Recurring Calculated Price", "hidden": true, "fieldName": "vlocity_cmt__RecurringCalculatedPrice__c", "editable": false, "dataType": "CURRENCY", "alternateValues": null, "actions": { "applyadjustment": { "rest": { "params": { "adjustments": [ { "AdjustmentValue": 0, "PricingVariableCode": "REC_MNTH_STD_PRC_CALC", "AdjustmentMethod": "Percent", "AdjustmentCode": "", "DetailType": "ADJUSTMENT", "Field": "vlocity_cmt__RecurringCalculatedPrice__c" } ], "id": "802xx000001o0B1AAI", "cartId": "801xx000003H0UlAAK" }, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/801xx000003H0UlAAK/items/802xx000001o0B1AAI/pricing" }, "remote": { "params": {} }, "client": { "records": [], "params": {} } }, "adjustmentcodes": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/listsofvalues?cartId=801xx000003H0UlAAK&listkeys=AdjustmentCodes&id=802xx000001o0B1AAI&fields=vlocity_cmt__RecurringCalculatedPrice__c&PricingVariableCode=REC_MNTH_STD_PRC_CALC" }, "remote": { "params": {} }, "client": { "records": [], "params": {} } }, "pricedetail": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/801xx000003H0UlAAK/items/802xx000001o0B1AAI/pricing?cartId=801xx000003H0UlAAK&id=802xx000001o0B1AAI&fields=vlocity_cmt__RecurringCalculatedPrice__c" }, "remote": { "params": {} }, "client": { "records": [], "params": {} } } } }, "vlocity_cmt__OneTimeCalculatedPrice__c": { "value": 100, "previousValue": null, "originalValue": null, "messages": [], "label": "One Time Calculated Price", "hidden": true, "fieldName": "vlocity_cmt__OneTimeCalculatedPrice__c", "editable": false, "dataType": "CURRENCY", "alternateValues": null, "actions": { "applyadjustment": { "rest": { "params": { "adjustments": [ { "AdjustmentValue": 0, "PricingVariableCode": "OT_STD_PRC_CALC", "AdjustmentMethod": "Percent", "AdjustmentCode": "", "DetailType": "ADJUSTMENT", "Field": "vlocity_cmt__OneTimeCalculatedPrice__c" } ], "id": "802xx000001o0B1AAI", "cartId": "801xx000003H0UlAAK" }, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/801xx000003H0UlAAK/items/802xx000001o0B1AAI/pricing" }, "remote": { "params": {} }, "client": { "records": [], "params": {} } }, "adjustmentcodes": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/listsofvalues?cartId=801xx000003H0UlAAK&listkeys=AdjustmentCodes&id=802xx000001o0B1AAI&fields=vlocity_cmt__OneTimeCalculatedPrice__c&PricingVariableCode=OT_STD_PRC_CALC" }, "remote": { "params": {} }, "client": { "records": [], "params": {} } }, "pricedetail": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/801xx000003H0UlAAK/items/802xx000001o0B1AAI/pricing?cartId=801xx000003H0UlAAK&id=802xx000001o0B1AAI&fields=vlocity_cmt__OneTimeCalculatedPrice__c" }, "remote": { "params": {} }, "client": { "records": [], "params": {} } } } }, "productCategories": { "messages": [], "totalSize": 0 }, "vlocity_cmt__ServiceAccountId__r": { "Id": "001xx000003H0T9AAK", "Name": "" }, "vlocity_cmt__BillingAccountId__r": { "Id": "001xx000003H0T9AAK", "Name": "" } } ] } ``` **See Also** - [Configure OmniScript for Guided Selling](https://help.salesforce.com/s/articleView?id=ind.comms_configure_omniscript_for_guided_selling.htm) ## Enabling Trim Mode **Option 1: Per-Request (Recommended for Controlled Adoption)** Enable Trim Mode for specific API calls using a query parameter: `/services/apexrest/vlocity_cmt/v2/cpq/carts/{cartId}/items?gciTrimMode=true` `/services/apexrest/vlocity_cmt/v2/cpq/carts/{cartId}/items?gciTrimMode=true&fields=UnitPrice,vlocity_cmt\_\_OneTimeCost\_\_c` Use this approach for: - Targeted integrations - Specific UI components - Testing and gradual rollout **Option 2: Org-Wide Configuration** Enable Trim Mode globally via CPQ configuration: - Set `gciTrimMode = true` in CPQ Configuration Setup. This applies to all GetCartItems API calls across the organization. - Configure field set: - Product2.Name - UnitPrice - TotalPrice - Description All responses include default fields, field set fields, and additional fields via fields parameter (if provided). **important:** Trim Mode removes fields from the API response. Any code, UI, or integration that depends on those fields will break unless the fields are explicitly requested. ### Precedence Rules | API Parameter | Config Setting | Result | | ------------- | -------------- | -------- | | TRUE | any | Trim ON | | FALSE | any | Trim OFF | | not provided | TRUE | Trim ON | | not provided | false / unset | Trim OFF | The API parameter always takes precedence. Use `gciTrimMode = false` to override org-wide settings per request. ### Default Fields (Always Included) These 22 fields are always present when trim mode is on, without needing to request them: Id, RootItemId, ParentItemId, AssetReferenceId, LineNumber, Product2Id, PricebookEntryId, OrderId, QuoteId, OpportunityId, Quantity, Status, Action, IsRootItem, ProductHierarchyPath, ProductHierarchyGroupKeyPath, BillingAccountId, ServiceAccountId, InCartQuantityMap, CpqMessageData, CpqCardinalityMessage, CpqPricingMessage ## Usage Examples ### Minimal Cart (Mobile Optimization) `/services/apexrest/vlocity_cmt/v2/cpq/carts/{cartId}/items?gciTrimMode=true&fields=Product2.Name,TotalPrice` Returns a lightweight payload (~24 fields vs 150+). ### Cost Analysis Dashboard `/services/apexrest/vlocity_cmt/v2/cpq/carts/{cartId}/items?gciTrimMode=true&fields=UnitPrice,vlocity_cmt__OneTimeCost__c,vlocity_cmt__RecurringCost__c,vlocity_cmt__OneTimeMargin__c` ### Override Org-Wide Trim Mode `/services/apexrest/vlocity_cmt/v2/cpq/carts/{cartId}/items?gciTrimMode=false` Returns full response regardless of org settings. # Get Cart Promotions Retrieve all promotions for a specified opportunity, quote, or order. ```nolang GET /v2/cpq/carts/cart_ID/promotions ``` 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 ```nolang getCartsPromotions ``` ## Handlers ```nolang REST Endpoint: APIPromotionsCartsCpqV2.cls Implementation: EPCPromotionRuntimeService.cls ``` ## Apex remote service ```nolang CpqAppHandler ``` ## Apex Remote Input Map ```nolang methodName:getCartsPromotions cartId:8011I000000TUaK query:query filters:vlocity_cmt__Code__c:Root-Promo sortBy:Id ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | ------------------------------------------------------------------ | | Resource URL | `/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/promotions` | ## Example Request ```nolang GET /services/apexrest/vlocity_cmt/v2/cpq/carts/8011I000000TUaK/promotions?query=iphone&sortBy=Id&filters=vlocity_cmt__Code__c:Root-Promo ``` ## Example Response ```nolang { "totalSize": 1, "messages": [], "records": [ { "messages": [], "actions": { "validatecart": { "rest": { "params": {}, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/8011I000000TUaKQAW/validate" }, "remote": { "params": { "cartId": "8011I000000TUaKQAW", "methodName": "runCartValidation" } }, "client": { "params": {} } } }, "displaySequence": 0, "Id": "a2j1I000000XzfWQAS", "Name": "Root-Promo", "vlocity_cmt__Code__c": "Root-Promo", "name": "Root-Promo", "code": "Root-Promo", "id": "a2j1I000000XzfWQAS", "category": "Qualified" } ] } ``` # Get Cart Summary 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 ```nolang 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 ```nolang getCarts ``` ## REST Handler ```nolang APICartsCpqV2 ``` ## Apex Remote Service ```nolang CpqAppHandler ``` ## Apex Remote Input Map ```nolang { 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](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | -------------------------------------------------------------------------------------------------------- | ------- | | Resource URL | `/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}?headerFieldSet={field_set_feature}&validate={true | false}` | ## Example Request ```nolang GET /services/apexrest/vlocity_cmt/v2/cpq/carts/80141000000Cg8H ``` ## Example Result ```nolang { "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": {} } } } } }] } ``` # 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 ```nolang 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 ```nolang getCarts ``` ## REST Handler ```nolang APICartsCpqV2 ``` ## Apex Remote Service ```nolang CpqAppHandler ``` ## Apex Remote Input Map ```nolang { "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](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | ---------------------------------------------------------------------------------------------------------------- | | Resource URL | `/services/apexrest/{namespace}/v2/cpq/carts/{CART_ID}?headerFieldSet={field_set_feature}&validate={true/false}` | ## Example Request ```nolang GET /services/apexrest/vlocity_cmt/v2/cpq/carts/801DX000000FERDYA4 ``` ## Example Result ```nolang { "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": [ ] } ``` # Get Catalog Change API The Get Catalog Change API defines all offer and availability changes applicable to your catalogs by getting all the distinct unprocessed Catalog changes made on Salesforce Objects (Subjects). Some examples of changes include offer or bundle modifications such as changes in description, attachments, and cardinality changes. Additionally, this API defines any changes that impact the eligibility or effectivity of an offer. For this API to function properly, set the custom setting `CacheAPI.RegenerateBatchCacheProcessor` to `True`. When set to `True`, the API registers the catalog change as a simpleOffer or availability for those SObjects that could lead to a catalog-level change during derivation. This custom setting is applicable for Cache Management APIs (Regenerate APIs) only to avoid processing all the catalog level jobs during the Regeneration API. - simpleOffer: Changes made in the offer or bundle structure that only affect the properties of an offer, such as a change in description, attachments, cardinality changes, etc. - availability: Changes that impact the eligibility or effectivity of an offer in a catalog. ## URI /services/apexrest/vlocity_cmt/v3/admin/catalogs/regenerate/catalogChange ## HTTP Method GET ## URI Parameters | Parameter | Example | Default | Optional/Required | Notes | | --------- | -------------------------------------------------------------------------------------------- | ------- | ----------------- | ----------------------------------------------------------- | | pageSize | /services/apexrest/h_cpq/v3/admin/catalogs/regenerate/catalogChange?pageSize=10 | 5 | Optional | By default, this API returns five catalog changes at a time | | offset | /services/apexrest/h_cpq/v3/admin/catalogs/regenerate/catalogChange?pageSize=10&offset=0 | 0 | Optional | | ## Request Body This example shows how you can specify pageSize and offset parameters for this API if you wish to customize which catalog changes it returns and how many. ```nolang GET /services/apexrest/vlocity_cmt/v3/admin/catalogs/regenerate/catalogChange?pageSize=10&offset=0 ``` ## Remote API This is an example of how you invoke the API using Apex: ```nolang String methodName; Map input = new Map(); Map output = new Map(); Map options = new Map(); // Setting remote parameters methodName = 'getCatalogChanges'; input.put('methodName',methodName); //required input.put('apiName','regenerate'); //required input.put('pagesize','20'); //optional input.put('offset','0'); //optional //remote action invocation jk_232_cam.CpqAppHandler appHandler = new jk_232_cam.CpqAppHandler(); appHandler.invokeMethod(methodName, input, output, options); ``` ## Parallel Invocation You can run this API in parallel for different sets of pageSize and offset. For example, if there are 100 cachedAPIChange entries (CAC1, CAC2.....CAC100), default pageSize =10, and offset is 0, then you can run parallel threads for the GetCatalog Change API with different offset values. ```nolang THREAD1 - GET /services/apexrest/vlocity_cmt/v3/admin/catalogs/regenerate/catalogChange?pageSize=10&offset=0 THREAD2 - GET /services/apexrest/vlocity_cmt/v3/admin/catalogs/regenerate/catalogChange?pageSize=10&offset=10 THREAD3 - GET /services/apexrest/vlocity_cmt/v3/admin/catalogs/regenerate/catalogChange?pageSize=10&offset=20 . . . . THREAD10 - GET /services/apexrest/vlocity_cmt/v3/admin/catalogs/regenerate/catalogChange?pageSize=10&offset=90 ``` ## HTTP Headers | Header | Description | | ------------ | ---------------- | | Content-Type | application/json | ## Response Body The sample output shows cached API change Ids. returnStatus indicates success or failure with an error reason. List \ of records contains the unprocessed Id of the CachedAPIChange\_\_c object. ``` { "cachedAPIChangeIds": [ "a4Q5g000000Tjj1EAC", "a4Q5g000000TjjBEAS", "a4Q5g000000TjjCEAS" ], "totalChanges":118, "errorCode": "INVOKE-200", "error": "OK" } ``` ## HTTP Response Codes | Code | Description | | ---- | --------------------- | | 200 | OK | | 500 | Internal Server Error | # Get Catalog Information Return data from the specified catalog. If you omit the catalog ID, this API returns data from root catalogs. By default, all catalog data is returned in the results. ```nolang GET /v2/cpq/catalogs?catalogId={catalog_ID}&ContextId={cart_ID} ``` For root catalogs, you can paginate the results to minimize client wait time by returning the data in a series of chunks (child catalogs are not paginated). To loop through paginated results, issue the first GET call, use the data returned in the **action** field to compose subsequent GET calls, and looping until the **action** field is empty, which indicates that the last page has been returned. To override the default page size of 20, create a new record on the object named `VlocityAPIMetadata` and set the field `vlocity_cmt\_\_APIName\_\_c` to `getCatalogHierarchy`. In the field named `vlocity_cmt\_\_APIParams\_\_c`, add a key-value pair specified in curly brackets with the key set to `pagesize` and value set to the desired default page size (for example: {"pagesize":100}). By default, root catalogs are returned sorted by ID. To retrieve root catalogs in a specific order, set the sortBy parameter to a comma-separated list of fields to be used to sort the results. If the ContextId parameter is specified, the API returns the action and parameters required to retrieve the catalog products. 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 ```nolang getCatalogHierarchy ``` ## REST Handler ```nolang APICatalogsCpqV2 ``` ## Apex Remote Service ```nolang CpqAppHandler ``` ## Apex Remote Input Map ```nolang { "methodName": "getCatalogHierarchy", "catalogId": "a1T36000000j2lB", "cartId":"80136000000S4kq", } ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | ------------------------------------------------------------------------------------------- | | Resource URL | `/services/apexrest/{namespace}/v2/cpq/catalogs?catalogId={catalog_ID}&ContextId={cart_ID}` | ## Examples **note:** Retrieve All Root Catalogs ```nolang GET /services/apexrest/vlocity_cmt/v2/cpq/catalogs ``` **note:** Response ```nolang { "totalSize": 2, "records": [ { "displaySequence": -1, "attributes": { "type": "vlocity_cmt__Catalog__c", "url": "/services/data/v42.0/sobjects/vlocity_cmt__Catalog__c/a0D0a00000Ges3cEAB" }, "Id": "a0D0a00000Ges3cEAB", "OwnerId": "0050a00000JIgxVAAT", "IsDeleted": false, "Name": "First", "CreatedDate": "2018-03-01T04:31:50.000+0000", "CreatedById": "0050a00000JIgxVAAT", "LastModifiedDate": "2018-03-01T04:59:18.000+0000", "LastModifiedById": "0050a00000JIgxVAAT", "SystemModstamp": "2018-03-03T01:04:14.000+0000", "LastViewedDate": "2018-03-05T11:06:51.000+0000", "LastReferencedDate": "2018-03-05T11:06:51.000+0000", "vlocity_cmt__CatalogCode__c": "Catalog_f", "vlocity_cmt__GlobalKey__c": "55d205fa-9271-c00f-1d33-8a21c62490ef", "vlocity_cmt__IsActive__c": true, "vlocity_cmt__IsCatalogRoot__c": true, "catalogId": "a0D0a00000Ges3cEAB", "catalogName": "First" }, { "displaySequence": -1, "attributes": { "type": "vlocity_cmt__Catalog__c", "url": "/services/data/v42.0/sobjects/vlocity_cmt__Catalog__c/a0D0a00000Ges3hEAB" }, "Id": "a0D0a00000Ges3hEAB", "OwnerId": "0050a00000JIgxVAAT", "IsDeleted": false, "Name": "Second", "CreatedDate": "2018-03-01T04:32:18.000+0000", "CreatedById": "0050a00000JIgxVAAT", "LastModifiedDate": "2018-03-01T04:59:40.000+0000", "LastModifiedById": "0050a00000JIgxVAAT", "SystemModstamp": "2018-03-03T01:04:14.000+0000", "LastViewedDate": "2018-03-01T08:12:34.000+0000", "LastReferencedDate": "2018-03-01T08:12:34.000+0000", "vlocity_cmt__GlobalKey__c": "85057565-e71e-2d6e-3713-3cd437750bcb", "vlocity_cmt__IsActive__c": true, "vlocity_cmt__IsCatalogRoot__c": true, "catalogId": "a0D0a00000Ges3hEAB", "catalogName": "Second" } ] } ``` **note:** Retrieve First Root Catalog No sort order is specified in the following request: ```nolang GET /services/apexrest/vlocity_cmt/v2/cpq/catalogs?pagesize=1 ``` **note:** Response ```nolang { "totalSize": 1, "actions": { "nextcatalogs": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/cpq/catalogs/?offsetSize=1&pagesize=1&includeProducts=false" }, "remote": { "params": { "includeProducts": false, "pagesize": 1, "offsetSize": 1, "methodName": "getCatalog" } }, "client": { "params": {} } } }, "records": [ { "displaySequence": -1, "attributes": { "type": "vlocity_cmt__Catalog__c", "url": "/services/data/v42.0/sobjects/vlocity_cmt__Catalog__c/a0D0a00000Ges3cEAB" }, "Id": "a0D0a00000Ges3cEAB", "OwnerId": "0050a00000JIgxVAAT", "IsDeleted": false, "Name": "First", "CreatedDate": "2018-03-01T04:31:50.000+0000", "CreatedById": "0050a00000JIgxVAAT", "LastModifiedDate": "2018-03-01T04:59:18.000+0000", "LastModifiedById": "0050a00000JIgxVAAT", "SystemModstamp": "2018-03-03T01:04:14.000+0000", "LastViewedDate": "2018-03-05T11:06:51.000+0000", "LastReferencedDate": "2018-03-05T11:06:51.000+0000", "vlocity_cmt__CatalogCode__c": "Catalog_f", "vlocity_cmt__GlobalKey__c": "55d205fa-9271-c00f-1d33-8a21c62490ef", "vlocity_cmt__IsActive__c": true, "vlocity_cmt__IsCatalogRoot__c": true, "catalogId": "a0D0a00000Ges3cEAB", "catalogName": "First" } ] } ``` **note:** Retrieve All Root Catalogs Sorted by Name ```nolang /services/apexrest/vlocity_cmt/v2/cpq/catalogs?sortBy=Name_ASC ``` **note:** Response ```nolang { "totalSize": 2, "records": [ { "displaySequence": -1, "attributes": { "type": "vlocity_cmt__Catalog__c", "url": "/services/data/v42.0/sobjects/vlocity_cmt__Catalog__c/a0D0a00000Ges3hEAB" }, "Id": "a0D0a00000Ges3hEAB", "OwnerId": "0050a00000JIgxVAAT", "IsDeleted": false, "Name": "Second", "CreatedDate": "2018-03-01T04:32:18.000+0000", "CreatedById": "0050a00000JIgxVAAT", "LastModifiedDate": "2018-03-01T04:59:40.000+0000", "LastModifiedById": "0050a00000JIgxVAAT", "SystemModstamp": "2018-03-03T01:04:14.000+0000", "LastViewedDate": "2018-03-01T08:12:34.000+0000", "LastReferencedDate": "2018-03-01T08:12:34.000+0000", "vlocity_cmt__GlobalKey__c": "85057565-e71e-2d6e-3713-3cd437750bcb", "vlocity_cmt__IsActive__c": true, "vlocity_cmt__IsCatalogRoot__c": true, "catalogId": "a0D0a00000Ges3hEAB", "catalogName": "Second" }, { "displaySequence": -1, "attributes": { "type": "vlocity_cmt__Catalog__c", "url": "/services/data/v42.0/sobjects/vlocity_cmt__Catalog__c/a0D0a00000Ges3cEAB" }, "Id": "a0D0a00000Ges3cEAB", "OwnerId": "0050a00000JIgxVAAT", "IsDeleted": false, "Name": "First", "CreatedDate": "2018-03-01T04:31:50.000+0000", "CreatedById": "0050a00000JIgxVAAT", "LastModifiedDate": "2018-03-01T04:59:18.000+0000", "LastModifiedById": "0050a00000JIgxVAAT", "SystemModstamp": "2018-03-03T01:04:14.000+0000", "LastViewedDate": "2018-03-05T11:06:51.000+0000", "LastReferencedDate": "2018-03-05T11:06:51.000+0000", "vlocity_cmt__CatalogCode__c": "Catalog_f", "vlocity_cmt__GlobalKey__c": "55d205fa-9271-c00f-1d33-8a21c62490ef", "vlocity_cmt__IsActive__c": true, "vlocity_cmt__IsCatalogRoot__c": true, "catalogId": "a0D0a00000Ges3cEAB", "catalogName": "First" } ] } ``` # Get Contains Products This API is the same as Get Offers by Catalog. Enable the **contains** parameters variable and click **Send**. ![Get Contains Products](https://developer.salesforce.com/docs/media/postman_getcontainsproducts.png) # Get Contains Products API This API retrieves offers for the specified product code. This API is a variation of the [Get Offers by Catalog API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-get-offers-by-catalog-api.md). The response includes orderable offers (promotions and products) that contain the specified product. A cart ID is not required. A promotion includes all the products associated with the promotion, including the root-level product. This API support a flag called isloggedin to indicate whether a user is logged in or anonymous. If the isloggedin parameter is true, it indicates a logged-in user, and an accountId must be specified in the context parameter of the API call. If the isloggedin flag is false, it indicates that the user is anonymous. See [Get Offer Details API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-get-offer-details-api.md) for more information and examples. See [Digital Commerce REST API](https://developer.salesforce.com/docs/industries/cme/references/dc-rest1?meta=Summary). ## Rules supported - [Context Eligibility Rules for Products and Promotions](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-context-eligibility-rules.md) - Response contains Base Prices only (see [Product Pricing in EPC](https://help.salesforce.com/s/articleView?id=ind.comms_product_pricing_in_epc.htm)) - [Using Context Rules with Digital Commerce APIs](https://help.salesforce.com/s/articleView?id=ind.comms_using_context_rules_with_digital_commerce_apis.htm) - No advanced rules are supported. ## Prerequisites - Catalog should have CatalogCode**c populated and no space is allowed in CatalogCode**c. - Products should have ProductCode populated and no space is allowed in ProductCode. - Promotions should have Code**c populated and no space is allowed in Code**c. - Catalog should be present with products and promotions attached to it as records under CatalogProductRelationship\_\_c object. - The catalog should be attached to a default price list through DefaultPriceList**c field on Catalog**c object. - Price list entries should exist for all products attached to the catalog. - The [Product Hierarchy Maintenance](https://help.salesforce.com/s/articleView?id=ind.comms_product_hierarchy_maintenance.htm) job should be run before executing this API. ## Parameters For API parameter names and descriptions, see [Digital Commerce REST API](https://developer.salesforce.com/docs/industries/cme/references/dc-rest1?meta=Summary). ## Response A response code of 201 indicates a successful call while 400 indicates a failed response. For detailed API response descriptions, see [Digital Commerce REST API](https://developer.salesforce.com/docs/industries/cme/references/dc-rest1?meta=Summary). ## Get Contains Products for an Anonymous User Example: Retrieve an offer with a specific product code for an anonymous user: ```nolang Method: GET /v3/catalogs/{catalog_code}/offers?contains={product_code} ``` ```nolang GET /services/apexrest/vlocity_cmt/v3/catalogs/{catalog_code}/offers?contains={offer_code} ``` ## Get Contains Products for a logged-in User Example: Retrieve an offer with a specific product code for a logged-in user: ```nolang Method: GET /v3/catalogs/{catalog_code}/offers?contains={product_code}&context={"accountId":"{account_ID}"}&loggedIn=true ``` ```nolang GET /services/apexrest/vlocity_cmt/v3/catalogs/{catalog_code}/offers?contains={offer_code}?context={"accountId":"{account_ID}"}&loggedIn=true ``` # Get Contracts for Account Retrieve the contracts for a specified account ID. ```nolang GET /v2/assets/{ID}/pricing?accountId={account_ID} ``` ## Remote Method ```nolang getContracts ``` ## Handlers ```nolang REST Endpoint: APIContractsAccountsV2.cls Implementation: CpqContractsAccountsActionV2.cls ``` ## Apex Remote Service ```nolang CpqAppHandler ``` ## Apex Remote Input Map ```nolang methodName: getContracts accountId: 0011I000007lzDO ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | ------------------------------------------------------- | | Resource URL | /services/apexrest/{namespace}/v2/accounts/{account_ID} | ## Example Request ```nolang GET /services/apexrest/vlocity_cmt/v2/accounts/0011I000007lzDO/contracts ``` ## Example Response ```nolang { "totalSize": 1, "messages": [], "records": [ { "messages": [], "actions": { "getassetsbycontract": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/contracts/8001I0000000ThgQAE/assets" }, "remote": { "params": { "includes": "allAssets" } }, "client": { "params": {} } } }, "displaySequence": -1, "name": "00000364", "Id": { "value": "8001I0000000ThgQAE", "previousValue": null, "originalValue": null, "messages": [], "label": "Id", "hidden": false, "fieldName": "Id", "editable": false, "dataType": "ID", "actions": {} } } ] } ``` # Get Details of Product For all disqualified promotions or products, get a message about which rule conditions failed. Return information about why a product or promotion was disqualified. ```nolang GET /v2/cpq/carts/{cart_ID}/products/{pricebook_entry_ID}?include=qualifications&ruleType=Qualification ``` or ```nolang GET v2/cpq/carts/{cart_ID}/promotions/{promotion_ID}?include=qualifications&ruleType=Qualification ``` 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 ```nolang getRuleMessages ``` ## REST Handler ```nolang APIProductsCartsCpqV2 ``` ## Apex Remote Service ```nolang CpqAppHandler ``` ## Apex Remote Input Map ```nolang { methodName: getRuleMessages ruleEvaluationInput: null ruleType: Qualification include: qualifications id: cartId: } ``` ## Package Communications (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | | Resource URL | `/services/apexrest/{namespace}/v2/cpq/carts/801f4000000kCNPAA2/products/01uf4000000sMtjAAE?include=qualifications&ruleType=Qualification` | | Resource URL | `/services/apexrest/{namespace}/v2/cpq/carts/801f4000000kCNPAA2/promotions/a2ff4000000LUCDAA4?include=qualifications&ruleType=Qualification` | ## Example Request ```nolang GET /services/apexrest/vlocity_cmt/v2/cpq/carts/801f4000000kCNPAA2/products/01uf4000000sMtjAAE?include=qualifications&ruleType=Qualification ``` ## Example Response ```nolang { "totalSize": 1, "messages": [], "records": [{ "messages": [], "displaySequence": -1, "id": "01uf4000000sMtjAAE", "name": "TestProd-2", "product2id": "01tf4000000YyZyAAK", "product2.description": "TestProd-2", "qualifications": { "totalSize": 1, "messages": [], "records": [{ "messages": [{ "severity": "WARN", "messageId": null, "message": "ruleset: accName is not acc-4", "code": "207", "bundleId": null, "actions": {} }], "displaySequence": -1, "name": "Ruleset-5", "type": "ruleset", "qualifications": { "totalSize": 1, "messages": [], "records": [{ "messages": [{ "severity": "WARN", "messageId": null, "message": "accountName is not acc-4", "code": "207", "bundleId": null, "actions": {} }], "displaySequence": -1, "name": "accountName is acc-4", "code": "accountName is acc-4", "type": "rule", "qualifications": { "totalSize": 2, "messages": [], "records": [{ "messages": [{ "severity": "WARN", "messageId": null, "message": "rsCond: accName is not acc-4", "code": "301", "bundleId": null, "actions": {} }], "displaySequence": -1, "code": "accountName is acc-4-con-1", "type": "rulecondition" }, { "messages": [{ "severity": "WARN", "messageId": null, "message": "channel is not web", "code": "301", "bundleId": null, "actions": {} }], "displaySequence": -1, "code": "cod-2-1-1", "type": "rulecondition" }] } }] } }] } }] } ``` # Get Featured Offers This API is the same as Get Offers by Catalog. Simply specify a value for the **sortby** parameter variable and click **Send**. # Get Featured Offers API The Get Featured Offers API provides the ability to retrieve a list of offers (products or promotions) that are modeled within the shared catalog which are sorted by a specified Catalog Product Relationship field. The specified catalog_code identifies the catalog that contains the offers. Offer eligibility can be determined by API parameters that support both anonymous and known user journeys. This API supports a flag called isloggedin to indicate whether a user is logged in or anonymous. If the isloggedin parameter is true, it indicates a logged-in user, and an accountId must be specified in the context parameter of the API call. If the isloggedin flag is false, it indicates that the user is anonymous. See [Get Offer Details API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-get-offer-details-api.md) for more information and examples. Also see [Digital Commerce REST API](https://developer.salesforce.com/docs/industries/cme/references/dc-rest1?meta=Summary). ## Rules Supported - [Context Eligibility Rules with Digital Commerce](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-context-eligibility-rules.md) - Response contains Base Prices only (see [Product Pricing in EPC](https://help.salesforce.com/s/articleView?id=ind.comms_product_pricing_in_epc.htm)) - [Using Context Rules with Digital Commerce APIs](https://help.salesforce.com/s/articleView?id=ind.comms_using_context_rules_with_digital_commerce_apis.htm) - No advanced rules are supported. ## Prerequisites - The Catalog should have the CatalogCode**c field populated. No spaces are permitted in CatalogCode**c. - Products should have ProductCode populated. No spaces are permitted in ProductCode. - Promotions should have Code**c populated and no space is allowed in Code**c. - Catalog should be present with products and promotions attached to it as records under CatalogProductRelationship\_\_c object. - Catalog should be attached to a default price list through DefaultPriceList**c field on Catalog**c object.Pricelist entries should exist for all the products attached to the catalog. - All products present under associated promotions ( for a catalog ), must also have a relationship with catalog. Products should be added to Catalog, before adding them to any promotion associated with the catalog. - A record should be created under the Vlocity API Metadata object for getOffers API. This can be populated by running a batch job named as LOAD API METADATA which is present under CMT Administration > Cacheable API Jobs. - Optional: To cache records that are associated with the getOffers API you can optionally run the Populate API Cache batch job (located in CMT Administration > Cacheable API Jobs). After populating, context eligibility and pricing records, you can also run the batch job using the following statement: `database.executeBatch(new BatchCacheProcessor('getOffers'));` - The Interface Implementation under ProductAvailability and ProductEligibiltiy is ignored. You must use Context Eligibility Rules to determine eligibility of Products. PricingRule and Tightest match for prices are not supported; however, base prices, adjustments, and override prices are supported. ## Parameters For detailed API response descriptions, see [Digital Commerce REST API](https://developer.salesforce.com/docs/industries/cme/references/dc-rest1?meta=Summary). ## Response For detailed API response descriptions, see [Digital Commerce REST API](https://developer.salesforce.com/docs/industries/cme/references/dc-rest1?meta=Summary). ## Get Featured Offers for an Anonymous User You can return featured offers using the getOffersByCatalog API with the **sortby** parameter. First, populate the **Sequence Number** field for products and promotions in the catalog. Then make an API call similar to the following: ```nolang GET /v3/catalogs/{catalog_code}/offers ``` ```nolang Method: GET API: /services/apexrest/vlocity_cmt/v3/catalogs/{catalog_code}/offers?sortby={namespace}__SequenceNumber__c_ASC ``` ## Get Featured Offers for a Logged In User You can return featured offers using the getOffersByCatalog API for a logged in user with the sortby parameter. First, populate the **Sequence Number** field for products and promotions in the Catalog. Then make an API call similar to the following: ```nolang GET /v3/catalogs/{catalog_code}/offers?context={"accountId":"{account number}"}&loggedIn=true ``` ```nolang Method: GET API: /services/apexrest/vlocity_cmt/v3/catalogs/{catalog_code}/offers?sortby=vlocity_cmt__SequenceNumber__c_ASC&context={"accountId":"{0016A0000053kHN"}&loggedIn=true ``` # Get Filterable Attributes Return the filterable attributes that are applicable for this cart, including the product attributes and the product attribute values that the customer can choose to filter products. ```nolang GET /v2/cpq/carts/{cart_ID}/attributes ``` 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 ```nolang getCartsAttributes ``` The `getCartAttributes` performs these: - Runs PCP validation if runPCP is true (from input). - Validates attributes and adds error messages if includeMessages is true (from input). - Does not support attribute overrides; it reads product attributes directly. ## REST Handler ```nolang APICartsAttributesCpqV2 ``` ## Apex Remote Service ```nolang CpqAppHandler ``` ## Apex Remote Input Map ```nolang { methodName:getCartsAttributes, cartId:801360000008eNU } ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | ------------------------------------------------------------------ | | Resource URL | `/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/attributes` | ## Example Request ```nolang GET /services/apexrest/vlocity_cmt/v2/cpq/carts/80136000000siLM/attributes ``` ## Example Response ```nolang "totalSize": 1, "messages": [], "records": [{ "messages": [], "displaySequence": -1, "attributeCategories": { "totalSize": 1, "messages": [], "records": [{ "messages": [], "displaySequence": 123, "Code__c": "121", "Name": "Test Category", "id": "a0936000003VfDrAAK", "productAttributes": { "totalSize": 1, "messages": [], "records": [{ "messages": [], "dataType": "number", "inputType": "number-range", "multiselect": false, "required": false, "readonly": false, "min": 1.00, "max": 51.00, "attributeId": "a0A36000009t7jGEAQ", "label": "Filter Number", "displaySequence": 1, "hasRules": false, "values": [{ "value": 1, "defaultValue": 1 }, { "value": 51, "defaultValue": 51 }], "userValues": null }] } }] } }] } ``` # Get Instant Price (POST) Get instant pricing for advanced order line items. ## Resource ``` /connect/macz/get-instant-price ``` ## Resource example ``` https://yourInstance.salesforce.com/services/data/v68.0/connect/macz/get-instant-price ``` ## Available version 68.0 ## HTTP methods POST ## Request body for POST See [Get Instant Pricing Input](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/requests/get-instant-pricing-input.md). ```json { "cpqPricingRequest": { "correlationId": "req-0001", "contextId": "ctx-0001", "records": { "recordsList": [ { "referenceId": "refItem1", "record": { "attributes": { "type": "OrderItem", "method": "POST" }, "Product2Id": "01tRM000000P9UuYAK", "Quantity": 10 } } ] } } } ``` | Name | Type | Description | Required or Optional | Available Version | | ------------------- | ------ | --------------------------------------------------------------------------------------------------------------------- | -------------------- | ----------------- | | `cpqPricingRequest` | Object | The Configure, Price, Quote (CPQ) instant pricing request with records, context, correlation ID, and pricing options. | Optional | 68.0 | ## Response body for POST See [Get Instant Pricing Output](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/responses/get-instant-pricing-output.md). # Get Instant Pricing Input The input for the Advanced Order Instant Pricing API. Wraps the Configure, Price, Quote (CPQ) instant pricing request with manufacturing context. ## JSON example ```json { "cpqPricingRequest": { "correlationId": "req-0001", "contextId": "ctx-0001", "records": { "recordsList": [ { "referenceId": "refItem1", "record": { "attributes": { "type": "OrderItem", "method": "POST" }, "Product2Id": "01tRM000000P9UuYAK", "Quantity": 10 } } ] } } } ``` ## Properties | Name | Type | Description | Required or Optional | Available Version | | ------------------- | ------ | --------------------------------------------------------------------------------------------------------------------- | -------------------- | ----------------- | | `cpqPricingRequest` | Object | The Configure, Price, Quote (CPQ) instant pricing request with records, context, correlation ID, and pricing options. | Optional | 68.0 | # Get Instant Pricing Output The output for the Advanced Order Instant Pricing API. Wraps the Configure, Price, Quote (CPQ) pricing response with manufacturing metadata. ## JSON example ```json { "cpqPricingResponse": { "success": true, "correlationId": "req-0001", "contextId": "ctx-0001", "records": [ { "referenceId": "refItem1", "record": { "attributes": { "type": "OrderItem" }, "Product2Id": "01tRM000000P9UuYAK", "Quantity": 10, "TotalPrice": 499.9 } } ] } } ``` ## Properties | Property Name | Type | Description | Filter Group and Version | Available Version | | -------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------- | ------------------------ | ----------------- | | `cpqPricingResponse` | Object | The Configure, Price, Quote (CPQ) pricing response with priced records, success status, correlation ID, and context ID. | Small, 68.0 | 68.0 | # Get Line Items by ID Return the items and configurable attributes based on item IDs. ```nolang GET /v2/cpq/carts/{cart_ID}/items?id={item_ID},{item_ID}&validate={true|false} ``` ## Get Cart Items Trim Mode Trim Mode is an optimization feature that reduces the payload size of the GetCartItems API response. Instead of returning the full set of cart item fields, Trim Mode restricts the response to only what is explicitly required. When enabled, the API response includes these: - A fixed set of 22 default fields (identity, hierarchy, and status) - Fields specified via the fields query parameter - Fields defined in the `GCITrimFieldsToInclude` field set in Salesforce All other fields are removed from the response. Structural nodes such as `PricebookEntry`, `Product2`, and `productChildItemDefinition` are always preserved. **important:** Trim Mode applies only to: - getCartItemList - getCartItemListById See, [Enabling Trim Mode](#enabling-trim-mode) ## Remote Method ```nolang getCartsItemsById ``` ## REST Handler ```nolang APIItemsCartsCpqV2 ``` ## Apex Remote Service ```nolang CpqAppHandler ``` ## Apex Remote Input Map ```nolang { methodName:getCartsItemsById, cartId:801360000008eNU, id:01t36000000pfcKAAQ,01t36000000pfcKAAQ } cartId = order.Id, opportunity.Id, quote.Id ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | ------------------------------------------------------------------------------------------------------------------ | | Resource URL | /services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/items?id=80236000000Z0QNAA0,01t36000000pfcKAAQ&validate=true | ## Example Request ```nolang GET /services/apexrest/vlocity_cmt/v2/cpq/carts/80136000000aSTqAAM/items?id=80236000000Z0QNAA0,01t36000000pfcKAAQ&validate=true ``` ## Example Result **note:** - An entire result can be thousands of lines long. This example has been truncated. - If a child line item Id is passed in the input request, then the whole bundle is returned in the response. ```nolang { "totalSize": 1, "messages": [], "records": [ { "messages": [], "actions": { "addtocart": { "rest": { "params": { "items": [ { "quantity": 1, "parentId": "8021I00000186qVQAQ", "itemId": "01u1I000000wj9IQAQ" } ], "cartId": "8011I000000KN9dQAG", "price": true, "validate": true, "includeAttachment": false, "pagesize": 10, "lastRecordId": null, "query": null }, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/8011I000000KN9dQAG/items" }, "remote": { "params": { "methodName": "postCartsItems", "items": [ { "quantity": 1, "parentId": "8021I00000186qVQAQ", "itemId": "01u1I000000wj9IQAQ" } ], "cartId": "8011I000000KN9dQAG", "price": true, "validate": true, "includeAttachment": false, "pagesize": 10, "lastRecordId": null, "query": null } }, "client": { "params": {} } }, "updateitems": { "rest": { "params": { "items": [ { "itemId": "8021I00000186qVQAQ" } ], "filters": null, "fields": "vlocity_cmt__BillingAccountId__c, vlocity_cmt__ServiceAccountId__c, Quantity, vlocity_cmt__RecurringTotal__c, vlocity_cmt__OneTimeTotal__c, vlocity_cmt__OneTimeManualDiscount__c, vlocity_cmt__RecurringManualDiscount__c, vlocity_cmt__ProvisioningStatus__c, vlocity_cmt__RecurringCharge__c, vlocity_cmt__OneTimeCharge__c, ListPrice, vlocity_cmt__ParentItemId__c, vlocity_cmt__BillingAccountId__r.Name, vlocity_cmt__ServiceAccountId__r.Name, vlocity_cmt__PremisesId__r.Name, vlocity_cmt__InCartQuantityMap__c", "cartId": "8011I000000KN9dQAG", "price": true, "validate": true, "includeAttachment": false, "pagesize": 10, "lastRecordId": null, "query": null }, "method": "PUT", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/8011I000000KN9dQAG/items" }, "remote": { "params": { "methodName": "putCartsItems", "items": [ { "itemId": "8021I00000186qVQAQ" } ], "filters": null, "fields": "vlocity_cmt__BillingAccountId__c, vlocity_cmt__ServiceAccountId__c, Quantity, vlocity_cmt__RecurringTotal__c, vlocity_cmt__OneTimeTotal__c, vlocity_cmt__OneTimeManualDiscount__c, vlocity_cmt__RecurringManualDiscount__c, vlocity_cmt__ProvisioningStatus__c, vlocity_cmt__RecurringCharge__c, vlocity_cmt__OneTimeCharge__c, ListPrice, vlocity_cmt__ParentItemId__c, vlocity_cmt__BillingAccountId__r.Name, vlocity_cmt__ServiceAccountId__r.Name, vlocity_cmt__PremisesId__r.Name, vlocity_cmt__InCartQuantityMap__c", "cartId": "8011I000000KN9dQAG", "price": true, "validate": true, "includeAttachment": false, "pagesize": 10, "lastRecordId": null, "query": null } }, "client": { "params": {} } }, "deleteitem": { "rest": { "params": {}, "method": "DELETE", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/8011I000000KN9dQAG/items/ 8021I00000186qVQAQ?pagesize=10&includeAttachment=false& validate=true&price=true&cartId=8011I000000KN9dQAG&fields= vlocity_cmt__BillingAccountId__c, vlocity_cmt__ServiceAccountId__c, Quantity, vlocity_cmt__RecurringTotal__c, vlocity_cmt__OneTimeTotal__c, vlocity_cmt__OneTimeManualDiscount__c, vlocity_cmt__RecurringManualDiscount__c, vlocity_cmt__ProvisioningStatus__c, vlocity_cmt__RecurringCharge__c, vlocity_cmt__OneTimeCharge__c, ListPrice, vlocity_cmt__ParentItemId__c, vlocity_cmt__BillingAccountId__r.Name, vlocity_cmt__ServiceAccountId__r.Name, vlocity_cmt__PremisesId__r.Name, vlocity_cmt__InCartQuantityMap__c & id = 8021I00000186qVQAQ" }, "remote": { "params": { "methodName": "deleteCartsItems", "id": "8021I00000186qVQAQ", "filters": null, "fields": "vlocity_cmt__BillingAccountId__c, vlocity_cmt__ServiceAccountId__c, Quantity, vlocity_cmt__RecurringTotal__c, vlocity_cmt__OneTimeTotal__c, vlocity_cmt__OneTimeManualDiscount__c, vlocity_cmt__RecurringManualDiscount__c, vlocity_cmt__ProvisioningStatus__c, vlocity_cmt__RecurringCharge__c, vlocity_cmt__OneTimeCharge__c, ListPrice, vlocity_cmt__ParentItemId__c, vlocity_cmt__BillingAccountId__r.Name, vlocity_cmt__ServiceAccountId__r.Name, vlocity_cmt__PremisesId__r.Name, vlocity_cmt__InCartQuantityMap__c", "cartId": "8011I000000KN9dQAG", "price": true, "validate": true, "includeAttachment": false, "pagesize": 10, "lastRecordId": null, "query": null } }, "client": { "params": {} } }, "configdelete": { "rest": { "params": {}, "method": null, "link": null }, "remote": { "params": { "methodName": "configDeleteItem", "id": "8021I00000186qVQAQ", "cartId": "8011I000000KN9dQAG" } }, "client": { "params": {} } }, "cloneitem": { "rest": { "params": { "items": [ { "itemId": "8021I00000186qVQAQ" } ], "id": "8021I00000186qVQAQ", "cartId": "8011I000000KN9dQAG" }, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/8011I000000KN9dQAG/items/ clone" }, "remote": { "params": { "methodName": "cloneItems", "items": [ { "itemId": "8021I00000186qVQAQ" } ], "id": "8021I00000186qVQAQ", "cartId": "8011I000000KN9dQAG" } }, "client": { "params": {} } }, "modifyattributes": { "rest": { "params": { "items": [ { "itemId": "8021I00000186qVQAQ" } ], "filters": null, "itemId": "8021I00000186qVQAQ", "id": "8021I00000186qVQAQ", "cartId": "8011I000000KN9dQAG" } } } } } ] } ``` **note:** To validate or price a bundle, pass the rootItemId instead of the itemId. ## Enabling Trim Mode **Option 1: Per-Request (Recommended for Controlled Adoption)** Enable Trim Mode for specific API calls using a query parameter: `/services/apexrest/vlocity_cmt/v2/cpq/carts/{cartId}/items?gciTrimMode=true` `/services/apexrest/vlocity_cmt/v2/cpq/carts/{cartId}/items?gciTrimMode=true&fields=UnitPrice,vlocity_cmt\_\_OneTimeCost\_\_c` Use this approach for: - Targeted integrations - Specific UI components - Testing and gradual rollout **Option 2: Org-Wide Configuration** Enable Trim Mode globally via CPQ configuration: - Set `gciTrimMode = true` in CPQ Configuration Setup. This applies to all GetCartItems API calls across the organization. - Configure field set: - Product2.Name - UnitPrice - TotalPrice - Description All responses include default fields, field set fields, and additional fields via fields parameter (if provided). **important:** Trim Mode removes fields from the API response. Any code, UI, or integration that depends on those fields will break unless the fields are explicitly requested. ### Precedence Rules | API Parameter | Config Setting | Result | | ------------- | -------------- | -------- | | TRUE | any | Trim ON | | FALSE | any | Trim OFF | | not provided | TRUE | Trim ON | | not provided | false / unset | Trim OFF | The API parameter always takes precedence. Use `gciTrimMode = false` to override org-wide settings per request. ### Default Fields (Always Included) These 22 fields are always present when trim mode is on, without needing to request them: Id, RootItemId, ParentItemId, AssetReferenceId, LineNumber, Product2Id, PricebookEntryId, OrderId, QuoteId, OpportunityId, Quantity, Status, Action, IsRootItem, ProductHierarchyPath, ProductHierarchyGroupKeyPath, BillingAccountId, ServiceAccountId, InCartQuantityMap, CpqMessageData, CpqCardinalityMessage, CpqPricingMessage ## Usage Examples ### Minimal Cart (Mobile Optimization) `/services/apexrest/vlocity_cmt/v2/cpq/carts/{cartId}/items?gciTrimMode=true&fields=Product2.Name,TotalPrice` Returns a lightweight payload (~24 fields vs 150+). ### Cost Analysis Dashboard `/services/apexrest/vlocity_cmt/v2/cpq/carts/{cartId}/items?gciTrimMode=true&fields=UnitPrice,vlocity_cmt__OneTimeCost__c,vlocity_cmt__RecurringCost__c,vlocity_cmt__OneTimeMargin__c` ### Override Org-Wide Trim Mode `/services/apexrest/vlocity_cmt/v2/cpq/carts/{cartId}/items?gciTrimMode=false` Returns full response regardless of org settings. # Get Line Items by ID Return the items and configurable attributes based on item IDs. ```nolang GET /v2/cpq/carts/{cart_ID}/items?id={item_ID},{item_ID}&validate={true|false} ``` ## Get Cart Items Trim Mode Trim Mode is an optimization feature that reduces the payload size of the GetCartItems API response. Instead of returning the full set of cart item fields, Trim Mode restricts the response to only what is explicitly required. When enabled, the API response includes these: - A fixed set of 22 default fields (identity, hierarchy, and status) - Fields specified via the fields query parameter - Fields defined in the `GCITrimFieldsToInclude` field set in Salesforce All other fields are removed from the response. Structural nodes such as `PricebookEntry`, `Product2`, and `productChildItemDefinition` are always preserved. **important:** Trim Mode applies only to: - getCartItemList - getCartItemListById See, [Enabling Trim Mode](#enabling-trim-mode) ## Remote Method ```nolang getCartsItemsById ``` ## REST Handler ```nolang APIItemsCartsCpqV2 ``` ## Apex Remote Service ```nolang CpqAppHandler ``` ## Apex Remote Input Map ```nolang { methodName:getCartsItemsById, cartId:801360000008eNU, id:01t36000000pfcKAAQ,01t36000000pfcKAAQ } cartId = order.Id, opportunity.Id, quote.Id ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | ------------------------------------------------------------------------------------------------------------------ | | Resource URL | /services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/items?id=802xx000001o0EFAAY,802xx000001o0FrAAI&validate=true | ## Example Request ```nolang GET /services/apexrest/vlocity_cmt/v2/cpq/carts/80136000000aSTqAAM/items?id=802xx000001o0EFAAY,802xx000001o0FrAAI&validate=true ``` ## Example Result **note:** - An entire result can be thousands of lines long. This example has been truncated. - If a child line item Id is passed in the input request, then the whole bundle is returned in the response. ```nolang { "totalSize":2 "messages":[] "actions":{ "itempricesupdated":{ "rest":{ "params":{} "method":"GET" "link":"/services/apexrest/vlocity_cmt/v2/cpq/carts/801xx000003H0UlAAK/price?price=false&cartId=801xx000003H0UlAAK" } "remote":{} "client":{} } } "records":[ { "messages":[] "actions":{} "displaySequence":-1 "productChildItemDefinition":{} "isVirtualItem":false "sequenceNumber":1 "groupMinQuantity":0 "productId":"01txx0000007CF2AAM" "Product2":{} "maxQuantity":99999 "ProductCode":"Internet5G" "IsActive":true "hasChildren":false "defaultQuantity":1 "groupMaxQuantity":99999 "PricebookEntry":{} "Name":"Internet5G" "UnitPrice":{} "Product2Id":"01txx0000007CF2AAM" "productChildItemId":"a3Pxx0000004nmuEAA" "minQuantity":0 "name":"Internet5G" "Pricebook2Id":"01sxx0000005qRhAAI" "action":"Add" "productHierarchyPath":"01txx0000007CF2AAM" "vlocity_cmt__RecurringPrice__c":50 "orderActive":false "itemType":"lineItem" "SellingPeriod":"Present" "vlocity_cmt__ProductGroupKey__c":{} "vlocity_cmt__RecurringDiscountPrice__c":{} "vlocity_cmt__ParentItemId__c":{} "vlocity_cmt__ItemName__c":{} "vlocity_cmt__EffectiveOneTimeTotal__c":{} "vlocity_cmt__EffectiveRecurringTotal__c":{} "vlocity_cmt__CatalogItemReferenceDateTime__c":{} "ListPrice":{} "vlocity_cmt__CpqCardinalityMessage__c":{} "vlocity_cmt__RecurringManualDiscount__c":{} "vlocity_cmt__IsChangesAllowed__c":{} "vlocity_cmt__CpqPricingMessage__c":{} "vlocity_cmt__OneTimeTotal__c":{} "vlocity_cmt__FulfilmentStatus__c":{} "vlocity_cmt__LineNumber__c":{} "vlocity_cmt__ServiceAccountId__c":{} "vlocity_cmt__RecurringCharge__c":{} "vlocity_cmt__OneTimeCharge__c":{} "vlocity_cmt__SubAction__c":{} "vlocity_cmt__CurrencyPaymentMode__c":{} "vlocity_cmt__ProductHierarchyGroupKeyPath__c":{} "vlocity_cmt__SupersededOrderItemId__c":{} "vlocity_cmt__RecurringTotal__c":{} "vlocity_cmt__SupplementalAction__c":{} "vlocity_cmt__Product2Id__c":{} "vlocity_cmt__OrderGroupId__c":{} "vlocity_cmt__Action__c":{} "Quantity":{} "vlocity_cmt__OneTimeManualDiscount__c":{} "OrderId":{} "vlocity_cmt__EffectiveQuantity__c":{} "vlocity_cmt__BillingAccountId__c":{} "vlocity_cmt__ProvisioningStatus__c":{} "vlocity_cmt__AssetReferenceId__c":{} "vlocity_cmt__InCartQuantityMap__c":{} "vlocity_cmt__FirstVersionOrderItemId__c":{} "PricebookEntryId":{} "vlocity_cmt__ProductHierarchyPath__c":{} "vlocity_cmt__RootItemId__c":{} "vlocity_cmt__CpqMessageData__c":{} "Id":{} "vlocity_cmt__RecurringCalculatedPrice__c":{} "vlocity_cmt__OneTimeCalculatedPrice__c":{} "productCategories":{} "vlocity_cmt__ServiceAccountId__r":{} "vlocity_cmt__BillingAccountId__r":{} } { "messages":[] "actions":{} "displaySequence":-1 "productChildItemDefinition":{} "isVirtualItem":false "sequenceNumber":1 "groupMinQuantity":0 "productId":"01txx0000007CBoAAM" "Product2":{} "maxQuantity":99999 "ProductCode":"Iphone16" "IsActive":true "hasChildren":true "defaultQuantity":1 "groupMaxQuantity":99999 "PricebookEntry":{} "Name":"Iphone16" "UnitPrice":{} "Product2Id":"01txx0000007CBoAAM" "productChildItemId":"a3Pxx0000004ni4EAA" "minQuantity":0 "name":"Iphone16" "Pricebook2Id":"01sxx0000005qRhAAI" "action":"Add" "productHierarchyPath":"01txx0000007CBoAAM" "vlocity_cmt__RecurringPrice__c":50 "orderActive":false "itemType":"lineItem" "SellingPeriod":"Present" "vlocity_cmt__ProductGroupKey__c":{} "vlocity_cmt__RecurringDiscountPrice__c":{} "vlocity_cmt__ParentItemId__c":{} "vlocity_cmt__ItemName__c":{} "vlocity_cmt__EffectiveOneTimeTotal__c":{} "vlocity_cmt__EffectiveRecurringTotal__c":{} "vlocity_cmt__CatalogItemReferenceDateTime__c":{} "ListPrice":{} "vlocity_cmt__CpqCardinalityMessage__c":{} "vlocity_cmt__RecurringManualDiscount__c":{} "vlocity_cmt__IsChangesAllowed__c":{} "vlocity_cmt__CpqPricingMessage__c":{} "vlocity_cmt__OneTimeTotal__c":{} "vlocity_cmt__FulfilmentStatus__c":{} "vlocity_cmt__LineNumber__c":{} "vlocity_cmt__ServiceAccountId__c":{} "vlocity_cmt__RecurringCharge__c":{} "vlocity_cmt__OneTimeCharge__c":{} "vlocity_cmt__SubAction__c":{} "vlocity_cmt__CurrencyPaymentMode__c":{} "vlocity_cmt__ProductHierarchyGroupKeyPath__c":{} "vlocity_cmt__SupersededOrderItemId__c":{} "vlocity_cmt__RecurringTotal__c":{} "vlocity_cmt__SupplementalAction__c":{} "vlocity_cmt__Product2Id__c":{} "vlocity_cmt__OrderGroupId__c":{} "vlocity_cmt__Action__c":{} "Quantity":{} "vlocity_cmt__OneTimeManualDiscount__c":{} "OrderId":{} "vlocity_cmt__EffectiveQuantity__c":{} "vlocity_cmt__BillingAccountId__c":{} "vlocity_cmt__ProvisioningStatus__c":{} "vlocity_cmt__AssetReferenceId__c":{} "vlocity_cmt__InCartQuantityMap__c":{} "vlocity_cmt__FirstVersionOrderItemId__c":{} "PricebookEntryId":{} "vlocity_cmt__ProductHierarchyPath__c":{} "vlocity_cmt__RootItemId__c":{} "vlocity_cmt__CpqMessageData__c":{} "Id":{} "vlocity_cmt__RecurringCalculatedPrice__c":{} "vlocity_cmt__OneTimeCalculatedPrice__c":{} "productCategories":{} "vlocity_cmt__ServiceAccountId__r":{} "vlocity_cmt__BillingAccountId__r":{} "lineItems":{} } ] } ``` **note:** To validate or price a bundle, pass the rootItemId instead of the itemId. ## Enabling Trim Mode **Option 1: Per-Request (Recommended for Controlled Adoption)** Enable Trim Mode for specific API calls using a query parameter: `/services/apexrest/vlocity_cmt/v2/cpq/carts/{cartId}/items?gciTrimMode=true` `/services/apexrest/vlocity_cmt/v2/cpq/carts/{cartId}/items?gciTrimMode=true&fields=UnitPrice,vlocity_cmt\_\_OneTimeCost\_\_c` Use this approach for: - Targeted integrations - Specific UI components - Testing and gradual rollout **Option 2: Org-Wide Configuration** Enable Trim Mode globally via CPQ configuration: - Set `gciTrimMode = true` in CPQ Configuration Setup. This applies to all GetCartItems API calls across the organization. - Configure field set: - Product2.Name - UnitPrice - TotalPrice - Description All responses include default fields, field set fields, and additional fields via fields parameter (if provided). **important:** Trim Mode removes fields from the API response. Any code, UI, or integration that depends on those fields will break unless the fields are explicitly requested. ### Precedence Rules | API Parameter | Config Setting | Result | | ------------- | -------------- | -------- | | TRUE | any | Trim ON | | FALSE | any | Trim OFF | | not provided | TRUE | Trim ON | | not provided | false / unset | Trim OFF | The API parameter always takes precedence. Use `gciTrimMode = false` to override org-wide settings per request. ### Default Fields (Always Included) These 22 fields are always present when trim mode is on, without needing to request them: Id, RootItemId, ParentItemId, AssetReferenceId, LineNumber, Product2Id, PricebookEntryId, OrderId, QuoteId, OpportunityId, Quantity, Status, Action, IsRootItem, ProductHierarchyPath, ProductHierarchyGroupKeyPath, BillingAccountId, ServiceAccountId, InCartQuantityMap, CpqMessageData, CpqCardinalityMessage, CpqPricingMessage ## Usage Examples ### Minimal Cart (Mobile Optimization) `/services/apexrest/vlocity_cmt/v2/cpq/carts/{cartId}/items?gciTrimMode=true&fields=Product2.Name,TotalPrice` Returns a lightweight payload (~24 fields vs 150+). ### Cost Analysis Dashboard `/services/apexrest/vlocity_cmt/v2/cpq/carts/{cartId}/items?gciTrimMode=true&fields=UnitPrice,vlocity_cmt__OneTimeCost__c,vlocity_cmt__RecurringCost__c,vlocity_cmt__OneTimeMargin__c` ### Override Org-Wide Trim Mode `/services/apexrest/vlocity_cmt/v2/cpq/carts/{cartId}/items?gciTrimMode=false` Returns full response regardless of org settings. # Get List of Products Return the list of products that match the specified criteria. - Query with the text the customer enters - Attributes - Product hierarchy - The last record ID from the previous search result, if available - The page size of the number of products to return; the default is 20 **note:** In Vlocity CMT V15, if the page size is set to 20, the API does not return images. - Product IDs ```nolang GET /v2/cpq/carts/{cart_ID}/products?query={query}&attributes={attribute_code:value}&lastRecordId={record_ID}&pagesize={n}&includeAttachment={true|false}&category={category}&filters={filters}&includeIneligible={true|false} ``` Use includeAttachment to indicate whether product attachments are returned. The value specified for attribute_code must be the Code of the Attribute, not the Name or ID. The attributes filter for picklist type attributes takes into account all possible values, not just the selected value. If you want to filter based on specific Attribute Values, then assign the Attribute Value Type as Multi Picklist. Use the `includeIneligible=true` parameter if you are using context rules to control product visibility in the product list. You can use the category field to see if a product is qualified or disqualified To specify a product name using a locale other than the user's locale, set the localeCode parameter to the desired locale and the query parameter to the name of the product. For example: ```nolang GET /services/apexrest/vlocity_cmt/v2/cpq/carts/8011N000002BL2P/products?localeCode=fr&query=échantillon ``` Get Products replaces the OmniCPQServiceWrapper getProducts method. 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. **note:** - If a Simple Offer Specification is associated with a Simple Product Specification, the API returns the Min, Max, and Default cardinality from the Simple Product Specification. - This applies only to the response. When adding items to the cart (postCartsItems), the system enforces the stricter cardinality defined in the Simple Offer Specification, even if the response shows different values. ## Remote Method ```nolang getCartsProducts ``` ## REST Handler ```nolang APIProductsCartsCpqV2 ``` ## Apex Remote Service ```nolang CpqAppHandler ``` ## Apex Remote Input Map ```nolang { methodName:getCartsProducts, cartId:801360000008eNU, query:iphone, attributes: ATT_DEVICESIZE:32GB_64GB,ATT_DEVICECOLOR:RED, maxProdListHierarchy: 1, lastProductId:, pagesize: 10, includeAttachment: true, fields: Product2.vlocity_cmt__CustomField__c } cartId = order.Id, opportunity.Id, quote.Id ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | ---------------------------------------------------------------- | | Resource URL | `/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/products` | ## Example Request ```nolang GET /services/apexrest/vlocity_cmt/v2/cpq/carts/80141000000Cg8H/products?pagesize=5 ``` ## Example Response ```nolang { "totalSize": 5, "messages": [], "actions": { "nextproducts": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80141000000Cg8HAAS/products?lastRecordId=01u41000001QPtsAAG&pagesize=5&includeAttachment=false" }, "remote": { "params": { "includeAttachment": false, "pagesize": 5, "lastRecordId": "01u41000001QPtsAAG", "cartId": "80141000000Cg8HAAS", "methodName": "getCartsProducts" } }, "client": { "params": {} } } }, "records": [ { "messages": [], "actions": { "addtocart": { "rest": { "params": { "price": true, "validate": true, "includeAttachment": false, "pagesize": 5, "lastRecordId": null, "query": null, "items": [ { "quantity": 1, "itemId": "01u41000001QPs0AAG" } ] }, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80141000000Cg8HAAS/items" }, "remote": { "params": { "price": true, "validate": true, "includeAttachment": false, "pagesize": 5, "lastRecordId": null, "query": null, "items": [ { "quantity": 1, "itemId": "01u41000001QPs0AAG" } ], "cartId": "80141000000Cg8HAAS", "methodName": "postCartsItems" } }, "client": { "params": {} } } }, "displaySequence": -1, "Id": { "label": "Price Book Entry ID", "value": "01u41000001QPs0AAG" }, "Pricebook2Id": { "label": "Price Book ID", "value": "01s41000005dPYQAA2" }, "Product2Id": { "label": "Product ID", "value": "01t41000000sYZQAA2" }, "UnitPrice": { "label": "List Price", "value": 1 }, "Name": { "label": "Product Name", "value": "Root 1" }, "IsActive": { "label": "Active", "value": true }, "Product2": { "attributes": { "type": "Product2", "url": "/services/data/v38.0/sobjects/Product2/01t41000000sYZQAA2" }, "Id": "01t41000000sYZQAA2", "Name": "Root 1", "vlocity_cmt__IsConfigurable__c": false, "vlocity_cmt__Type__c": "None", "vlocity_cmt__SubType__c": "None", "RecordTypeId": "012410000006OWUAA2" }, "productId": "01t41000000sYZQAA2", "defaultQuantity": 1, "minQuantity": 0, "maxQuantity": 99999, "groupMinQuantity": 0, "groupMaxQuantity": 99999, "sequenceNumber": 1, "productChildItemId": "a2541000000G09wAAC", "productChildItemDefinition": { "attributes": { "type": "vlocity_cmt__ProductChildItem__c", "url": "/services/data/v38.0/sobjects/vlocity_cmt__ProductChildItem__c/a2541000000G09wAAC" }, "Id": "a2541000000G09wAAC", "Name": "Root PCI", "vlocity_cmt__IsVirtualItem__c": false, "vlocity_cmt__Quantity__c": 1, "vlocity_cmt__MaxQuantity__c": 99999, "vlocity_cmt__MinQuantity__c": 0, "vlocity_cmt__MaximumChildItemQuantity__c": 99999, "vlocity_cmt__MinimumChildItemQuantity__c": 0, "vlocity_cmt__IsOverride__c": false, "vlocity_cmt__ParentProductId__c": "01t41000000sYZQAA2", "vlocity_cmt__ChildLineNumber__c": "1", "vlocity_cmt__SeqNumber__c": 1, "vlocity_cmt__CollapseHierarchy__c": false, "vlocity_cmt__IsRootProductChildItem__c": true, "vlocity_cmt__ParentProductId__r": { "attributes": { "type": "Product2", "url": "/services/data/v38.0/sobjects/Product2/01t41000000sYZQAA2" }, "Id": "01t41000000sYZQAA2", "Name": "Root 1" } }, "productHierarchyPath": "01t41000000sYZQAA2", "name": "Root 1", "isVirtualItem": false, "attributeValues": {}, "itemType": "childProduct" }, { "messages": [], "actions": { "addtocart": { "rest": { "params": { "price": true, "validate": true, "includeAttachment": false, "pagesize": 5, "lastRecordId": null, "query": null, "items": [ { "quantity": 1, "itemId": "01u41000001QPs5AAG" } ] }, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80141000000Cg8HAAS/items" }, "remote": { "params": { "price": true, "validate": true, "includeAttachment": false, "pagesize": 5, "lastRecordId": null, "query": null, "items": [ { "quantity": 1, "itemId": "01u41000001QPs5AAG" } ], "cartId": "80141000000Cg8HAAS", "methodName": "postCartsItems" } }, "client": { "params": {} } } }, "displaySequence": -1, "Id": { "label": "Price Book Entry ID", "value": "01u41000001QPs5AAG" }, "Pricebook2Id": { "label": "Price Book ID", "value": "01s41000005dPYQAA2" }, "Product2Id": { "label": "Product ID", "value": "01t41000000sYZVAA2" }, "UnitPrice": { "label": "List Price", "value": 2 }, "Name": { "label": "Product Name", "value": "Parent 1" }, "IsActive": { "label": "Active", "value": true }, "Product2": { "attributes": { "type": "Product2", "url": "/services/data/v38.0/sobjects/Product2/01t41000000sYZVAA2" }, "Id": "01t41000000sYZVAA2", "Name": "Parent 1", "vlocity_cmt__IsConfigurable__c": false, "vlocity_cmt__Type__c": "None", "vlocity_cmt__SubType__c": "None", "RecordTypeId": "012410000006OWUAA2" }, "productId": "01t41000000sYZVAA2", "defaultQuantity": 1, "minQuantity": 0, "maxQuantity": 99999, "groupMinQuantity": 0, "groupMaxQuantity": 99999, "sequenceNumber": 1, "productChildItemId": "a2541000000G0A1AAK", "productChildItemDefinition": { "attributes": { "type": "vlocity_cmt__ProductChildItem__c", "url": "/services/data/v38.0/sobjects/vlocity_cmt__ProductChildItem__c/a2541000000G0A1AAK" }, "Id": "a2541000000G0A1AAK", "Name": "Root PCI", "vlocity_cmt__IsVirtualItem__c": false, "vlocity_cmt__Quantity__c": 1, "vlocity_cmt__MaxQuantity__c": 99999, "vlocity_cmt__MinQuantity__c": 0, "vlocity_cmt__MaximumChildItemQuantity__c": 99999, "vlocity_cmt__MinimumChildItemQuantity__c": 0, "vlocity_cmt__IsOverride__c": false, "vlocity_cmt__ParentProductId__c": "01t41000000sYZVAA2", "vlocity_cmt__ChildLineNumber__c": "1", "vlocity_cmt__SeqNumber__c": 1, "vlocity_cmt__CollapseHierarchy__c": false, "vlocity_cmt__IsRootProductChildItem__c": true, "vlocity_cmt__ParentProductId__r": { "attributes": { "type": "Product2", "url": "/services/data/v38.0/sobjects/Product2/01t41000000sYZVAA2" }, "Id": "01t41000000sYZVAA2", "Name": "Parent 1" } }, "productHierarchyPath": "01t41000000sYZVAA2", "name": "Parent 1", "isVirtualItem": false, "attributeValues": {}, "itemType": "childProduct" }, { "messages": [], "actions": { "addtocart": { "rest": { "params": { "price": true, "validate": true, "includeAttachment": false, "pagesize": 5, "lastRecordId": null, "query": null, "items": [ { "quantity": 1, "itemId": "01u41000001QPtmAAG" } ] }, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80141000000Cg8HAAS/items" }, "remote": { "params": { "price": true, "validate": true, "includeAttachment": false, "pagesize": 5, "lastRecordId": null, "query": null, "items": [ { "quantity": 1, "itemId": "01u41000001QPtmAAG" } ], "cartId": "80141000000Cg8HAAS", "methodName": "postCartsItems" } }, "client": { "params": {} } } }, "displaySequence": -1, "Id": { "label": "Price Book Entry ID", "value": "01u41000001QPtmAAG" }, "Pricebook2Id": { "label": "Price Book ID", "value": "01s41000005dPYQAA2" }, "Product2Id": { "label": "Product ID", "value": "01t41000000sYaIAAU" }, "UnitPrice": { "label": "List Price", "value": 1 }, "Name": { "label": "Product Name", "value": "Child 1" }, "IsActive": { "label": "Active", "value": true }, "Product2": { "attributes": { "type": "Product2", "url": "/services/data/v38.0/sobjects/Product2/01t41000000sYaIAAU" }, "Id": "01t41000000sYaIAAU", "Name": "Child 1", "vlocity_cmt__IsConfigurable__c": false, "vlocity_cmt__Type__c": "None", "vlocity_cmt__SubType__c": "None", "RecordTypeId": "012410000006OWUAA2" }, "productId": "01t41000000sYaIAAU", "defaultQuantity": 1, "minQuantity": 0, "maxQuantity": 99999, "groupMinQuantity": 0, "groupMaxQuantity": 99999, "sequenceNumber": 1, "productChildItemId": "a2541000000G0A6AAK", "productChildItemDefinition": { "attributes": { "type": "vlocity_cmt__ProductChildItem__c", "url": "/services/data/v38.0/sobjects/vlocity_cmt__ProductChildItem__c/a2541000000G0A6AAK" }, "Id": "a2541000000G0A6AAK", "Name": "Root PCI", "vlocity_cmt__IsVirtualItem__c": false, "vlocity_cmt__Quantity__c": 1, "vlocity_cmt__MaxQuantity__c": 99999, "vlocity_cmt__MinQuantity__c": 0, "vlocity_cmt__MaximumChildItemQuantity__c": 99999, "vlocity_cmt__MinimumChildItemQuantity__c": 0, "vlocity_cmt__IsOverride__c": false, "vlocity_cmt__ParentProductId__c": "01t41000000sYaIAAU", "vlocity_cmt__ChildLineNumber__c": "1", "vlocity_cmt__SeqNumber__c": 1, "vlocity_cmt__CollapseHierarchy__c": false, "vlocity_cmt__IsRootProductChildItem__c": true, "vlocity_cmt__ParentProductId__r": { "attributes": { "type": "Product2", "url": "/services/data/v38.0/sobjects/Product2/01t41000000sYaIAAU" }, "Id": "01t41000000sYaIAAU", "Name": "Child 1" } }, "productHierarchyPath": "01t41000000sYaIAAU", "name": "Child 1", "isVirtualItem": false, "attributeValues": {}, "itemType": "childProduct" }, { "messages": [], "actions": { "addtocart": { "rest": { "params": { "price": true, "validate": true, "includeAttachment": false, "pagesize": 5, "lastRecordId": null, "query": null, "items": [ { "quantity": 1, "itemId": "01u41000001QPtrAAG" } ] }, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80141000000Cg8HAAS/items" }, "remote": { "params": { "price": true, "validate": true, "includeAttachment": false, "pagesize": 5, "lastRecordId": null, "query": null, "items": [ { "quantity": 1, "itemId": "01u41000001QPtrAAG" } ], "cartId": "80141000000Cg8HAAS", "methodName": "postCartsItems" } }, "client": { "params": {} } } }, "displaySequence": -1, "Id": { "label": "Price Book Entry ID", "value": "01u41000001QPtrAAG" }, "Pricebook2Id": { "label": "Price Book ID", "value": "01s41000005dPYQAA2" }, "Product2Id": { "label": "Product ID", "value": "01t41000000sYaNAAU" }, "UnitPrice": { "label": "List Price", "value": 1 }, "Name": { "label": "Product Name", "value": "GC 1" }, "IsActive": { "label": "Active", "value": true }, "Product2": { "attributes": { "type": "Product2", "url": "/services/data/v38.0/sobjects/Product2/01t41000000sYaNAAU" }, "Id": "01t41000000sYaNAAU", "Name": "GC 1", "vlocity_cmt__IsConfigurable__c": false, "vlocity_cmt__Type__c": "None", "vlocity_cmt__SubType__c": "None", "RecordTypeId": "012410000006OWUAA2" }, "productId": "01t41000000sYaNAAU", "defaultQuantity": 1, "minQuantity": 0, "maxQuantity": 99999, "groupMinQuantity": 0, "groupMaxQuantity": 99999, "sequenceNumber": 1, "productChildItemId": "a2541000000G0ABAA0", "productChildItemDefinition": { "attributes": { "type": "vlocity_cmt__ProductChildItem__c", "url": "/services/data/v38.0/sobjects/vlocity_cmt__ProductChildItem__c/a2541000000G0ABAA0" }, "Id": "a2541000000G0ABAA0", "Name": "Root PCI", "vlocity_cmt__IsVirtualItem__c": false, "vlocity_cmt__Quantity__c": 1, "vlocity_cmt__MaxQuantity__c": 99999, "vlocity_cmt__MinQuantity__c": 0, "vlocity_cmt__MaximumChildItemQuantity__c": 99999, "vlocity_cmt__MinimumChildItemQuantity__c": 0, "vlocity_cmt__IsOverride__c": false, "vlocity_cmt__ParentProductId__c": "01t41000000sYaNAAU", "vlocity_cmt__ChildLineNumber__c": "1", "vlocity_cmt__SeqNumber__c": 1, "vlocity_cmt__CollapseHierarchy__c": false, "vlocity_cmt__IsRootProductChildItem__c": true, "vlocity_cmt__ParentProductId__r": { "attributes": { "type": "Product2", "url": "/services/data/v38.0/sobjects/Product2/01t41000000sYaNAAU" }, "Id": "01t41000000sYaNAAU", "Name": "GC 1" } }, "productHierarchyPath": "01t41000000sYaNAAU", "name": "GC 1", "isVirtualItem": false, "attributeValues": {}, "itemType": "childProduct" }, { "messages": [], "actions": { "addtocart": { "rest": { "params": { "price": true, "validate": true, "includeAttachment": false, "pagesize": 5, "lastRecordId": null, "query": null, "items": [ { "quantity": 1, "itemId": "01u41000001QPtsAAG" } ] }, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80141000000Cg8HAAS/items" }, "remote": { "params": { "price": true, "validate": true, "includeAttachment": false, "pagesize": 5, "lastRecordId": null, "query": null, "items": [ { "quantity": 1, "itemId": "01u41000001QPtsAAG" } ], "cartId": "80141000000Cg8HAAS", "methodName": "postCartsItems" } }, "client": { "params": {} } } }, "displaySequence": -1, "Id": { "label": "Price Book Entry ID", "value": "01u41000001QPtsAAG" }, "Pricebook2Id": { "label": "Price Book ID", "value": "01s41000005dPYQAA2" }, "Product2Id": { "label": "Product ID", "value": "01t41000000sYaSAAU" }, "UnitPrice": { "label": "List Price", "value": 1 }, "Name": { "label": "Product Name", "value": "GC 2" }, "IsActive": { "label": "Active", "value": true }, "Product2": { "attributes": { "type": "Product2", "url": "/services/data/v38.0/sobjects/Product2/01t41000000sYaSAAU" }, "Id": "01t41000000sYaSAAU", "Name": "GC 2", "vlocity_cmt__IsConfigurable__c": false, "vlocity_cmt__Type__c": "None", "vlocity_cmt__SubType__c": "None", "RecordTypeId": "012410000006OWUAA2" }, "productId": "01t41000000sYaSAAU", "defaultQuantity": 1, "minQuantity": 0, "maxQuantity": 99999, "groupMinQuantity": 0, "groupMaxQuantity": 99999, "sequenceNumber": 1, "productChildItemId": "a2541000000G0AGAA0", "productChildItemDefinition": { "attributes": { "type": "vlocity_cmt__ProductChildItem__c", "url": "/services/data/v38.0/sobjects/vlocity_cmt__ProductChildItem__c/a2541000000G0AGAA0" }, "Id": "a2541000000G0AGAA0", "Name": "Root PCI", "vlocity_cmt__IsVirtualItem__c": false, "vlocity_cmt__Quantity__c": 1, "vlocity_cmt__MaxQuantity__c": 99999, "vlocity_cmt__MinQuantity__c": 0, "vlocity_cmt__MaximumChildItemQuantity__c": 99999, "vlocity_cmt__MinimumChildItemQuantity__c": 0, "vlocity_cmt__IsOverride__c": false, "vlocity_cmt__ParentProductId__c": "01t41000000sYaSAAU", "vlocity_cmt__ChildLineNumber__c": "1", "vlocity_cmt__SeqNumber__c": 1, "vlocity_cmt__CollapseHierarchy__c": false, "vlocity_cmt__IsRootProductChildItem__c": true, "vlocity_cmt__ParentProductId__r": { "attributes": { "type": "Product2", "url": "/services/data/v38.0/sobjects/Product2/01t41000000sYaSAAU" }, "Id": "01t41000000sYaSAAU", "Name": "GC 2" } }, "productHierarchyPath": "01t41000000sYaSAAU", "name": "GC 2", "isVirtualItem": false, "attributeValues": {}, "itemType": "childProduct" } ] } ``` # Get List of Products The `getCartsProducts` API provides a flexible and efficient way to retrieve a tailored list of products for a specific cart, based on the cart's Price List and business context. It supports advanced filtering, pagination, localization, and the inclusion of product attachments. **Key Parameters:** - **Pagination Controls**: `pagesize` and `offsetSize` work together to navigate large catalogs efficiently, while `lastRecordId` enables cursor-based pagination for better performance. - **Filtering Options**: `query`, `attributes`, `filters`, and `category` allow for precise product selection based on text search, attribute values, field values, and product categories. - **Response Customization**: `includeIneligible`, `includeAttachments`, `includeAttributes`, and `fields` let you control what data is included in the response. - **Performance Optimization**: `maxRecords` and `eaCacheKey` enable efficient caching for faster repeated queries. - **Business Rules**: `eaCheck` and `filterByPriceListOnly` apply eligibility rules and price list restrictions to the returned products. **Caching Enhancement:** - Optimized caching is available using `maxRecords` (max 1000) and `eaCacheKey` parameters, improving response times for recurring queries. - Both parameters must be present to enable caching. 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. **note:** - If a Simple Offer Specification is associated with a Simple Product Specification, the API returns the Min, Max, and Default cardinality from the Simple Product Specification. - This applies only to the response. When adding items to the cart (postCartsItems), the system enforces the stricter cardinality defined in the Simple Offer Specification, even if the response shows different values. - The `getCartsProducts` API does not support combining filters and query parameters. ## Remote Method ```nolang getCartsProducts ``` ## REST Handler ```nolang APIProductsCartsCpqV2 ``` ## Apex Remote Service ```nolang CpqAppHandler ``` ## Apex Remote Input Map ```nolang { "methodName": "getCartsProducts", "cartId": "801xx000003HC67", "pagesize": 10, "offsetSize": 0, "filterByPriceListOnly": true, "sortBy": "DESC", "includeIneligible": true, "includeAttachment": false } ``` - `cartId` can be an Order, Opportunity, or Quote ID. ## REST Handler ```nolang APIProductsCartsCpqV2 ``` ## REST Method ```nolang getProducts ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information - **Resource URL:** `/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/products` - **Response Format:** JSON ## Example REST Request ```http GET /v2/cpq/carts/{cart_ID}/products?query={query}&attributes={attribute_code:value}&lastRecordId={record_ID}&pagesize={n}&includeAttachment={true|false}&category={category}&filters={filters}&includeIneligible={true|false} ``` ## Example REST Response ```nolang { "totalSize": 3, "messages": [ ], "actions": { "nextproducts": { "rest": { "params": { }, "method": "GET", "link": "/services/apexrest/devops001gs0/v2/cpq/carts/801LT00000kkMXhYAM/products?offsetSize=3&maxRecords=50&includeAttachment=false&cartId=801LT00000kkMXhYAM&pagesize=3&includeIneligible=true" }, "remote": { "params": { } }, "client": { "params": { } } } }, "records": [ { "messages": [ ], "actions": { "addtocart": { "rest": { "params": { "validate": true, "items": [ { "itemId": "01uLT0000073akTYAQ" } ], "pagesize": 3, "cartId": "801LT00000kkMXhYAM", "hierarchy": -1, "query": null, "price": true, "includeAttachment": false, "lastRecordId": null }, "method": "POST", "link": "/services/apexrest/devops001gs0/v2/cpq/carts/801LT00000kkMXhYAM/items" }, "remote": { "params": { } }, "client": { "params": { } } }, "getproductbyid": { "rest": { "params": { }, "method": "GET", "link": "/services/apexrest/devops001gs0/v2/cpq/carts/801LT00000kkMXhYAM/products?cartId=801LT00000kkMXhYAM&id=01uLT0000073akTYAQ" }, "remote": { "params": { } }, "client": { "params": { "methodName": "getCartsProductsById", "cartId": "801LT00000kkMXhYAM", "id": "01uLT0000073akTYAQ" } } } }, "displaySequence": -1, "productCategories": { "messages": [ ], "totalSize": 0 }, "Product2": { "devops001gs0__SubType__c": "None", "devops001gs0__Type__c": "None", "devops001gs0__GlobalGroupKey__c": "1ecc268f-35be-7ae2-21cd-727b56a4d39e", "devops001gs0__IsConfigurable__c": false, "Name": "PRODUCT-46223", "Id": "01tLT0000093Pr7YAE", "attributes": { "url": "/services/data/v65.0/sobjects/Product2/01tLT0000093Pr7YAE", "type": "Product2" }, "RecordTypeId": "012LT000001fxpRYAQ" }, "productChildItemDefinition": { "devops001gs0__ParentProductId__c": "01tLT0000093Pr7YAE", "Name": "Root PCI", "devops001gs0__ParentProductId__r": { "devops001gs0__ProductSpecId__c": null, "Id": "01tLT0000093Pr7YAE", "Name": "PRODUCT-46223", "devops001gs0__GlobalGroupKey__c": "1ecc268f-35be-7ae2-21cd-727b56a4d39e" }, "devops001gs0__MinQuantity__c": 0, "devops001gs0__MaxQuantity__c": 99999, "devops001gs0__MinimumChildItemQuantity__c": 0, "devops001gs0__MaximumChildItemQuantity__c": 99999, "devops001gs0__Quantity__c": 1, "devops001gs0__SeqNumber__c": 1, "devops001gs0__ChildLineNumber__c": "1.0", "devops001gs0__IsRootProductChildItem__c": true, "devops001gs0__IsOverride__c": false, "Id": "a41LT0000006TQjYAM", "devops001gs0__CollapseHierarchy__c": false, "devops001gs0__IsVirtualItem__c": false }, "devops001gs0__RecurringPrice__c": { "label": "Recurring Price", "value": 277.37 }, "UnitPrice": { "label": "List Price", "value": 3472.87 }, "IsActive": { "label": "Active", "value": true }, "Name": { "label": "Product Name", "value": "PRODUCT-46223" }, "ProductCode": { "label": "Product Code", "value": "CODE-88388" }, "Product2Id": { "label": "Product ID", "value": "01tLT0000093Pr7YAE" }, "Pricebook2Id": { "label": "Price Book ID", "value": "01sLT000002oxi5YAA" }, "Id": { "label": "Price Book Entry ID", "value": "01uLT0000073akTYAQ" }, "defaultQuantity": 1, "minQuantity": 0, "maxQuantity": 99999, "groupMinQuantity": 0, "groupMaxQuantity": 99999, "sequenceNumber": 1, "productChildItemId": "a41LT0000006TQjYAM", "productHierarchyPath": "01tLT0000093Pr7YAE", "productId": "01tLT0000093Pr7YAE", "name": "PRODUCT-46223", "isVirtualItem": false, "hasChildren": false, "itemType": "childProduct", "SellingPeriod": "Present", "CurrencyCode": "USD", "category": "Qualified" }, { "messages": [ ], "actions": { "addtocart": { "rest": { "params": { "validate": true, "items": [ { "itemId": "01uLT0000073aHRYAY" } ], "pagesize": 3, "cartId": "801LT00000kkMXhYAM", "hierarchy": -1, "query": null, "price": true, "includeAttachment": false, "lastRecordId": null }, "method": "POST", "link": "/services/apexrest/devops001gs0/v2/cpq/carts/801LT00000kkMXhYAM/items" }, "remote": { "params": { } }, "client": { "params": { } } }, "getproductbyid": { "rest": { "params": { }, "method": "GET", "link": "/services/apexrest/devops001gs0/v2/cpq/carts/801LT00000kkMXhYAM/products?cartId=801LT00000kkMXhYAM&id=01uLT0000073aHRYAY" }, "remote": { "params": { } }, "client": { "params": { "methodName": "getCartsProductsById", "cartId": "801LT00000kkMXhYAM", "id": "01uLT0000073aHRYAY" } } } }, "displaySequence": -1, "productCategories": { "messages": [ ], "totalSize": 0 }, "Product2": { "devops001gs0__SubType__c": "None", "devops001gs0__Type__c": "None", "devops001gs0__GlobalGroupKey__c": "7c64c300-0295-585f-1e4e-188048321ca9", "devops001gs0__IsConfigurable__c": false, "Name": "PRODUCT-51821", "Id": "01tLT0000093PazYAE", "attributes": { "url": "/services/data/v65.0/sobjects/Product2/01tLT0000093PazYAE", "type": "Product2" }, "RecordTypeId": "012LT000001fxpRYAQ" }, "productChildItemDefinition": { "devops001gs0__ParentProductId__c": "01tLT0000093PazYAE", "Name": "Root PCI", "devops001gs0__ParentProductId__r": { "devops001gs0__ProductSpecId__c": null, "Id": "01tLT0000093PazYAE", "Name": "PRODUCT-51821", "devops001gs0__GlobalGroupKey__c": "7c64c300-0295-585f-1e4e-188048321ca9" }, "devops001gs0__MinQuantity__c": 0, "devops001gs0__MaxQuantity__c": 99999, "devops001gs0__MinimumChildItemQuantity__c": 0, "devops001gs0__MaximumChildItemQuantity__c": 99999, "devops001gs0__Quantity__c": 1, "devops001gs0__SeqNumber__c": 1, "devops001gs0__ChildLineNumber__c": "1.0", "devops001gs0__IsRootProductChildItem__c": true, "devops001gs0__IsOverride__c": false, "Id": "a41LT0000006TAbYAM", "devops001gs0__CollapseHierarchy__c": false, "devops001gs0__IsVirtualItem__c": false }, "devops001gs0__RecurringPrice__c": { "label": "Recurring Price", "value": 879.39 }, "UnitPrice": { "label": "List Price", "value": 2544.15 }, "IsActive": { "label": "Active", "value": true }, "Name": { "label": "Product Name", "value": "PRODUCT-51821" }, "ProductCode": { "label": "Product Code", "value": "CODE-41677" }, "Product2Id": { "label": "Product ID", "value": "01tLT0000093PazYAE" }, "Pricebook2Id": { "label": "Price Book ID", "value": "01sLT000002oxi5YAA" }, "Id": { "label": "Price Book Entry ID", "value": "01uLT0000073aHRYAY" }, "defaultQuantity": 1, "minQuantity": 0, "maxQuantity": 99999, "groupMinQuantity": 0, "groupMaxQuantity": 99999, "sequenceNumber": 1, "productChildItemId": "a41LT0000006TAbYAM", "productHierarchyPath": "01tLT0000093PazYAE", "productId": "01tLT0000093PazYAE", "name": "PRODUCT-51821", "isVirtualItem": false, "hasChildren": false, "itemType": "childProduct", "SellingPeriod": "Present", "CurrencyCode": "USD", "category": "Qualified" }, { "messages": [ ], "actions": { "addtocart": { "rest": { "params": { "validate": true, "items": [ { "itemId": "01uLT0000073bNBYAY" } ], "pagesize": 3, "cartId": "801LT00000kkMXhYAM", "hierarchy": -1, "query": null, "price": true, "includeAttachment": false, "lastRecordId": null }, "method": "POST", "link": "/services/apexrest/devops001gs0/v2/cpq/carts/801LT00000kkMXhYAM/items" }, "remote": { "params": { } }, "client": { "params": { } } }, "getproductbyid": { "rest": { "params": { }, "method": "GET", "link": "/services/apexrest/devops001gs0/v2/cpq/carts/801LT00000kkMXhYAM/products?cartId=801LT00000kkMXhYAM&id=01uLT0000073bNBYAY" }, "remote": { "params": { } }, "client": { "params": { "methodName": "getCartsProductsById", "cartId": "801LT00000kkMXhYAM", "id": "01uLT0000073bNBYAY" } } } }, "displaySequence": -1, "productCategories": { "messages": [ ], "totalSize": 0 }, "Product2": { "devops001gs0__SubType__c": "None", "devops001gs0__Type__c": "None", "devops001gs0__GlobalGroupKey__c": "59b61bef-b2a6-9a36-83e9-c2ff42b79642", "devops001gs0__IsConfigurable__c": false, "Name": "PRODUCT-52047", "Id": "01tLT0000093QFJYA2", "attributes": { "url": "/services/data/v65.0/sobjects/Product2/01tLT0000093QFJYA2", "type": "Product2" }, "RecordTypeId": "012LT000001fxpRYAQ" }, "productChildItemDefinition": { "devops001gs0__ParentProductId__c": "01tLT0000093QFJYA2", "Name": "Root PCI", "devops001gs0__ParentProductId__r": { "devops001gs0__ProductSpecId__c": null, "Id": "01tLT0000093QFJYA2", "Name": "PRODUCT-52047", "devops001gs0__GlobalGroupKey__c": "59b61bef-b2a6-9a36-83e9-c2ff42b79642" }, "devops001gs0__MinQuantity__c": 0, "devops001gs0__MaxQuantity__c": 99999, "devops001gs0__MinimumChildItemQuantity__c": 0, "devops001gs0__MaximumChildItemQuantity__c": 99999, "devops001gs0__Quantity__c": 1, "devops001gs0__SeqNumber__c": 1, "devops001gs0__ChildLineNumber__c": "1.0", "devops001gs0__IsRootProductChildItem__c": true, "devops001gs0__IsOverride__c": false, "Id": "a41LT0000006TlhYAE", "devops001gs0__CollapseHierarchy__c": false, "devops001gs0__IsVirtualItem__c": false }, "devops001gs0__RecurringPrice__c": { "label": "Recurring Price", "value": 148.57 }, "UnitPrice": { "label": "List Price", "value": 1945.33 }, "IsActive": { "label": "Active", "value": true }, "Name": { "label": "Product Name", "value": "PRODUCT-52047" }, "ProductCode": { "label": "Product Code", "value": "CODE-45662" }, "Product2Id": { "label": "Product ID", "value": "01tLT0000093QFJYA2" }, "Pricebook2Id": { "label": "Price Book ID", "value": "01sLT000002oxi5YAA" }, "Id": { "label": "Price Book Entry ID", "value": "01uLT0000073bNBYAY" }, "defaultQuantity": 1, "minQuantity": 0, "maxQuantity": 99999, "groupMinQuantity": 0, "groupMaxQuantity": 99999, "sequenceNumber": 1, "productChildItemId": "a41LT0000006TlhYAE", "productHierarchyPath": "01tLT0000093QFJYA2", "productId": "01tLT0000093QFJYA2", "name": "PRODUCT-52047", "isVirtualItem": false, "hasChildren": false, "itemType": "childProduct", "SellingPeriod": "Present", "CurrencyCode": "USD", "category": "Qualified" } ] } ``` ## Availability and Eligibility Interface The Availability and Eligibility Interface enhancement transforms the Communications Cloud Standard Get List of Products API into a context-aware product discovery engine. By integrating with `AvailabilityInterface` and `EligibilityInterface`, the API can dynamically filter products based on customer location, existing services, account status, and other contextual factors. ### Key Benefits - **Context-Aware Filtering**: Automatically filter products based on customer location, account details, and eligibility criteria - **Improved User Experience**: Present only relevant, actionable product options to customers and sales agents - **Streamlined Sales Process**: Reduce time spent on non-viable product configurations - **Flexible Implementation**: Implement custom business logic for availability and eligibility checks - **Backward Compatible**: Existing API behavior is preserved when context is not provided The enhanced Get List of Products API processes requests through the following sequence: 1. **Initial Product Fetch**: The API retrieves products from the catalog based on standard query parameters 2. **Availability Filtering** (optional): If availability context is provided, the `AvailabilityInterface` filters products based on location or service availability 3. **Eligibility Filtering** (optional): If eligibility context is provided, the `EligibilityInterface` filters products based on account status, existing services, or business rules 4. **Response**: The API returns the final, contextually filtered product list # Get Lists of Values Retrieve time plans, time policies, and adjustment codes. The **Price Adjustment** dialog box enables a user to pick a time plan and time policy to associate with a recurring adjustment or to pick a code that defines an adjustment for a specific price, such as a recurring charge, one-time charge, one-time total, and so on. ```nolang GET /v2/listsofvalues?listkeys={type_of_list}&cartId={cart_ID}&id={line_item_ID}&fields={field_name}&PricingVariableCode={price_variable_code} ``` ## Remote Method ```nolang getListsOfValues ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | ------------------------------------------------- | | Resource URL | `/services/apexrest/{namespace}/v2/listsofvalues` | ## Example Request ```nolang GET /services/apexrest/vlocity_cmt/v2/listsofvalues?listkeys=AdjustmentCodes&cartId=80146000000goGvAAI&id=80246000000gaR9AAI&fields=vlocity_cmt__OneTimeCharge__c&PricingVariableCode=OT_STD_PRC ``` ## Example Response ```nolang { "totalSize": 1, "messages": [], "records": [ { "messages": [], "displaySequence": -1, "id": "80246000000gZfOAAU", "vlocity_cmt__OneTimeCharge__c": { "pricedetail": [ { "actions": {}, "DetailType": "PRICE", "Description": "$50 One Time Standard Price", "StartValue": 50, "EndValue": 50, "AdjustmentType": "None", "AdjustmentMethod": null, "AdjustmentValue": 0 }, { "actions": {}, "DetailType": "ADJUSTMENT", "Description": "5% Discount on OT Std Price due to Bundle A...", "StartValue": 50, "EndValue": 47.5, "AdjustmentType": "Discount", "AdjustmentMethod": "Percent", "AdjustmentValue": -5 }, { "actions": {}, "DetailType": "ADJUSTMENT", "Description": "10% Discount on OT Std Price due to Promotion 'Add Bundle A'", "StartValue": 47.5, "EndValue": 42.5, "AdjustmentType": "Discount", "AdjustmentMethod": "Percent", "AdjustmentValue": -10 }, { "actions": {}, "DetailType": "ADJUSTMENT", "Description": "Additional 10% - Add Child 2 Promo", "StartValue": 42.5, "EndValue": 37.5, "AdjustmentType": "Discount", "AdjustmentMethod": "Percent", "AdjustmentValue": -10 } ] } } ] } ``` ## Example Request ```nolang GET /services/apexrest/vlocity_cmt/v2/listsofvalues?listkeys=TimePlans,TimePolicies ``` ## Example Response ```nolang { "totalSize": 2, "messages": [], "records": [ { "messages": [], "displaySequence": -1, "listkey": "TimePlans", "listvalues": [ { "uiStates": {}, "nameResult": {}, "messages": [], "fields": { "valuekey": "a2l460000005J5xAAE", "label": "One Year" }, "displaySequence": -1, "actions": {} }, { "uiStates": {}, "nameResult": {}, "messages": [], "fields": { "valuekey": "a2l460000005J1ZAAU", "label": "60 Days" }, "displaySequence": -1, "actions": {} }, { "uiStates": {}, "nameResult": {}, "messages": [], "fields": { "valuekey": "a2l460000005J1UAAU", "label": "6 months" }, "displaySequence": -1, "actions": {} } ] }, { "messages": [], "displaySequence": -1, "listkey": "TimePolicies", "listvalues": [ { "uiStates": {}, "nameResult": {}, "messages": [], "fields": { "valuekey": "a2m460000004xcvAAA", "label": "First Day of the Month" }, "displaySequence": -1, "actions": {} }, { "uiStates": {}, "nameResult": {}, "messages": [], "fields": { "valuekey": "a2m460000004xbfAAA", "label": "Time Policy Purchase Date" }, "displaySequence": -1, "actions": {} } ] } ] } ``` # Get Offer Details This API call uses two Path variables: **catalogcode** and **offercode**. Fill in with appropriate values for your catalog and click **Send**. ![Get Offer Details](https://developer.salesforce.com/docs/media/postman_getofferdetails.png) # Get Offer Details API This API retrieves detailed information about a specific offer (either product or promotion). The API returns the full hierarchy of a product or promotion as defined in the product catalog. The API response is created from the pre-cached results present in the sObject (current caching layer). The API also handles cache misses. Along with returning the offer detail, the API caches the data for future requests. Prices, adjustments, and overrides are returned along with offers. The API does not use the Salesforce ID as part of the request and response parameters. **note:** Get Offer Details API supports cross-catalog basket and cart operations when products belong to different catalogs but have the same price list. This API supports the **isloggedin** flag to indicate whether a user is logged in or anonymous. If the **isloggedin** flag is true, it indicates a logged-in user, and an accountId must be specified in the context parameter of the API call. If the **isloggedin** flag is false, it indicates that the user is anonymous. When executing the Get Offers Details API for anonymous users, Digital Commerce supports the following: - Base adjustments, overrides, monthly recurring charges, and non-recurring charges. - Product context eligibility rules are not supported for anonymous and known users for Get Offer Details. - Starting in CME Spring '22, Digital Commerce supports retrieving usage-based price. When creating a pricing element for usage-based pricing, the usage quantity is defaulted to 1 and you must specify the associated unit of measure. When executing the Get Offers Details API for known users, Digital Commerce supports the following: - Pricing context eligibility rules by tightest match in the API response. - Base adjustments, overrides, monthly recurring charges, and non-recurring charges. - Starting in CME Spring '22, Digital Commerce supports retrieving usage-based price. When creating a pricing element for usage-based pricing, the usage quantity is defaulted to 1 and you must specify the associated unit of measure. See [Get Offer Details API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-get-offer-details-api.md) and [Digital Commerce REST API](https://developer.salesforce.com/docs/industries/cme/references/dc-rest1?meta=Summary). ## Rules Supported - Anonymous users: Context eligibility rules and qualification rules for products and promotions are not supported. - Known users: [Context Eligibility Rules](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-context-eligibility-rules.md) rules and [Qualification Rules for Price Lists](https://help.salesforce.com/s/articleView?id=ind.comms_qualification_rules_for_price_lists.htm) are supported. - No advanced rules are supported. ## Prerequisites - Catalog should have CatalogCode**c populated and no space is allowed in CatalogCode**c. - Products should have ProductCode populated and no space is allowed in ProductCode. - Promotions should have Code**c populated and no space is allowed in Code**c. - Catalog should be present with products and promotions attached to it as records under CatalogProductRelationship\_\_c object. - Catalog should be attached to a default price list through DefaultPriceList**c field on Catalog**c object. - Price list entries should exist for all the products attached to the catalog. - A record should be created under Vlocity API Metadata object for getOfferDetails API; this can be populated by running a batch job named as `LOAD API METADATA`, which is present under CMT Administration → Cacheable API Jobs. - To cache records related to the getOfferDetails API, run the batch job named [Populate API Cache](https://help.salesforce.com/s/articleView?id=ind.comms_populate_api_cache.htm). Another way is to run the job is through anonymous block using the following statement (After populating, context eligibility and pricing records): `database.executeBatch(new BatchCacheProcessor('getOfferDetails'));` - Create a custom setting called [CacheAPIFields](https://help.salesforce.com/s/articleView?id=ind.comms_t_cpq_configuration_settings_reference_148927.htm) with a value of true. CacheAPIFields is not required for CME 103.1.14 and later versions. ## Parameters For API parameter names and descriptions, see [Digital Commerce REST API](https://developer.salesforce.com/docs/industries/cme/references/dc-rest1?meta=Summary). For information about returning Product2 or Promotion fields that are not returned by default, see [Retrieving Additional Product2 or Promotion Fields](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-retrieving-additional-product2-or-promotion-fields.md). ## Response For detailed API response descriptions, see [Digital Commerce REST API](https://developer.salesforce.com/docs/industries/cme/references/dc-rest1?meta=Summary). ## Get Offer Details for an Anonymous User `GET /v3/catalogs/{catalog_code}/offers/{offer_code}` In the examples below, substitute your own values for the following parameters: - myCatalog = Catalog Code - myOfferCode = Offer Code - myPromotion = Promotion Code - account - account_ID Example: Retrieve a list of offers for a specified product: ```nolang Method: GET API: /services/apexrest/vlocity_cmt/v3/catalogs/{catalog_code}/offers/{product_code} ``` Example: Retrieve offer details about a specific promotion: ```nolang Method: GET API: /services/apexrest/vlocity_cmt/v3/catalogs/{catalog_code}/offers/{promotion_code} ``` ## Get Offer Details for a Logged-In User Example: Retrieve a list of offers for a specified product: ```nolang GET /v3/catalogs/{catalog_code}/offers/{offer_code}?context={"accountId":"0016A0000053kHN"}&isloggedIn=true ``` ```nolang Method: GET API: /services/apexrest/vlocity_cmt/v3/catalogs/{catalog_code}/offers/{product_code}?context={"accountId":"0016A0000053kHN"}&isloggedIn=true ``` Example: Retrieve offer details about a specific promotion: ```nolang Method: GET API: /services/apexrest/vlocity_cmt/v3/catalogs/{catalog_code}/offers/{product_code}?context={"accountId":"0016A0000053kHN"}&isloggedIn=true ``` ### Cross-Catalog Support for Get Offer Details APIs Get Offer Details API supports cross-catalog operations when products belong to different catalogs but have the same price list. You can add offers to the baskets from different catalogs having the same price lists. For example, in the following table, there are two catalogs having products belonging to the same price lists. If you make the cross call, the `GetOfferDetails` API returns a successful response, getting the details of the offers when called using different catalogs to which they belong. | Catalog | Products | | :-------- | :-------- | | Catalog 1 | Product 1 | | Catalog 2 | Product 2 | Full product responses received for GetOfferDetails call to: - /services/apexrest/vlocity_cmt/v3/catalogs/Catalog1/offers/Product2 - /services/apexrest/vlocity_cmt/v3/catalogs/Catalog2/offers/Product1 # Get Offers By Catalog To run the Get Offers By Catalog API, select it in Postman first, then define a catalog code as a path variable in the Params tab (see illustration below). Other Parameters are optional and disabled by default. ![Get Offers By Catalog](https://developer.salesforce.com/docs/media/getoffers_postman.png) After filling in the catalog name click **Send**. The results of the API call are displayed in a Postman window. # Get Offers by Catalog API The Get Offers by Catalog API provides the ability to retrieve products and promotions that are modeled within the Shared Catalog. The specified catalog code identifies the catalog that contains offers (products and promotions). You can optionally specify a page size to limit the number of results returned. The sort order of the result is based on the sequence field or another specified field. You can search either by name or description. The API also supports Get Filtered Products, where offers that contain specified child offers are returned. A response code of 200 indicates a successful call while 400 indicates a failed response. This API supports both anonymous and logged-in users. You use the **isloggedin** flag to indicate whether the user is logged in or not. For known users - that is, when isloggedIn=true and a context is specified - the Get Offers by Catalog API returns a qualification node for each offer. The qualification node indicates whether the qualification rules passed or failed for a given offer. qualificationType: Pass indicates that the offer passed qualification rules, whereas qualificationType: Fail indicates that the offer did not pass qualification rules. For anonymous users, the API returns only qualified offers and the qualificationType node is not returned. Offers that are not qualified are not returned. When executing the Get Offers API for anonymous users, Digital Commerce supports the following: - Only qualified offers as part of the API response. - Base adjustments and overrides. When executing the Get Offers API for known users, Digital Commerce supports the following: - Qualified and unqualified offers in the API response within the qualification node. - Base prices, adjustments, and override prices are supported. Pricing context eligibility rules are not supported for anonymous and known users for Get Offers. ## Rules Supported - [Context Eligibility Rules with Digital Commerce](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-context-eligibility-rules.md) - Response contains Base Prices only (see [Product Pricing in EPC](https://help.salesforce.com/s/articleView?id=ind.comms_product_pricing_in_epc.htm)) - [Using Context Rules with Digital Commerce APIs](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-defining-context-eligibility-rules.md) - No advanced rules are supported. ## Prerequisites - The Catalog should have the CatalogCode**c field populated. No spaces are permitted in CatalogCode**c. - Products should have ProductCode populated. No spaces are permitted in ProductCode. - Promotions should have Code**c populated and no space is allowed in Code**c. - Catalog should be present with products and promotions attached to it as records under CatalogProductRelationship\_\_c object. - Catalog should be attached to a default price list through DefaultPriceList**c field on Catalog**c object. - Price list entries should exist for all the products attached to the catalog. - All products present under associated promotions (for a catalog ), must also have a relationship with catalog. Products should be added to Catalog, before adding them to any promotion associated with the catalog. - A record should be created under the Vlocity API Metadata object for getOffers API. This can be populated by running a batch job named as LOAD API METADATA which is present under CMT Administration > Cacheable API Jobs. - (Optional) To cache records that are associated with the getOffers API you can optionally run the Populate API Cache batch job (located in CMT Administration > Cacheable API Jobs). After populating, context eligibility and pricing records, you can also run the batch job using the following statement: `database.executeBatch(new BatchCacheProcessor('getOffers'));` - Product Eligibility and Availability interface implementations are not supported. The eligibility rules that are supported by the DC APIs are controlled by [context rules](https://help.salesforce.com/s/articleView?id=ind.comms_context_rules_framework.htm). - [Enable Usage Pricing](https://help.salesforce.com/s/articleView?id=ind.comms_enable_usage_pricing_for_industries_cpq.htm) ## Parameters For API parameter names and descriptions, see [Digital Commerce REST API](https://developer.salesforce.com/docs/industries/cme/references/dc-rest1?meta=Summary). For information about returning Product2 or Promotion fields that are not returned by default, see [Retrieving Additional Product2 or Promotion Fields](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-retrieving-additional-product2-or-promotion-fields.md). **note:** Always pass an offset when using page size. Without an offset, large page sizes may exceed Salesforce-governed limits or cause issues like heap size errors. ## GetOffersByCatalog for an anonymous user In the examples that follow, braces around items ( { } ) indicate replaceable parameters that you specify. ```nolang GET /v3/catalogs/{catalog_code}/offers ``` Return a list of offers: ```nolang Method: GET API: /services/apexrest/vlocity_cmt/v3/catalogs/{catalog_code}/offers ``` The GetOffersByCatalog API supports pagination. The response contains an action named nextOffersAction which contains a REST URL you can use to fetch the products on the next logical page. Return a list of offers and specify a page size of 20: ```nolang Method: GET API: /services/apexrest/vlocity_cmt/v3/catalogs/{catalog_code}/offers?offset=0&pageSize=20 ``` Return a list of offers and specify a page size and offset: ```nolang Method: GET API: /services/apexrest/vlocity_cmt/v3/catalogs/{catalog_code}/offers?offset=20&pageSize=20 ``` Return a list of offers and specify a context: ```nolang Method: GET API: /services/apexrest/vlocity_cmt/v3/catalogs/{catalog_code}/offers?context={"Status":"Active"} ``` Context parameters that specify which offers qualify for the end user can be passed to the API. Return a list of offers and specify multiple contexts: ```nolang Method: GET API: /services/apexrest/vlocity_cmt/v3/catalogs/{catalog_code}/offers?context={"SLA__c":"Silver","Status":"Inactive"} ``` Sorting is based on fields passed from the Catalog Product Relationship object. Because the offers list contains both products and promotions, the parameter on which to sort the offer list is added to the records of the Catalog Product Relationship object. Return a list of offers sorted by sequence number: ```nolang Method: GET API: /services/apexrest/vlocity_cmt/v3/catalogs/{catalog_code}/offers?sortby=vlocity_cmt__SequenceNumber__c_ASC ``` Return a list of offers sorted by Active status: ```nolang Method: GET API: /services/apexrest/vlocity_cmt/v3/catalogs/{catalog_code}/offers?sortby=vlocity_cmt__SequenceNumber__c_ASC,Name_DESC&context={"Status":"Active"} ``` ## GetOffersByCatalog for a logged-in user Retrieves offers from the specified Catalog (identified by the Catalog Code). Offers can be a product or a promotion. The sortby parameter can sort featured offers first in the result set. ```nolang GET /v3/catalogs/{catalog_code}/offers?context{"accountid":"account_ID"}&isloggedin=true ``` Here are some examples: Return a list of offers for a logged-in user: ```nolang Method: GET API: /services/apexrest/vlocity_cmt/v3/catalogs/{catalog_code}/offers?context={"accountId":"{account_number}"}&isloggedIn=true ``` Return a list of offers for a known user and specify a page size of 20: ```nolang Method: GET API: /services/apexrest/vlocity_cmt/v3/catalogs/{catalog_code}/offers?offset=0&pageSize=20?context={"accountId":"{account_number}"}&isloggedIn=true ``` The rest of the examples are all in the same format as for anonymous users, except that a context is specified and the isloggedIn parameter is set to true. # Get Price Lists for Cart Return the price lists available for a cart. ```nolang GET /v2/cpq/carts/{cart_ID}/pricelists ``` 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 ```nolang getPriceLists ``` ## REST Handler ```nolang REST Endpoint: APIPriceListsCpqV2.cls Implementation: CpqGetPriceListsActionV2.cls ``` ## Apex Remote Service ```nolang CpqAppHandler ``` ## Apex Remote Input Map ```nolang { methodName: getPriceLists cartId: 80146000000 iwCx pagesize: 2 } ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | ---------------------------------------------------------------- | | Resource URL | /services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/pricelists | ## Example Request ```nolang GET /services/apexrest/vlocity_cmt/v2/cpq/carts/8011I000000TUaK/pricelists?pagesize=10 ``` ## Example Response ```nolang { "totalSize": 1, "messages": [], "records": [ { "messages": [], "actions": { "setpricelist": { "rest": { "params": { "inputFields": [ { "vlocity_cmt__PriceListId__c": "a2Y1I000000g50kUAA" } ] }, "method": "POST", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/8011I000000XegcQAC" }, "remote": { "params": { "inputFields": [ { "vlocity_cmt__PriceListId__c": "a2Y1I000000g50kUAA" } ], "cartId": "8011I000000XegcQAC", "methodName": "updateCarts" } }, "client": { "params": {} } } }, "displaySequence": -1, "Id": "a2Y1I000000g50kUAA", "Name": "Base PriceList" } ] } ``` # Get Price Waterfall for Price Get the price waterfall for a price. The Get Price Details API retrieves the pricing details for a price field based on the cart context—opportunity, quote, order—specified by the cartId parameter and the line item ID. Only the [PricingElementServiceImplementation](https://help.salesforce.com/s/articleView?id=ind.v_dev_t_pricingelementserviceimplementation_662248.htm) supports the Get Price Details API. ```nolang GET /v2/cpq/carts/{cart_ID}/items/{ID}/pricing ``` 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 ```nolang getPriceDetail ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | -------------------------------------------------------------------------- | | Resource URL | `/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/items/{ID}/pricing` | ## Example Request ```nolang GET /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000goGv/items/80246000000gZfO/pricing?fields=vlocity_cmt__OneTimeCharge__c ``` ## Example Response ```nolang { "totalSize": 1, "messages": [], "records": [ { "messages": [], "displaySequence": -1, "id": "80246000000gZfOAAU", "vlocity_cmt__OneTimeCharge__c": { "pricedetail": [ { "actions": {}, "DetailType": "PRICE", "Description": "$50 One Time Standard Price", "StartValue": 50, "EndValue": 50, "AdjustmentType": "None", "AdjustmentMethod": null, "AdjustmentValue": 0 }, { "actions": {}, "DetailType": "ADJUSTMENT", "Description": "5% Discount on OT Std Price due to Bundle A...", "StartValue": 50, "EndValue": 47.5, "AdjustmentType": "Discount", "AdjustmentMethod": "Percent", "AdjustmentValue": -5 }, { "actions": {}, "DetailType": "ADJUSTMENT", "Description": "10% Discount on OT Std Price due to Promotion 'Add Bundle A'", "StartValue": 47.5, "EndValue": 42.5, "AdjustmentType": "Discount", "AdjustmentMethod": "Percent", "AdjustmentValue": -10 }, { "actions": {}, "DetailType": "ADJUSTMENT", "Description": "Additional 10% - Add Child 2 Promo", "StartValue": 42.5, "EndValue": 37.5, "AdjustmentType": "Discount", "AdjustmentMethod": "Percent", "AdjustmentValue": -10 } ] } } ] } ``` # Get Products by ID Retrieve a list of products and attributes for the specified price book entry ID. ```nolang GET /v2/cpq/carts/{cart_ID}/products?{ID}&includeAttachment=[true|false] ``` 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 ```nolang getCartsProductsById ``` ## REST Handler ```nolang APIProductsCartsCpqV2 ``` ## Apex Remote Service ```nolang CpqAppHandler ``` ## Apex Remote Input Map ```nolang { methodName:getCartsProductsById, cartId:801360000008eNU, id: 991360000008eNU, includeAttachment: true, fields: Product2.vlocity_cmt__CustomField__c } ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Example Request ```nolang GET /v2/cpq/carts/{cart_ID}/products?id=01t36000000pfcKAAQ,01t36000000pfcKAAQ&includeAttachment=true ``` ## Example Response **note:** This example result has been truncated. ```nolang { "totalSize" => 1, "messages" => [], "records" => [{ "messages" => [], "actions" => { "addtocart" => { "rest" => { "params" => { "items" => [{ "itemId" => "01u6A00000135XPQAY" }], "cartId" => "8016A000000bwDJQAY", "price" => true, "validate" => true, "includeAttachment" => true, "pagesize" => 20, "lastRecordId" => nil, "query" => nil }, "method" => "POST", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwDJQAY/items" }, "remote" => { "params" => { "methodName" => "postCartsItems", "items" => [{ "itemId" => "01u6A00000135XPQAY" }], "cartId" => "8016A000000bwDJQAY", "price" => true, "validate" => true, "includeAttachment" => true, "pagesize" => 20, "lastRecordId" => nil, "query" => nil } }, "client" => { "params" => {} } }, "getproductbyid" => { "rest" => { "params" => {}, "method" => "GET", "link" => "/services/apexrest/vlocity_cmt/v2/cpq/carts/8016A000000bwDJQAY/products?cartId=8016A000000bwDJQAY&id=01u6A00000135XPQAY" }, "remote" => { "params" => { "methodName" => "getCartsProductsById", "id" => "01u6A00000135XPQAY", "cartId" => "8016A000000bwDJQAY" } }, "client" => { "params" => { "cartId" => "8016A000000bwDJQAY", "id" => "01u6A00000135XPQAY", "methodName" => "getCartsProductsById" } } } }, "displaySequence" => -1, "Id" => { "label" => "Price Book Entry ID", "value" => "01u6A00000135XPQAY" }, "Pricebook2Id" => { "label" => "Price Book ID", "value" => "01s6A0000037JCtQAM" }, "Product2Id" => { "label" => "Product ID", "value" => "01t6A000000fczvQAA" }, "ProductCode" => { "label" => "Product Code", "value" => "IRKP1" }, "UnitPrice" => { "label" => "List Price", "value" => nil }, "Name" => { "label" => "Product Name", "value" => "IRKP1" }, "vlocity_cmt__RecurringPrice__c" => { "label" => "Recurring Price", "value" => nil }, "IsActive" => { "label" => "Active", "value" => true }, "Product2" => { "attributes" => { "type" => "Product2", "url" => "/services/data/v40.0/sobjects/Product2/01t6A000000fczvQAA" }, "Id" => "01t6A000000fczvQAA", "Name" => "IRKP1", "vlocity_cmt__IsConfigurable__c" => false, "vlocity_cmt__Type__c" => "None", "vlocity_cmt__SubType__c" => "None", "RecordTypeId" => "0126A000000gwBfQAI" }, "productId" => "01t6A000000fczvQAA", "defaultQuantity" => 1.0, "minQuantity" => 0.0, "maxQuantity" => 99999.0, "groupMinQuantity" => 0, "groupMaxQuantity" => 99999, "sequenceNumber" => 1.0, "productChildItemId" => "a2a6A000000wm6IQAQ", "productChildItemDefinition" => { "attributes" => { "type" => "vlocity_cmt__ProductChildItem__c", "url" => "/services/data/v40.0/sobjects/vlocity_cmt__ProductChildItem__c/a2a6A000000wm6IQAQ" }, "vlocity_cmt__MinQuantity__c" => 0, "vlocity_cmt__SeqNumber__c" => 1.0, "Name" => "Root PCI", "Id" => "a2a6A000000wm6IQAQ", "vlocity_cmt__Quantity__c" => 1, "vlocity_cmt__MaximumChildItemQuantity__c" => 99999, "vlocity_cmt__ParentProductId__r" => { "attributes" => { "type" => "Product2", "url" => "/services/data/v40.0/sobjects/Product2/01t6A000000fczvQAA" }, "Name" => "IRKP1", "Id" => "01t6A000000fczvQAA", "RecordTypeId" => "0126A000000gwBfQAI" }, "vlocity_cmt__MaxQuantity__c" => 99999, "vlocity_cmt__MinimumChildItemQuantity__c" => 0, "vlocity_cmt__CollapseHierarchy__c" => false, "vlocity_cmt__IsOverride__c" => false, "vlocity_cmt__IsVirtualItem__c" => false, "vlocity_cmt__ChildLineNumber__c" => "1", "vlocity_cmt__IsRootProductChildItem__c" => true, "vlocity_cmt__ParentProductId__c" => "01t6A000000fczvQAA" }, "productHierarchyPath" => "01t6A000000fczvQAA", "name" => "IRKP1", "isVirtualItem" => false, "attributeValues" => {}, "hasChildren" => true, "itemType" => "childProduct", "category" => "Qualified", "productCategories" => { "totalSize" => 0, "messages" => [] }, "childProducts" => { "totalSize" => 0, "messages" => [], "records" => [{ "messages" => [], "displaySequence" => -1, "Id" => { "label" => "Price Book Entry ID", "value" => "01u6A00000135XUQAY" }, "Pricebook2Id" => { "label" => "Price Book ID", "value" => "01s6A0000037JCtQAM" }, "Product2Id" => { "label" => "Product ID", "value" => "01t6A000000fd00QAA" }, "ProductCode" => { "label" => "Product Code", "value" => "IRKADDON" }, "UnitPrice" => { "label" => "List Price", "value" => nil }, "Name" => { "label" => "Product Name", "value" => "IRKADDON" }, "vlocity_cmt__RecurringPrice__c" => { "label" => "Recurring Price", "value" => nil }, "IsActive" => { "label" => "Active", "value" => true }, "Product2" => { "attributes" => { "type" => "Product2", "url" => "/services/data/v40.0/sobjects/Product2/01t6A000000fd00QAA" }, "Id" => "01t6A000000fd00QAA", "Name" => "IRKADDON", "vlocity_cmt__IsConfigurable__c" => false, "vlocity_cmt__Type__c" => "None", "vlocity_cmt__SubType__c" => "None", "RecordTypeId" => "0126A000000gwBfQAI" }, "productId" => "01t6A000000fd00QAA", "defaultQuantity" => 0.0, "minQuantity" => 0.0, "maxQuantity" => 1.0, "groupMinQuantity" => 0, "groupMaxQuantity" => 99999, "sequenceNumber" => 1.0, "productChildItemId" => "a2a6A000000wm6cQAA", "productChildItemDefinition" => { "attributes" => : "vlocity_cmt__RecurringPrice__c" => { "label" => "Recurring Price", "value" => nil }, "IsActive" => { "label" => "Active", "value" => true }, "Product2" => { "attributes" => { "type" => "Product2", "url" => "/services/data/v40.0/sobjects/Product2/01t6A000000fd00QAA" }, "Id" => "01t6A000000fd00QAA", "Name" => "IRKADDON", "vlocity_cmt__IsConfigurable__c" => false, "vlocity_cmt__Type__c" => "None", "vlocity_cmt__SubType__c" => "None", "RecordTypeId" => "0126A000000gwBfQAI" }, "productId" => "01t6A000000fd00QAA", "defaultQuantity" => 0.0, "minQuantity" => 0.0, "maxQuantity" => 1.0, "groupMinQuantity" => 0, "groupMaxQuantity" => 99999, "sequenceNumber" => 1.0, "productChildItemId" => "a2a6A000000wm6cQAA", "productChildItemDefinition" => { "attributes" => { "type" => "vlocity_cmt__ProductChildItem__c",: "vlocity_cmt__RecurringPrice__c" => { "label" => "Recurring Price", "value" => nil }, "IsActive" => { "label" => "Active", "value" => true }, "Product2" => { "attributes" => { "type" => "Product2", "url" => "/services/data/v40.0/sobjects/Product2/01t6A000000fd00QAA" }, "Id" => "01t6A000000fd00QAA", "Name" => "IRKADDON", "vlocity_cmt__IsConfigurable__c" => false, "vlocity_cmt__Type__c" => "None", "vlocity_cmt__SubType__c" => "None", "RecordTypeId" => "0126A000000gwBfQAI" }, "productId" => "01t6A000000fd00QAA", "defaultQuantity" => 0.0, "minQuantity" => 0.0, "maxQuantity" => 1.0, "groupMinQuantity" => 0, "groupMaxQuantity" => 99999, "sequenceNumber" => 1.0, "productChildItemId" => "a2a6A000000wm6cQAA", "productChildItemDefinition" => { "attributes" => { "type" => "vlocity_cmt__ProductChildItem__c", "url" => "/services/data/v40.0/sobjects/vlocity_cmt__ProductChildItem__c/a2a6A000000wm6cQAA" }, "vlocity_cmt__ChildProductId__c" => "01t6A000000fd00QAA", "vlocity_cmt__MinQuantity__c" => 0, "vlocity_cmt__SeqNumber__c" => 1.0, "Name" => "a2a6A000000wm6c", "Id" => "a2a6A000000wm6cQAA", "vlocity_cmt__Quantity__c" => 0, "vlocity_cmt__MaximumChildItemQuantity__c" => 99999, "vlocity_cmt__ParentProductId__r" => { "attributes" => { "type" => "Product2", "url" => "/services/data/v40.0/sobjects/Product2/01t6A000000fczvQAA" }, "Name" => "IRKP1", "Id" => "01t6A000000fczvQAA", "RecordTypeId" => "0126A000000gwBfQAI" }, "vlocity_cmt__MaxQuantity__c" => 1, "vlocity_cmt__ChildProductId__r" => { "attributes" => { "type" => "Product2", "url" => "/services/data/v40.0/sobjects/Product2/01t6A000000fd00QAA" }, "Id" => "01t6A000000fd00QAA", "RecordTypeId" => "0126A000000gwBfQAI" }, "vlocity_cmt__MinimumChildItemQuantity__c" => 0, "vlocity_cmt__CollapseHierarchy__c" => false, "vlocity_cmt__IsOverride__c" => false, "vlocity_cmt__IsVirtualItem__c" => false, "vlocity_cmt__ChildLineNumber__c" => "1", "vlocity_cmt__IsRootProductChildItem__c" => false, "vlocity_cmt__ParentProductId__c" => "01t6A000000fczvQAA" }, "productHierarchyPath" => "01t6A000000fczvQAA<01t6A000000fd00QAA", "isVirtualItem" => false, "attributeValues" => {}, "hasChildren" => true, "itemType" => "childProduct", "productCategories" => { "totalSize" => 0, "messages" => [] }, ``` # Get Promotions Applied to Cart Return a list of promotions applied to a specified cart. ```nolang GET /v2/cpq/carts/{cart_ID} ``` ## Remote Method ```nolang getPromotionsAppliedToCart ``` ## REST Handlers - REST endpoint: APIPromotionsCartsCpqV2.cls - Implementation: CpqAppliedPromotionsCartsActionV2.cls ## Apex Remote Service ```nolang CpqAppHandler ``` ## Apex Remote Input Map ```nolang { methodName:getPromotionsAppliedToCart cartId:80146000000iwCx, pagesize:10, fields:"Id,Name", includePenalties:true, filters:vlocity_cmt__AppliesTo__c:Account_Contract, commitmentDateFilter:2020-04-05T07:00:00.000Z, appliedPromoStatusFilter:Expired } ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | ------------------------------------------------------------------------------------------------------- | | Resource URL | `/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/promotions?subaction=getPromotionsAppliedToCart` | ## Example Request ```nolang GET /services/apexrest/vlocity_cmt/v2/cpq/carts/801360000000oQ9/promotions ``` ## Example Response ```nolang { "totalSize": 1, "messages": [], "records": [ { "messages": [], "actions": { "deleteappliedpromoitems": { "rest": { "params": {}, "method": "DELETE", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/801f40000008UlxAAE/promotions?id=a2Lf4000000TvFmEAK" }, "remote": { "params": { "id": "a2Lf4000000TvFmEAK", "cartId": "801f40000008UlxAAE", "methodName": "deleteAppliedPromoItems" } }, "client": { "params": {} } }, "getpromodetails": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/801f40000008UlxAAE/promotions?id=a2Lf4000000TvFmEAK&subaction=getPromotionsAppliedToCart&includePenalties=true" }, "remote": { "params": { "includePenalties": true, "subaction": "getPromotionsAppliedToCart", "id": "a2Lf4000000TvFmEAK", "cartId": "801f40000008UlxAAE", "methodName": "getPromotionsAppliedToCart" } }, "client": { "params": {} } } }, "displaySequence": -1, "Id": { "value": "a2Lf4000000TvFmEAK", "previousValue": null, "originalValue": null, "messages": [], "label": "Record ID", "hidden": true, "fieldName": "Id", "editable": false, "dataType": "ID", "actions": {} }, "vlocity_cmt__BillingAccountId__c": { "value": "001f40000093uqMAAQ", "previousValue": null, "originalValue": null, "messages": [], "label": "Account", "hidden": true, "fieldName": "vlocity_cmt__BillingAccountId__c", "editable": true, "dataType": "REFERENCE", "actions": {} }, "vlocity_cmt__Action__c": { "value": "Change", "previousValue": null, "originalValue": null, "messages": [], "label": "Action", "hidden": true, "fieldName": "vlocity_cmt__Action__c", "editable": true, "dataType": "PICKLIST", "actions": {} }, "vlocity_cmt__PromotionId__c": { "value": "a2ff4000000cHPMAA2", "previousValue": null, "originalValue": null, "messages": [], "label": "Promotion", "hidden": true, "fieldName": "vlocity_cmt__PromotionId__c", "editable": true, "dataType": "REFERENCE", "actions": {} }, "vlocity_cmt__Sequence__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Sequence", "hidden": true, "fieldName": "vlocity_cmt__Sequence__c", "editable": true, "dataType": "DOUBLE", "actions": {} }, "vlocity_cmt__FulfilmentStatus__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Fulfilment Status", "hidden": true, "fieldName": "vlocity_cmt__FulfilmentStatus__c", "editable": true, "dataType": "PICKLIST", "actions": {} }, "vlocity_cmt__ReasonForCancellation__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Reason for Cancellation", "hidden": true, "fieldName": "vlocity_cmt__ReasonForCancellation__c", "editable": true, "dataType": "STRING", "actions": {} }, "vlocity_cmt__RequestDate__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Request Date", "hidden": true, "fieldName": "vlocity_cmt__RequestDate__c", "editable": true, "dataType": "DATETIME", "actions": {} }, "vlocity_cmt__SubAction__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Sub Action", "hidden": true, "fieldName": "vlocity_cmt__SubAction__c", "editable": true, "dataType": "PICKLIST", "actions": {} }, "vlocity_cmt__CommitmentStartDate__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Commitment Start Date", "hidden": true, "fieldName": "vlocity_cmt__CommitmentStartDate__c", "editable": true, "dataType": "DATETIME", "actions": {} }, "vlocity_cmt__CommitmentEndDate__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Commitment End Date", "hidden": true, "fieldName": "vlocity_cmt__CommitmentEndDate__c", "editable": true, "dataType": "DATETIME", "actions": {} }, "vlocity_cmt__PricingStartDate__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Benefit Start Date", "hidden": true, "fieldName": "vlocity_cmt__PricingStartDate__c", "editable": true, "dataType": "DATETIME", "actions": {} }, "vlocity_cmt__PricingEndDate__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Benefit End Date", "hidden": true, "fieldName": "vlocity_cmt__PricingEndDate__c", "editable": true, "dataType": "DATETIME", "actions": {} }, "vlocity_cmt__AppliesTo__c": { "value": null, "previousValue": null, "originalValue": null, "messages": [], "label": "Applies To", "hidden": true, "fieldName": "vlocity_cmt__AppliesTo__c", "editable": true, "dataType": "PICKLIST", "actions": {} }, "Name": "BundleJul19Promo", "Description": "BundleJul19Promo", "OrderRequestDate": "2019-11-13" } ] } ``` # Get Started with Communications, Media, and Energy (CME) Common APIs Learn about the following CME commons APIs. - Cart (CPQ) APIs - Standard Cart APIs - Digital Commerce (DC) APIs - Standard DC APIs - Enterprise Product Catalog (EPC) APIs ![Alt text](https://developer.salesforce.com/docs/media/main-banner-lm-communications-cloud.png '{"class": "image-full", "title": "Communications Cloud"}') | ![Alt text](https://developer.salesforce.com/docs/media/lm_start.png '{"class": "image-full", "title": "SFDocs"}') | ![Alt text](https://developer.salesforce.com/docs/media/lm_build_1.png '{"class": "image-full", "title": "SFDocs"}') | ![Alt text](https://developer.salesforce.com/docs/media/lm_build_1.png '{"class": "image-full", "title": "SFDocs"}') | | ------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | | **Get Oriented** | **Dive In: Learn About the Set Up for Standard Cart APIs** | **Dive In: Learn About the Set Up for Standard DC APIs** | | [What are Configure, Price, Quote (CPQ) Cart APIs?](https://developer.salesforce.com/docs/industries/cme/guide/comms-cart-based-apis-for-industries-cpq.html) | [Before You Begin: Standard Cart APIs](https://developer.salesforce.com/docs/industries/cme/guide/sequence-of-operations.html) | [Before You Begin: Standard DC APIs](https://developer.salesforce.com/docs/industries/cme/guide/comms-before-you-begi.html)| | [What are Standard Cart APIs?](https://developer.salesforce.com/docs/industries/cme/guide/std-cart-get-started.html) | [Enable the Standard Cart APIs](https://developer.salesforce.com/docs/industries/cme/guide/enable-standard-cart-apis.html) |[Enable Standard Digital Commerce](https://developer.salesforce.com/docs/industries/cme/guide/comms-enable-standard-digital-commerce.html) | | [Cart APIs vs Standard Cart APIs](https://developer.salesforce.com/docs/industries/cme/guide/comms-cart-based-apis-for-industries-cpq.html#cart-apis-vs-standard-cart-apis) | [Migrate to Standard Cart APIs](https://developer.salesforce.com/docs/industries/cme/guide/comms-migrate-to-std-cart.html) |[Migrate to Standard DC APIs](https://developer.salesforce.com/docs/industries/cme/guide/comms-migrate-to-sdc.html) | | [What are Digital Commerce (DC) APIs?](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-digital-commerce.html) | [Build the Base URL](https://developer.salesforce.com/docs/industries/cme/guide/comms-cart-based-apis-for-industries-cpq.html) | | | [Enterprise Product Catalog (EPC) APIs](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-enterprise-product-catalogepcrest-apis.html) | [Use CpqCartDocument](https://developer.salesforce.com/docs/industries/cme/guide/use-cart-document-cpq.html) | | | ![Alt text](https://developer.salesforce.com/docs/media/lm_integrate_2.png '{"class": "image-full", "title": "SFDocs"}') | ![Alt text](https://developer.salesforce.com/docs/media/lm_develop_2.png '{"class": "image-full", "title": "SFDocs"}') | ![Alt text](https://developer.salesforce.com/docs/media/lm_outcome_end_2.png '{"class": "image-full", "title": "SFDocs"}') | | ------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Go Deeper: Explore Common APIs Usage Examples** | **Extend Further: Learn About Administration Tasks and Troubleshooting** | **Know Your Resources & Get Help** | | [Standard Cart APIs](https://developer.salesforce.com/docs/industries/cme/guide/stdcart-api-examples.html) | [Execute the Administration Tasks for Standard Cart APIs](https://developer.salesforce.com/docs/industries/cme/guide/execute-administration-tasks.html) | [Communications, Media, and Energy & Utilities (CME) Managed Package Administration Guide](https://help.salesforce.com/s/articleView?id=ind.comms_CPQ_and_EPC.htm&type=5) | | [Cart APIs](https://developer.salesforce.com/docs/industries/cme/guide/cart-api-examples.html) | [Execute the Administration Tasks for Standard DC APIs](https://developer.salesforce.com/docs/industries/cme/guide/comms-run-admin-jobs-for-sdc.html) | [Communications, Media, and Energy & Utilities (CME) Managed Package Installation Guide](https://help.salesforce.com/s/articleView?id=ind.comms_cme_install_managed_package.htm&type=5) | | [Standard DC APIs](https://developer.salesforce.com/docs/industries/cme/references/std-dc-rest?meta=Summary) | [Troubleshooting: Standard Cart APIs](https://developer.salesforce.com/docs/industries/cme/guide/troubleshooting-cart.html) | [New Features for Communications, Media, and Energy & Utilities (CME) Managed Package](https://help.salesforce.com/s/articleView?id=release-notes.rn_comms_new_features_for_communications_media_energy_and_utilities_cme_managed_package.htm&release=252&type=5) | | [DC APIs ](https://developer.salesforce.com/docs/industries/cme/references/dc-rest1?meta=Summary) | [Diagnostic Tool: Standard Cart APIs](https://developer.salesforce.com/docs/industries/cme/guide/diagnostic-tool-cart.html) | [Trailhead: Get to Know Communications Cloud](https://trailhead.salesforce.com/content/learn/trails/get-to-know-communications-cloud) | | [EPC APIs](https://developer.salesforce.com/docs/industries/cme/references/epc?meta=Summary) | [Known Limitations: Standard Cart APIs](https://developer.salesforce.com/docs/industries/cme/guide/standard-cart-known-limitations.html) | [See What's New in the Latest Release](https://help.salesforce.com/s/articleView?id=release-notes.rn_industries_cpq.htm&release=252&type=5) | # Get Started with Standard Digital Commerce Find out how to enable Standard Digital Commerce and considerations when using it. # Get String Translation Dictionary Retrieve the dictionary for a specified domain and locale. ```nolang GET /v2/stringtranslations/{domain}/{local_code} ``` ## Apex Remote Service ```nolang APIHandler ``` ## Remote Method ```nolang getDictionary ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Industries Configure, Price, Quote Web APIs v2 Documentation](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). To take advantage of web caching, copy the value of the [ETag](https://en.wikipedia.org/wiki/HTTP_ETag) that is returned in the response header, and assign this value to [If-None-Match](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-None-Match) in the request header of subsequent requests. ## Example Response ```nolang { "totalSize": 1, "records": [{ "displaySequence": -1, "localeCode": "fr", "domain": "CPQ", "totalSize": 22, "dictionary": { "failed products": "failed products fr", "IPhone 6 >> 4 GB && 128 GB": "abc_translate_IPhone 6 >> 4 GB && 128 GB", "IPhone 6 >> \nRAM 4 GB && Memory 128 GB": "IPhone 6 >> 4 GB && 128 GB fr", "this is for P ^ P promotion": "this is for P ^ P promotion ", "this is for May & June": "this is for May & June _fr", "TestProd-4": "ptestprod-fr", "TestProd-11": "ytestprod-fr", "May & June": "fr_May & June", "this is test promo 1": "this & is & test < promo 1", "this is test promo 2": "this < is > test promo2", "Promo-5": "Test & Promo 5", "Promo-6": "Test < Promo 6", "TestProd-2": "atestprod-fr", "TestProd-20": "htestprod-20", "TestProd-1": "ztestprod-fr", "Demo-B": "demo-B_fr", "Demo-A": "é;chantillon-a", "TestProd-10": "TestProd-10_fr", "May17SpecialChars <= this text will be cut out": "serasdfwe", "TestProd-3": "gtestprod-3_fr", "SPE-26": "spe<26>", "Acc-1": "hr_fr" } }] } ``` # Get String Translations Retrieve all string translations for a specified language and list of string translation object IDs. ```nolang GET /v2/stringtranslations/ID[,ID...] ``` ## Remote Action ```nolang APIHandler ``` ## Remote Method ```nolang getStringTranslations ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | ---------------------------------------------------- | | Resource URL | /services/apexrest/{namespace}/v2/stringtranslations | ## Example Response ```nolang { "totalSize": 20, "actions": { "nexttranslation": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/stringtranslations?pagesize=20&offsetSize=20&lastRecordId=a3b1N000000pfprQAA" }, "remote": { "params": {} }, "client": { "params": {} } } }, "records": [{ "displaySequence": -1, "Id": "a3b1N000000pfpLQAQ", "Name": "ar-fi", "vlocity_cmt__StringId__c": "a3c1N0000016TkaQAE", "vlocity_cmt__Translation__c": "ar-fi", "vlocity_cmt__LocaleCode__c": "fi", "vlocity_cmt__StringId__r": { "attributes": { "type": "vlocity_cmt__String__c", "url": "/services/data/v43.0/sobjects/vlocity_cmt__String__c/a3c1N0000016TkaQAE" }, "Id": "a3c1N0000016TkaQAE", "vlocity_cmt__BaseString__c": "AR" } }, { "displaySequence": -1, "Id": "a3b1N000000pfpNQAQ", "Name": "ar", "vlocity_cmt__StringId__c": "a3c1N0000016TkaQAE", "vlocity_cmt__Translation__c": "ar", "vlocity_cmt__LocaleCode__c": "de", "vlocity_cmt__StringId__r": { "attributes": { "type": "vlocity_cmt__String__c", "url": "/services/data/v43.0/sobjects/vlocity_cmt__String__c/a3c1N0000016TkaQAE" }, "Id": "a3c1N0000016TkaQAE", "vlocity_cmt__BaseString__c": "AR" } }, { "displaySequence": -1, "Id": "a3b1N000000pfpOQAQ", "Name": "acc-1-fr", "vlocity_cmt__StringId__c": "a3c1N0000016TkbQAE", "vlocity_cmt__Translation__c": "acc-1-fr", "vlocity_cmt__LocaleCode__c": "fi", "vlocity_cmt__StringId__r": { "attributes": { "type": "vlocity_cmt__String__c", "url": "/services/data/v43.0/sobjects/vlocity_cmt__String__c/a3c1N0000016TkbQAE" }, "Id": "a3c1N0000016TkbQAE", "vlocity_cmt__BaseString__c": "Acc-1" } }, ... [EXAMPLE TRUNCATED FOR BREVITY] ``` # Get Template Retrieves a specific Sales Configuration Template by its ID, including metadata, associated tags, and cart totals. ## Resource Information - **Resource URL:** `/services/apexrest//v1/cpq/templates/{templateId}` - **HTTP Method:** GET - **Content-Type:** application/json - **Response Format:** JSON ## Request Body | Parameter | Type | Required | Description | | ---------- | ------ | -------- | --------------------------------------- | | templateId | String | Yes | The SalesConfigTemplate\_\_c record ID. | ## Example REST Request `GET /services/apexrest/vlocity_cmt/v1/cpq/templates/a1Bxx0000004XyzDEF` ## Response Parameters | Parameter | Type | Description | | ----------------------------- | ------- | --------------------------------------------------------------------------------------- | | Id | String | Template record ID. | | Name | String | Template name. | | Description\_\_c | String | Template description. | | Status\_\_c | String | Current lifecycle status. | | Category\_\_c | String | Template category. | | TemplateQuoteId\_\_c | String | ID of the underlying template Quote (if Quote-based). | | TemplateOrderId\_\_c | String | ID of the underlying template Order (if Order-based). | | CartType | String | Either "Quote" or "Order", indicating the type of the underlying cart. | | Tags | Array | List of associated tag objects, each containing Id, Name, and Description\_\_c. | | EffectiveOneTimeTotal\_\_c | Decimal | Total effective one-time charges from the template cart. | | EffectiveRecurringTotal\_\_c | Decimal | Total effective recurring charges from the template cart. | | EffectiveUsagePriceTotal\_\_c | Decimal | Total effective usage charges (only present when the Usage Pricing feature is enabled). | | PriceList\_\_r | Object | Related Price List with Id, Name, and CurrencyCode\_\_c. | ## Example REST Response Success Response (200): ``` { "success": true, "errorCode": "INVOKE-200", "result": { "messages": [], "templateDetails": { "template": { "Id": "a1Bxx0000004XyzDEF", "Name": "Enterprise Fiber Bundle", "vlocity_cmt__Description__c": "Standard fiber bundle for enterprise customers", "vlocity_cmt__Status__c": "Approved", "vlocity_cmt__Category__c": "Enterprise", "vlocity_cmt__TemplateQuoteId__c": "0Q0xx0000004CabCAE", "CartType": "Quote", "Tags": [ { "Id": "a2Cxx0000001AbcDEF", "Name": "Enterprise", "vlocity_cmt__Description__c": "Templates for enterprise customers" }, { "Id": "a2Cxx0000001DefGHI", "Name": "Fiber", "vlocity_cmt__Description__c": null } ], "vlocity_cmt__EffectiveOneTimeTotal__c": 299.99, "vlocity_cmt__EffectiveRecurringTotal__c": 89.99, "vlocity_cmt__EffectiveUsagePriceTotal__c": 0.00, "vlocity_cmt__PriceList__r": { "Id": "a3Dxx0000002GhiJKL", "Name": "Standard Price List", "vlocity_cmt__CurrencyCode__c": "USD" } } } } } ``` # Get Template Retrieves a specific Sales Configuration Template by its ID, including metadata, associated tags, and cart totals. ## Resource Information - **Resource URL:** `/services/apexrest//v1/cpq/templates/{templateId}` - **HTTP Method:** GET - **Content-Type:** application/json - **Response Format:** JSON ## Request Body | Parameter | Type | Required | Description | | ---------- | ------ | -------- | --------------------------------------- | | templateId | String | Yes | The SalesConfigTemplate\_\_c record ID. | ## Example REST Request `GET /services/apexrest/vlocity_cmt/v1/cpq/templates/a1Bxx0000004XyzDEF` ## Response Parameters | Parameter | Type | Description | | ----------------------------- | ------- | --------------------------------------------------------------------------------------- | | Id | String | Template record ID. | | Name | String | Template name. | | Description\_\_c | String | Template description. | | Status\_\_c | String | Current lifecycle status. | | Category\_\_c | String | Template category. | | TemplateQuoteId\_\_c | String | ID of the underlying template Quote (if Quote-based). | | TemplateOrderId\_\_c | String | ID of the underlying template Order (if Order-based). | | CartType | String | Either "Quote" or "Order", indicating the type of the underlying cart. | | Tags | Array | List of associated tag objects, each containing Id, Name, and Description\_\_c. | | EffectiveOneTimeTotal\_\_c | Decimal | Total effective one-time charges from the template cart. | | EffectiveRecurringTotal\_\_c | Decimal | Total effective recurring charges from the template cart. | | EffectiveUsagePriceTotal\_\_c | Decimal | Total effective usage charges (only present when the Usage Pricing feature is enabled). | | PriceList\_\_r | Object | Related Price List with Id, Name, and CurrencyCode\_\_c. | ## Example REST Response Success Response (200): ``` { "success": true, "errorCode": "INVOKE-200", "result": { "messages": [], "templateDetails": { "template": { "Id": "a1Bxx0000004XyzDEF", "Name": "Enterprise Fiber Bundle", "vlocity_cmt__Description__c": "Standard fiber bundle for enterprise customers", "vlocity_cmt__Status__c": "Approved", "vlocity_cmt__Category__c": "Enterprise", "vlocity_cmt__TemplateQuoteId__c": "0Q0xx0000004CabCAE", "CartType": "Quote", "Tags": [ { "Id": "a2Cxx0000001AbcDEF", "Name": "Enterprise", "vlocity_cmt__Description__c": "Templates for enterprise customers" }, { "Id": "a2Cxx0000001DefGHI", "Name": "Fiber", "vlocity_cmt__Description__c": null } ], "vlocity_cmt__EffectiveOneTimeTotal__c": 299.99, "vlocity_cmt__EffectiveRecurringTotal__c": 89.99, "vlocity_cmt__EffectiveUsagePriceTotal__c": 0.00, "vlocity_cmt__PriceList__r": { "Id": "a3Dxx0000002GhiJKL", "Name": "Standard Price List", "vlocity_cmt__CurrencyCode__c": "USD" } } } } } ``` # Get the Sample Orchestrator Code for CacheManagement APIs Get the Java classes that demonstrate how to run the Populate Cache APIs and Regenerate Cache APIs. The files you need for these Java classes are: - cache-management-orchestrator_populate.zip: [Download](https://volt.my.salesforce.com/sfc/p/o0000000IKm8/a/3m000000xCs3/FQhIzXJkg7Bosiy_GOH3XJIx6w.E9I8vSn8G3sjCxkc) - cache-management-orchestrator_regenerate.zip: [Download](https://volt.my.salesforce.com/sfc/p/o0000000IKm8/a/3m000000xCs8/J8cdi.f9uAEbhCPuhVBuysc1Fu6KpCr_qIw_gV5zuZA) ## What's Next [Open the Orchestrator Folder in Your IDE](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-open-the-orchestrator-folder-in-your-ide.md) # getFieldList Method Returns the configured fields in `FieldSet__c` for a specific feature name. ## Class ## Input Parameters | Parameter | Required | Description | | ----------- | -------- | ----------------------------------------------------------- | | featureName | Required | Name of feature name mentioned in Field Setting records. | | objectName | Required | Name of the object. Example: `vlocity_cmt__ServicePoint__c` | ## Output Parameters | Parameter | Description | | --------- | ------------------------ | | result | Returns array of fields. | ## Example Input Data ``` {"featureName":"MultiServiceMasterCartFields","objectName":"Quote"} ``` ## Example Output Data ``` {"result":[{"displaySequence":1,"objectAPIName":"vlocity_cmt__ServicePoint__c","objectName":"vlocity_cmt__ServicePoint__c","fieldLabel":"Market Identifier","fieldAPIName":"vlocity_cmt__MarketIdentifier__c","fieldName":"vlocity_cmt__MarketIdentifier__c"},{"displaySequence":2,"objectAPIName":"vlocity_cmt__Premises__c","objectName":"vlocity_cmt__ServicePoint__c","fieldLabel":"Street Address","fieldAPIName":"vlocity_cmt__StreetAddress__c","fieldName":"vlocity_cmt__PremisesId__r.vlocity_cmt__StreetAddress__c"},{"displaySequence":3,"objectAPIName":"vlocity_cmt__Premises__c","objectName":"vlocity_cmt__ServicePoint__c","fieldLabel":"City","fieldAPIName":"vlocity_cmt__City__c","fieldName":"vlocity_cmt__PremisesId__r.vlocity_cmt__City__c"},{"displaySequence":4,"objectAPIName":"vlocity_cmt__Premises__c","objectName":"vlocity_cmt__ServicePoint__c","fieldLabel":"Postal Code","fieldAPIName":"vlocity_cmt__PostalCode__c","fieldName":"vlocity_cmt__PremisesId__r.vlocity_cmt__PostalCode__c"},{"displaySequence":5,"objectAPIName":"vlocity_cmt__ServicePoint__c","objectName":"vlocity_cmt__ServicePoint__c","fieldLabel":"Utility Provider","fieldAPIName":"vlocity_cmt__UtilityProvider__c","fieldName":"vlocity_cmt__UtilityProvider__c"},{"displaySequence":6,"objectAPIName":"vlocity_cmt__ServicePoint__c","objectName":"vlocity_cmt__ServicePoint__c","fieldLabel":"Average Monthly Usage","fieldAPIName":"vlocity_cmt__AverageMonthlyUsage__c","fieldName":"vlocity_cmt__AverageMonthlyUsage__c"},{"displaySequence":7,"objectAPIName":"vlocity_cmt__ServicePoint__c","objectName":"vlocity_cmt__ServicePoint__c","fieldLabel":"Load Profile","fieldAPIName":"vlocity_cmt__LoadProfile__c","fieldName":"vlocity_cmt__LoadProfile__c"},{"displaySequence":8,"objectAPIName":"vlocity_cmt__ServicePoint__c","objectName":"vlocity_cmt__ServicePoint__c","fieldLabel":"Voltage Level","fieldAPIName":"vlocity_cmt__VoltageLevel__c","fieldName":"vlocity_cmt__VoltageLevel__c"}],"error":"OK"} ``` # getGroupMembers Method Returns a set of paginated member-records within a group. ## Class ## Input Parameters | Parameter | Required | Description | | --------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | parentId | Required | Opportunity ID. | | contextId | Required | Parent cart Id (Master/Enterprise Quote/Order Id) | | groupId | Required | Group Id | | pageSize | Optional: Defaults to 20 | Page size for pagination. | | offset | Optional: Defaults to 0 | Offset for pagination | | cartType | Optional: Defaults to Quote | Quote or Order | | filters | Optional | Consists of Field to search on and the sub-string value to search against, separated by colon(:). Supports multiple such sets, separated by comma(,). Example: "vlocity_cmt**LoadProfile**c:SMB%20Low,vlocity_cmt**IsKeyAtPremises**c:true" | | sortBy | Optional | Field to sort on along with the sort order. Example: “vlocity_cmt**PremisesId**r.vlocity_cmt**StreetAddress**c ASC” | ## Output Parameters | Parameter | Description | | --------- | ------------------------------------- | | result | JSONResult containing member records. | ## Example Input Data ``` {"offset":0,"pageSize":20,"contextId":"0Q00b000000znTYCAY","parentId":"0060b00000vGbYbAAK","groupId":"a4M0b000002CWMaEAO","cartType":"Quote"} ``` ## Example Output Data ``` {"totalSize":1,"records":[{"displaySequence":-1,"h_cpq_ecomm__ServicePointId__r":{"Name":"May06_Acc01-Premise - ServicePoint - 4","h_cpq_ecomm__PremisesId__r":{"h_cpq_ecomm__PostalCode__c":"30080","h_cpq_ecomm__City__c":"San Francisco","h_cpq_ecomm__StreetAddress__c":"lone Street","Name":"May06_Acc01-Premise"},"h_cpq_ecomm__IsKeyAtPremises__c":false,"h_cpq_ecomm__LoadProfile__c":"SMB Low","h_cpq_ecomm__MarketIdentifier__c":"Identifier - 38.79059592238243 - 4","h_cpq_ecomm__ActivationDate__c":"2020-05-09","h_cpq_ecomm__UtilityProvider__c":"Other","h_cpq_ecomm__VoltageLevel__c":"Low","h_cpq_ecomm__AverageMonthlyUsage__c":6364,"h_cpq_ecomm__OperationArea__c":null,"Id":"a3h0b00000CwSUFAA3"},"Id":{"value":"a4o0b000000VN98AAG","previousValue":null,"originalValue":null,"messages":[],"label":null,"hidden":null,"fieldName":null,"editable":null,"dataType":null,"alternateValues":null,"actions":{}},"h_cpq_ecomm__MemberType__c":{"value":"ServicePoint","previousValue":null,"originalValue":null,"messages":[],"label":null,"hidden":null,"fieldName":null,"editable":null,"dataType":null,"alternateValues":null,"actions":{}},"h_cpq_ecomm__LockedBy__c":{"value":null,"previousValue":null,"originalValue":null,"messages":[],"label":null,"hidden":null,"fieldName":null,"editable":null,"dataType":null,"alternateValues":null,"actions":{}},"h_cpq_ecomm__LockedFor__c":{"value":null,"previousValue":null,"originalValue":null,"messages":[],"label":null,"hidden":null,"fieldName":null,"editable":null,"dataType":null,"alternateValues":null,"actions":{}},"h_cpq_ecomm__AsyncOperation__c":{"value":null,"previousValue":null,"originalValue":null,"messages":[],"label":null,"hidden":null,"fieldName":null,"editable":null,"dataType":null,"alternateValues":null,"actions":{}},"h_cpq_ecomm__QuoteGroupId__c":{"value":"a4M0b000002CWMaEAO","previousValue":null,"originalValue":null,"messages":[],"label":null,"hidden":null,"fieldName":null,"editable":null,"dataType":null,"alternateValues":null,"actions":{}},"h_cpq_ecomm__ServicePointId__c":{"value":"a3h0b00000CwSUFAA3","previousValue":null,"originalValue":null,"messages":[],"label":null,"hidden":null,"fieldName":null,"editable":null,"dataType":null,"alternateValues":null,"actions":{}}}]} ``` # getGroups Method Returns a list of groups under a Master/Enterprise (Mega) quote or order, specific for a member-type. ## Class ## Input Parameters | Parameter | Required | Description | | ------------------------- | ------------------------------------------ | ------------------------------------------------------------------------------------------------------ | | parentId | Required | Opportunity ID. | | contextId | Required | Parent cart ID (Master or Enterprise quote or order ID). | | pageSize | Optional: Defaults to 20 | Page size for pagination. | | offset | Optional: Defaults to 0 | Offset for pagination. | | cartType | Optional: Defaults to Quote | Quote or order. | | memberType | Optional: Defaults to return all the types | CPQ Group Member Type Name. For example: ServicePoint. | | isGroupAssociatedWithCart | Optional: Defaults to true | True value will try to fetch and return the corresponding Group-Cart record as well. | | searchBy | Optional | Sub-string to search within the group and it’s members. Returns matching search results as a response. | ## Output Parameters | Parameter | Description | | --------- | ---------------------------------------------------------------------------------------------------------- | | result | JSONResult with Group and corresponding Cart record (If applicable). Please see sample output for details. | ## Example Input Data ``` {"parentId":"0060b00000vGbYbAAK","contextId":"0Q00b000000znTYCAY","pageSize":20,"offset":0,"memberType":"ServicePoint","cartType":"Quote"} ``` ## Example Output Data ``` {"totalSize":0,"records":[{"actions":{"getGroupedServices":{"rest":{"params":{},"method":null,"link":null},"remote":{"params":{"methodName":"getGroupedServices","groupCartId":"0Q00b000000znTiCAI","offset":0,"pageSize":20,"contextId":"0Q00b000000znTYCAY","parentId":"0060b00000vGbYbAAK","groupId":"a4M0b000002CWMGEA4"}},"client":{"params":{}}},"getGroupMembers":{"rest":{"params":{},"method":null,"link":null},"remote":{"params":{"methodName":"getGroupMembers","offset":0,"pageSize":20,"contextId":"0Q00b000000znTYCAY","parentId":"0060b00000vGbYbAAK","groupId":"a4M0b000002CWMGEA4"}},"client":{"params":{}}}},"displaySequence":-1,"groupId":"a4M0b000002CWMGEA4","itemsCount":1,"groupName":"Group-1","groupCartId":"0Q00b000000znTiCAI","groupCartURL":"apex/h_cpq_ecomm__MultiServiceHybridCPQ?id=0Q00b000000znTiCAI&parentId=0060b00000vGbYbAAK&groupCart=true&groupId=a4M0b000002CWMGEA4&contextId=0Q00b000000znTYCAY&cartType=Quote","groupCart":{"attributes":{"type":"Quote","url":"/services/data/v49.0/sobjects/Quote/0Q00b000000znTiCAI"},"h_cpq_ecomm__IsPriced__c":false,"h_cpq_ecomm__IsValidated__c":false,"Id":"0Q00b000000znTiCAI","RecordTypeId":"0120b000000hxEhAAI"},"hasUnappliedGroupItems":true,"Id":{"value":"a4M0b000002CWMGEA4","previousValue":null,"originalValue":null,"messages":[],"label":null,"hidden":null,"fieldName":null,"editable":null,"dataType":null,"alternateValues":null,"actions":{}},"h_cpq_ecomm__MemberCount__c":{"value":1,"previousValue":null,"originalValue":null,"messages":[],"label":null,"hidden":null,"fieldName":null,"editable":null,"dataType":null,"alternateValues":null,"actions":{}},"h_cpq_ecomm__LockedBy__c":{"value":null,"previousValue":null,"originalValue":null,"messages":[],"label":null,"hidden":null,"fieldName":null,"editable":null,"dataType":null,"alternateValues":null,"actions":{}},"Name":{"value":"Group-1","previousValue":null,"originalValue":null,"messages":[],"label":null,"hidden":null,"fieldName":null,"editable":null,"dataType":null,"alternateValues":null,"actions":{}},"h_cpq_ecomm__Description__c":{"value":null,"previousValue":null,"originalValue":null,"messages":[],"label":null,"hidden":null,"fieldName":null,"editable":null,"dataType":null,"alternateValues":null,"actions":{}},"h_cpq_ecomm__MemberType__c":{"value":"ServicePoint","previousValue":null,"originalValue":null,"messages":[],"label":null,"hidden":null,"fieldName":null,"editable":null,"dataType":null,"alternateValues":null,"actions":{}},"h_cpq_ecomm__MultiServiceMessageData__c":{"value":null,"previousValue":null,"originalValue":null,"messages":[],"label":null,"hidden":null,"fieldName":null,"editable":null,"dataType":null,"alternateValues":null,"actions":{}},"h_cpq_ecomm__LockedFor__c":{"value":null,"previousValue":null,"originalValue":null,"messages":[],"label":null,"hidden":null,"fieldName":null,"editable":null,"dataType":null,"alternateValues":null,"actions":{}},"h_cpq_ecomm__AsyncJobId__c":{"value":null,"previousValue":null,"originalValue":null,"messages":[],"label":null,"hidden":null,"fieldName":null,"editable":null,"dataType":null,"alternateValues":null,"actions":{}},"h_cpq_ecomm__AsyncOperation__c":{"value":null,"previousValue":null,"originalValue":null,"messages":[],"label":null,"hidden":null,"fieldName":null,"editable":null,"dataType":null,"alternateValues":null,"actions":{}},"h_cpq_ecomm__HasUnappliedGroupItems__c":{"value":true,"previousValue":null,"originalValue":null,"messages":[],"label":null,"hidden":null,"fieldName":null,"editable":null,"dataType":null,"alternateValues":null,"actions":{}},"h_cpq_ecomm__GroupCartId__c":{"value":"0Q00b000000znTiCAI","previousValue":null,"originalValue":null,"messages":[],"label":null,"hidden":null,"fieldName":null,"editable":null,"dataType":null,"alternateValues":null,"actions":{}},"h_cpq_ecomm__GroupCartId__r":{"h_cpq_ecomm__IsValidated__c":false,"h_cpq_ecomm__IsPriced__c":false,"h_cpq_ecomm__TrackingNumber__c":null,"h_cpq_ecomm__MultiServiceMessageData__c":null,"h_cpq_ecomm__DefaultServicePointId__c":null}}],"data":{"groupTotalCount":1}}"masterCartId":"0Q04x000000gZbWCAU","error":"OK"} ``` # getMasterCarts Method Returns a list of master carts (quotes and orders) for an opportunity. ## Class ## Input Parameters | Parameter | Required | Description | | --------- | -------------------------------- | --------------- | | parentId | Required | Opportunity ID. | | cartType | Optional: Default value is Quote | Quote or order. | ## Output Parameters | Parameter | Description | | --------- | ---------------------------------------- | | result | Contains an array of master cart object. | ## Example Input Data ``` {"parentId":"0064x000002RPeOAAW","cartType":"Quote"} ``` ## Example Output Data ``` {"result":[{"attributes":{"type":"Quote","url":"/services/data/v50.0/sobjects/Quote/0Q04x000000gUjNCAU"},"Id":"0Q04x000000gUjNCAU","Name":"M-2","RecordTypeId":"0124x000000t0c8AAA"},{"attributes":{"type":"Quote","url":"/services/data/v50.0/sobjects/Quote/0Q04x000000gTvPCAU"},"Id":"0Q04x000000gTvPCAU","Name":"M-1","RecordTypeId":"0124x000000t0c8AAA"}],"error":"OK"} ``` # getMemberTypeList Method Returns a list of CPQ Member Type custom metadata. ## Class ## Input Parameters | Parameter | Required | Description | | --------------- | -------------------------------- | ------------------------------------------------------------------------------------ | | activeOnly | Optional: Default to true | True: Return only active member type records. False: Return all member type records. | | sortBy | Optional: Default to Name and ID | Sort by field name(s) in a comma-separated list. Example: `Name , Id` | | sortByDirection | Optional | ASC (ascending) or DESC (descending). | ## Output Parameters | Parameter | Description | | --------- | ---------------------------------------- | | result | Returns array of CPQ Member Type records | ## Example Input Data ``` tbd ``` ## Example Output Data ``` {"result":[{"attributes":{"type":"vlocity_cmt__CpqMemberType__mdt","url":"/services/data/v51.0/sobjects/vlocity_cmt__CpqMemberType__mdt/m055g000000c1DOAAY"},"vlocity_cmt__OrderFieldName__c":"vlocity_cmt__DefaultServicePointId__c","MasterLabel":"Service Point","vlocity_cmt__OrderItemFieldName__c":"vlocity_cmt__ServicePointId__c","vlocity_cmt__QuoteFieldName__c":"vlocity_cmt__DefaultServicePointId__c","Id":"m055g000000c1DOAAY","vlocity_cmt__DisplaySequence__c":1.0,"vlocity_cmt__IsActive__c":true,"vlocity_cmt__QuoteLineItemFieldName__c":"vlocity_cmt__ServicePointId__c","Language":"en_US","vlocity_cmt__QuoteMemberFieldName__c":"vlocity_cmt__ServicePointId__c","Label":"Service Point","DeveloperName":"ServicePoint","QualifiedApiName":"vlocity_cmt__ServicePoint","vlocity_cmt__MemberObjectName__c":"vlocity_cmt__ServicePoint__c","NamespacePrefix":"cme_232","vlocity_cmt__OrderMemberFieldName__c":"vlocity_cmt__ServicePointId__c"}],"error":"OK"} ``` # getObjectFieldsDescribe Method For a given set of objects, returns all their fields and details, such as label, name, type, and others. ## Class ## Input Parameters

Parameter

Required

Description

objectNames

Required

Object names of all the objects for which you want details. Object names need to be in array format, such as [“Quote”, “vlocity_cmt__QuoteGroup__c”].

 

Full API name must be passed (including the namespace prefix).

## Output Parameters A serialised JSON that contains the details of all requested objects and their fields. For more details, see the sample output. ## Example Input Data ``` {"objectNames":["Quote"]} ``` ## Example Output Data ``` {"result":{"Quote":{"vlocity_cmt__RecurringTotal__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":true,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":false,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Recurring Total","length":0,"mask":null,"maskType":null,"name":"vlocity_cmt__RecurringTotal__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":18,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":2,"searchPrefilterable":false,"soapType":"xsd:double","sortable":true,"type":"currency","unique":false,"updateable":false,"writeRequiresMasterRead":false},"vlocity_cmt__OneTimeTotal__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":true,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":false,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"One Time Total","length":0,"mask":null,"maskType":null,"name":"vlocity_cmt__OneTimeTotal__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":18,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":2,"searchPrefilterable":false,"soapType":"xsd:double","sortable":true,"type":"currency","unique":false,"updateable":false,"writeRequiresMasterRead":false},"vlocity_cmt__EffectiveRecurringTotal__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":true,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":false,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Effective Recurring Total","length":0,"mask":null,"maskType":null,"name":"vlocity_cmt__EffectiveRecurringTotal__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":18,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":2,"searchPrefilterable":false,"soapType":"xsd:double","sortable":true,"type":"currency","unique":false,"updateable":false,"writeRequiresMasterRead":false},"vlocity_cmt__EffectiveOneTimeTotal__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":true,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":false,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Effective One Time Total","length":0,"mask":null,"maskType":null,"name":"vlocity_cmt__EffectiveOneTimeTotal__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":18,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":2,"searchPrefilterable":false,"soapType":"xsd:double","sortable":true,"type":"currency","unique":false,"updateable":false,"writeRequiresMasterRead":false},"vlocity_cmt__ValidationStatus__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":765,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":true,"defaultValue":"Not yet run","defaultValueFormula":null,"defaultedOnCreate":true,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":"The result status of the last validation run","label":"Validation Status","length":255,"mask":null,"maskType":null,"name":"vlocity_cmt__ValidationStatus__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[{"active":true,"defaultValue":true,"label":"Not yet run","validFor":null,"value":"Not yet run"},{"active":true,"defaultValue":false,"label":"Passed","validFor":null,"value":"Passed"},{"active":true,"defaultValue":false,"label":"Failed","validFor":null,"value":"Failed"}],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"picklist","unique":false,"updateable":true,"writeRequiresMasterRead":false},"vlocity_cmt__ValidationMessage__c":{"aggregatable":false,"aiPredictionField":false,"autoNumber":false,"byteLength":98304,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":"plaintextarea","filterable":false,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":"Message from the last validation run","label":"Validation Message","length":32768,"mask":null,"maskType":null,"name":"vlocity_cmt__ValidationMessage__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":false,"type":"textarea","unique":false,"updateable":true,"writeRequiresMasterRead":false},"vlocity_cmt__ValidationDate__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":"Date of last validation run","label":"Validation Date","length":0,"mask":null,"maskType":null,"name":"vlocity_cmt__ValidationDate__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:dateTime","sortable":true,"type":"datetime","unique":false,"updateable":true,"writeRequiresMasterRead":false},"vlocity_cmt__UsageMarginTotal__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Usage Margin Total","length":0,"mask":null,"maskType":null,"name":"vlocity_cmt__UsageMarginTotal__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":18,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":2,"searchPrefilterable":false,"soapType":"xsd:double","sortable":true,"type":"percent","unique":false,"updateable":true,"writeRequiresMasterRead":false},"vlocity_cmt__Type__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":765,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Type","length":255,"mask":null,"maskType":null,"name":"vlocity_cmt__Type__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[{"active":true,"defaultValue":false,"label":"Existing Customer - Upgrade","validFor":null,"value":"Existing Customer - Upgrade"},{"active":true,"defaultValue":false,"label":"Existing Customer - Replacement","validFor":null,"value":"Existing Customer - Replacement"},{"active":true,"defaultValue":false,"label":"Existing Customer - Downgrade","validFor":null,"value":"Existing Customer - Downgrade"},{"active":true,"defaultValue":false,"label":"New Customer","validFor":null,"value":"New Customer"}],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"picklist","unique":false,"updateable":true,"writeRequiresMasterRead":false},"vlocity_cmt__TrackingNumber__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":765,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Tracking Number","length":255,"mask":null,"maskType":null,"name":"vlocity_cmt__TrackingNumber__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"string","unique":false,"updateable":true,"writeRequiresMasterRead":false},"vlocity_cmt__SyncedOrderId__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":18,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Synced Order","length":18,"mask":null,"maskType":null,"name":"vlocity_cmt__SyncedOrderId__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":["Order"],"relationshipName":"vlocity_cmt__SyncedOrderId__r","relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":true,"soapType":"tns:ID","sortable":true,"type":"reference","unique":false,"updateable":true,"writeRequiresMasterRead":false},"vlocity_cmt__ShippingState__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":3900,"calculated":true,"calculatedFormula":"ShippingState","cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":false,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":true,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Shipping State","length":1300,"mask":null,"maskType":null,"name":"vlocity_cmt__ShippingState__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"string","unique":false,"updateable":false,"writeRequiresMasterRead":false},"vlocity_cmt__ShippingPostalCode__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":3900,"calculated":true,"calculatedFormula":"ShippingPostalCode","cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":false,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":true,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Shipping Postal Code","length":1300,"mask":null,"maskType":null,"name":"vlocity_cmt__ShippingPostalCode__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"string","unique":false,"updateable":false,"writeRequiresMasterRead":false},"vlocity_cmt__RecurringTotal2__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":true,"defaultValue":null,"defaultValueFormula":"0","defaultedOnCreate":true,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Parent Quote Recurring Total","length":0,"mask":null,"maskType":null,"name":"vlocity_cmt__RecurringTotal2__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":18,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":2,"searchPrefilterable":false,"soapType":"xsd:double","sortable":true,"type":"currency","unique":false,"updateable":true,"writeRequiresMasterRead":false},"vlocity_cmt__RecurringMarginTotal__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Recurring Margin Total","length":0,"mask":null,"maskType":null,"name":"vlocity_cmt__RecurringMarginTotal__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":18,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":2,"searchPrefilterable":false,"soapType":"xsd:double","sortable":true,"type":"percent","unique":false,"updateable":true,"writeRequiresMasterRead":false},"vlocity_cmt__QuoteTotal__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":true,"calculatedFormula":"vlocity_cmt__OneTimeTotal__c + Tax + ( vlocity_cmt__RecurringTotal__c * vlocity_cmt__NumberOfContractedMonths__c )","cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":false,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":true,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Quote Total","length":0,"mask":null,"maskType":null,"name":"vlocity_cmt__QuoteTotal__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":18,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":2,"searchPrefilterable":false,"soapType":"xsd:double","sortable":true,"type":"currency","unique":false,"updateable":false,"writeRequiresMasterRead":false},"vlocity_cmt__QuoteMarginTotal__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Quote Margin Total","length":0,"mask":null,"maskType":null,"name":"vlocity_cmt__QuoteMarginTotal__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":18,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":2,"searchPrefilterable":false,"soapType":"xsd:double","sortable":true,"type":"percent","unique":false,"updateable":true,"writeRequiresMasterRead":false},"vlocity_cmt__PriceListId__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":18,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Price List","length":18,"mask":null,"maskType":null,"name":"vlocity_cmt__PriceListId__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":["vlocity_cmt__PriceList__c"],"relationshipName":"vlocity_cmt__PriceListId__r","relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":true,"soapType":"tns:ID","sortable":true,"type":"reference","unique":false,"updateable":true,"writeRequiresMasterRead":false},"vlocity_cmt__PoNumber__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":765,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"PO Number","length":255,"mask":null,"maskType":null,"name":"vlocity_cmt__PoNumber__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"string","unique":false,"updateable":true,"writeRequiresMasterRead":false},"vlocity_cmt__PoDate__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"PO Date","length":0,"mask":null,"maskType":null,"name":"vlocity_cmt__PoDate__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:date","sortable":true,"type":"date","unique":false,"updateable":true,"writeRequiresMasterRead":false},"vlocity_cmt__OriginatingChannel__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":765,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Originating Channel","length":255,"mask":null,"maskType":null,"name":"vlocity_cmt__OriginatingChannel__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[{"active":true,"defaultValue":false,"label":"Web","validFor":null,"value":"Web"},{"active":true,"defaultValue":false,"label":"Call Center","validFor":null,"value":"Call Center"},{"active":true,"defaultValue":false,"label":"Retail","validFor":null,"value":"Retail"},{"active":true,"defaultValue":false,"label":"Dealer","validFor":null,"value":"Dealer"}],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"picklist","unique":false,"updateable":true,"writeRequiresMasterRead":false},"vlocity_cmt__OneTimeTotal2__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":true,"defaultValue":null,"defaultValueFormula":"0","defaultedOnCreate":true,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Parent Quote One Time Total","length":0,"mask":null,"maskType":null,"name":"vlocity_cmt__OneTimeTotal2__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":18,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":2,"searchPrefilterable":false,"soapType":"xsd:double","sortable":true,"type":"currency","unique":false,"updateable":true,"writeRequiresMasterRead":false},"vlocity_cmt__OneTimeMarginTotal__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"One Time Margin Total","length":0,"mask":null,"maskType":null,"name":"vlocity_cmt__OneTimeMarginTotal__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":18,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":2,"searchPrefilterable":false,"soapType":"xsd:double","sortable":true,"type":"percent","unique":false,"updateable":true,"writeRequiresMasterRead":false},"vlocity_cmt__OneTimeLoyaltyTotal__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":true,"defaultValue":null,"defaultValueFormula":"0","defaultedOnCreate":true,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"One Time Loyalty Total","length":0,"mask":null,"maskType":null,"name":"vlocity_cmt__OneTimeLoyaltyTotal__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":18,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:double","sortable":true,"type":"double","unique":false,"updateable":true,"writeRequiresMasterRead":false},"vlocity_cmt__NumberOfContractedMonths__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Number Of Contracted Months","length":0,"mask":null,"maskType":null,"name":"vlocity_cmt__NumberOfContractedMonths__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":18,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:double","sortable":true,"type":"double","unique":false,"updateable":true,"writeRequiresMasterRead":false},"vlocity_cmt__MultiServiceMessageData__c":{"aggregatable":false,"aiPredictionField":false,"autoNumber":false,"byteLength":98304,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":"plaintextarea","filterable":false,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Multi Service Message Data","length":32768,"mask":null,"maskType":null,"name":"vlocity_cmt__MultiServiceMessageData__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":false,"type":"textarea","unique":false,"updateable":true,"writeRequiresMasterRead":false},"vlocity_cmt__LeadSource__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":765,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Lead Source","length":255,"mask":null,"maskType":null,"name":"vlocity_cmt__LeadSource__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[{"active":true,"defaultValue":false,"label":"Web","validFor":null,"value":"Web"},{"active":true,"defaultValue":false,"label":"Phone Inquiry","validFor":null,"value":"Phone Inquiry"},{"active":true,"defaultValue":false,"label":"Partner Referral","validFor":null,"value":"Partner Referral"},{"active":true,"defaultValue":false,"label":"Purchased List","validFor":null,"value":"Purchased List"},{"active":true,"defaultValue":false,"label":"Other","validFor":null,"value":"Other"}],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"picklist","unique":false,"updateable":true,"writeRequiresMasterRead":false},"vlocity_cmt__LastPricedAt__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Last Priced At","length":0,"mask":null,"maskType":null,"name":"vlocity_cmt__LastPricedAt__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:dateTime","sortable":true,"type":"datetime","unique":false,"updateable":true,"writeRequiresMasterRead":false},"vlocity_cmt__IsValidated__c":{"aggregatable":false,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":true,"calculatedFormula":"NOT(ISNULL(vlocity_cmt__ValidationDate__c))","cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":false,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":true,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":true,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Is Validated","length":0,"mask":null,"maskType":null,"name":"vlocity_cmt__IsValidated__c","nameField":false,"namePointing":false,"nillable":false,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:boolean","sortable":true,"type":"boolean","unique":false,"updateable":false,"writeRequiresMasterRead":false},"vlocity_cmt__IsPriced__c":{"aggregatable":false,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":true,"calculatedFormula":"NOT(ISNULL(vlocity_cmt__LastPricedAt__c))","cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":false,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":true,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":true,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Is Priced","length":0,"mask":null,"maskType":null,"name":"vlocity_cmt__IsPriced__c","nameField":false,"namePointing":false,"nillable":false,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:boolean","sortable":true,"type":"boolean","unique":false,"updateable":false,"writeRequiresMasterRead":false},"vlocity_cmt__ExternalPricingStatus__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":765,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":true,"defaultValue":"Not Ready","defaultValueFormula":null,"defaultedOnCreate":true,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"External Pricing Status","length":255,"mask":null,"maskType":null,"name":"vlocity_cmt__ExternalPricingStatus__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[{"active":true,"defaultValue":true,"label":"Not Ready","validFor":null,"value":"Not Ready"},{"active":true,"defaultValue":false,"label":"Ready","validFor":null,"value":"Ready"},{"active":true,"defaultValue":false,"label":"Requested","validFor":null,"value":"Requested"},{"active":true,"defaultValue":false,"label":"Request Confirmed","validFor":null,"value":"Request Confirmed"},{"active":true,"defaultValue":false,"label":"Invalidated","validFor":null,"value":"Invalidated"},{"active":true,"defaultValue":false,"label":"Expired","validFor":null,"value":"Expired"},{"active":true,"defaultValue":false,"label":"Completed","validFor":null,"value":"Completed"}],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"picklist","unique":false,"updateable":true,"writeRequiresMasterRead":false},"vlocity_cmt__EffectiveUsagePriceTotal__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Usage Price Total","length":0,"mask":null,"maskType":null,"name":"vlocity_cmt__EffectiveUsagePriceTotal__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":18,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":2,"searchPrefilterable":false,"soapType":"xsd:double","sortable":true,"type":"currency","unique":false,"updateable":true,"writeRequiresMasterRead":false},"vlocity_cmt__EffectiveUsageCostTotal__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Usage Cost Total","length":0,"mask":null,"maskType":null,"name":"vlocity_cmt__EffectiveUsageCostTotal__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":18,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":2,"searchPrefilterable":false,"soapType":"xsd:double","sortable":true,"type":"currency","unique":false,"updateable":true,"writeRequiresMasterRead":false},"vlocity_cmt__EffectiveRecurringCostTotal__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":true,"defaultValue":null,"defaultValueFormula":"0","defaultedOnCreate":true,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Effective Total: Recurring Costs","length":0,"mask":null,"maskType":null,"name":"vlocity_cmt__EffectiveRecurringCostTotal__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":16,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":2,"searchPrefilterable":false,"soapType":"xsd:double","sortable":true,"type":"currency","unique":false,"updateable":true,"writeRequiresMasterRead":false},"vlocity_cmt__EffectiveQuoteTotal__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":true,"calculatedFormula":"vlocity_cmt__EffectiveOneTimeTotal__c + Tax + ( vlocity_cmt__EffectiveRecurringTotal__c * vlocity_cmt__NumberOfContractedMonths__c )","cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":false,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":true,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Effective Quote Total","length":0,"mask":null,"maskType":null,"name":"vlocity_cmt__EffectiveQuoteTotal__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":18,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":2,"searchPrefilterable":false,"soapType":"xsd:double","sortable":true,"type":"currency","unique":false,"updateable":false,"writeRequiresMasterRead":false},"vlocity_cmt__EffectiveOneTimeLoyaltyTotal__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":true,"defaultValue":null,"defaultValueFormula":"0","defaultedOnCreate":true,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Effective Total: One Time Loyalty","length":0,"mask":null,"maskType":null,"name":"vlocity_cmt__EffectiveOneTimeLoyaltyTotal__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":18,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:double","sortable":true,"type":"double","unique":false,"updateable":true,"writeRequiresMasterRead":false},"vlocity_cmt__EffectiveOneTimeCostTotal__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":true,"defaultValue":null,"defaultValueFormula":"0","defaultedOnCreate":true,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Effective Total: One Time Costs","length":0,"mask":null,"maskType":null,"name":"vlocity_cmt__EffectiveOneTimeCostTotal__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":16,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":2,"searchPrefilterable":false,"soapType":"xsd:double","sortable":true,"type":"currency","unique":false,"updateable":true,"writeRequiresMasterRead":false},"vlocity_cmt__EffectiveBaseRecurringCharge__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Effective Total: Base Recurring Charges","length":0,"mask":null,"maskType":null,"name":"vlocity_cmt__EffectiveBaseRecurringCharge__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":18,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":2,"searchPrefilterable":false,"soapType":"xsd:double","sortable":true,"type":"currency","unique":false,"updateable":true,"writeRequiresMasterRead":false},"vlocity_cmt__EffectiveBaseOneTimeCharge__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Effective Total: Base One Time Charges","length":0,"mask":null,"maskType":null,"name":"vlocity_cmt__EffectiveBaseOneTimeCharge__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":18,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":2,"searchPrefilterable":false,"soapType":"xsd:double","sortable":true,"type":"currency","unique":false,"updateable":true,"writeRequiresMasterRead":false},"vlocity_cmt__DeliveryInstallationStatus__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":765,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Delivery Installation Status","length":255,"mask":null,"maskType":null,"name":"vlocity_cmt__DeliveryInstallationStatus__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[{"active":true,"defaultValue":false,"label":"In progress","validFor":null,"value":"In progress"},{"active":true,"defaultValue":false,"label":"Yet to begin","validFor":null,"value":"Yet to begin"},{"active":true,"defaultValue":false,"label":"Completed","validFor":null,"value":"Completed"}],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"picklist","unique":false,"updateable":true,"writeRequiresMasterRead":false},"vlocity_cmt__DefaultServicePointId__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":18,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Service Point","length":18,"mask":null,"maskType":null,"name":"vlocity_cmt__DefaultServicePointId__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":["vlocity_cmt__ServicePoint__c"],"relationshipName":"vlocity_cmt__DefaultServicePointId__r","relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":true,"soapType":"tns:ID","sortable":true,"type":"reference","unique":false,"updateable":true,"writeRequiresMasterRead":false},"vlocity_cmt__DefaultServiceAccountId__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":18,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Service Account","length":18,"mask":null,"maskType":null,"name":"vlocity_cmt__DefaultServiceAccountId__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":["Account"],"relationshipName":"vlocity_cmt__DefaultServiceAccountId__r","relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":true,"soapType":"tns:ID","sortable":true,"type":"reference","unique":false,"updateable":true,"writeRequiresMasterRead":false},"vlocity_cmt__DefaultPremisesId__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":18,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Premises","length":18,"mask":null,"maskType":null,"name":"vlocity_cmt__DefaultPremisesId__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":["vlocity_cmt__Premises__c"],"relationshipName":"vlocity_cmt__DefaultPremisesId__r","relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":true,"soapType":"tns:ID","sortable":true,"type":"reference","unique":false,"updateable":true,"writeRequiresMasterRead":false},"vlocity_cmt__DefaultCurrencyPaymentMode__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":765,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":true,"defaultValue":"Currency","defaultValueFormula":null,"defaultedOnCreate":true,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Default Currency Payment Mode","length":255,"mask":null,"maskType":null,"name":"vlocity_cmt__DefaultCurrencyPaymentMode__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[{"active":true,"defaultValue":true,"label":"Currency","validFor":null,"value":"Currency"},{"active":true,"defaultValue":false,"label":"Loyalty","validFor":null,"value":"Loyalty"}],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":true,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"picklist","unique":false,"updateable":true,"writeRequiresMasterRead":false},"vlocity_cmt__DefaultBillingAccountId__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":18,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Billing Account","length":18,"mask":null,"maskType":null,"name":"vlocity_cmt__DefaultBillingAccountId__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":["Account"],"relationshipName":"vlocity_cmt__DefaultBillingAccountId__r","relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":true,"soapType":"tns:ID","sortable":true,"type":"reference","unique":false,"updateable":true,"writeRequiresMasterRead":false},"vlocity_cmt__CreditCheckDecision__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":765,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":true,"defaultValue":"Accepted","defaultValueFormula":null,"defaultedOnCreate":true,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Credit Check Decision","length":255,"mask":null,"maskType":null,"name":"vlocity_cmt__CreditCheckDecision__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[{"active":true,"defaultValue":true,"label":"Accepted","validFor":null,"value":"Accepted"},{"active":true,"defaultValue":false,"label":"Declined","validFor":null,"value":"Declined"},{"active":true,"defaultValue":false,"label":"Accepted-Reference","validFor":null,"value":"Accepted-Reference"},{"active":true,"defaultValue":false,"label":"Accept-Deposit","validFor":null,"value":"Accept-Deposit"},{"active":true,"defaultValue":false,"label":"Accepted-Upsell","validFor":null,"value":"Accepted-Upsell"},{"active":true,"defaultValue":false,"label":"Accepted-Downsale","validFor":null,"value":"Accepted-Downsale"}],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"picklist","unique":false,"updateable":true,"writeRequiresMasterRead":false},"vlocity_cmt__CampaignId__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":18,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Campaign","length":18,"mask":null,"maskType":null,"name":"vlocity_cmt__CampaignId__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":["Campaign"],"relationshipName":"vlocity_cmt__CampaignId__r","relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":true,"soapType":"tns:ID","sortable":true,"type":"reference","unique":false,"updateable":true,"writeRequiresMasterRead":false},"vlocity_cmt__AccountSLA__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":3900,"calculated":true,"calculatedFormula":"Opportunity.vlocity_cmt__AccountSLA__c","cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":false,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":true,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Account SLA","length":1300,"mask":null,"maskType":null,"name":"vlocity_cmt__AccountSLA__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"string","unique":false,"updateable":false,"writeRequiresMasterRead":false},"vlocity_cmt__AccountRecordType__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":3900,"calculated":true,"calculatedFormula":"Opportunity.vlocity_cmt__AccountRecordType__c","cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":false,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":true,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Account Record Type","length":1300,"mask":null,"maskType":null,"name":"vlocity_cmt__AccountRecordType__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"string","unique":false,"updateable":false,"writeRequiresMasterRead":false},"vlocity_cmt__RenewalSourceContractId__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":18,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Renewal Source Contract","length":18,"mask":null,"maskType":null,"name":"vlocity_cmt__RenewalSourceContractId__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":["Contract"],"relationshipName":"vlocity_cmt__RenewalSourceContractId__r","relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":true,"soapType":"tns:ID","sortable":true,"type":"reference","unique":false,"updateable":true,"writeRequiresMasterRead":false},"vlocity_cmt__IsContractRequired__c":{"aggregatable":false,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":true,"defaultValue":false,"defaultValueFormula":null,"defaultedOnCreate":true,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Require Contract","length":0,"mask":null,"maskType":null,"name":"vlocity_cmt__IsContractRequired__c","nameField":false,"namePointing":false,"nillable":false,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:boolean","sortable":true,"type":"boolean","unique":false,"updateable":true,"writeRequiresMasterRead":false},"vlocity_cmt__FrameContractId__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":18,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Frame Contract","length":18,"mask":null,"maskType":null,"name":"vlocity_cmt__FrameContractId__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":["Contract"],"relationshipName":"vlocity_cmt__FrameContractId__r","relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":true,"soapType":"tns:ID","sortable":true,"type":"reference","unique":false,"updateable":true,"writeRequiresMasterRead":false},"vlocity_cmt__QuoteGroupId__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":18,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Quote Group","length":18,"mask":null,"maskType":null,"name":"vlocity_cmt__QuoteGroupId__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":["vlocity_cmt__QuoteGroup__c"],"relationshipName":"vlocity_cmt__QuoteGroupId__r","relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":true,"soapType":"tns:ID","sortable":true,"type":"reference","unique":false,"updateable":true,"writeRequiresMasterRead":false},"vlocity_cmt__ParentQuoteId__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":18,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Parent Quote","length":18,"mask":null,"maskType":null,"name":"vlocity_cmt__ParentQuoteId__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":["Quote"],"relationshipName":"vlocity_cmt__ParentQuoteId__r","relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":true,"soapType":"tns:ID","sortable":true,"type":"reference","unique":false,"updateable":true,"writeRequiresMasterRead":false},"vlocity_cmt__OpportunityAccountId__c":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":3900,"calculated":true,"calculatedFormula":"Opportunity.AccountId","cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":false,"custom":true,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":true,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Opportunity Account Id","length":1300,"mask":null,"maskType":null,"name":"vlocity_cmt__OpportunityAccountId__c","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"string","unique":false,"updateable":false,"writeRequiresMasterRead":false},"CanCreateQuoteLineItems":{"aggregatable":false,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":false,"defaultValue":false,"defaultValueFormula":null,"defaultedOnCreate":true,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":false,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"CanCreateQuoteLineItems","length":0,"mask":null,"maskType":null,"name":"CanCreateQuoteLineItems","nameField":false,"namePointing":false,"nillable":false,"permissionable":false,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:boolean","sortable":false,"type":"boolean","unique":false,"updateable":false,"writeRequiresMasterRead":false},"GrandTotal":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":false,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Grand Total","length":0,"mask":null,"maskType":null,"name":"GrandTotal","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":18,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":2,"searchPrefilterable":false,"soapType":"xsd:double","sortable":true,"type":"currency","unique":false,"updateable":false,"writeRequiresMasterRead":false},"Discount":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":false,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Discount","length":0,"mask":null,"maskType":null,"name":"Discount","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":5,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":2,"searchPrefilterable":false,"soapType":"xsd:double","sortable":true,"type":"percent","unique":false,"updateable":false,"writeRequiresMasterRead":false},"AccountId":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":18,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":false,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Account ID","length":18,"mask":null,"maskType":null,"name":"AccountId","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":["Account"],"relationshipName":"Account","relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"tns:ID","sortable":true,"type":"reference","unique":false,"updateable":false,"writeRequiresMasterRead":false},"ContractId":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":18,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Contract ID","length":18,"mask":null,"maskType":null,"name":"ContractId","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":["Contract"],"relationshipName":"Contract","relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":true,"soapType":"tns:ID","sortable":true,"type":"reference","unique":false,"updateable":true,"writeRequiresMasterRead":false},"Fax":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":120,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Fax","length":40,"mask":null,"maskType":null,"name":"Fax","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"phone","unique":false,"updateable":true,"writeRequiresMasterRead":false},"Phone":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":120,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Phone","length":40,"mask":null,"maskType":null,"name":"Phone","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"phone","unique":false,"updateable":true,"writeRequiresMasterRead":false},"Email":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":240,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Email","length":80,"mask":null,"maskType":null,"name":"Email","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"email","unique":false,"updateable":true,"writeRequiresMasterRead":false},"AdditionalName":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":765,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Additional To Name","length":255,"mask":null,"maskType":null,"name":"AdditionalName","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"string","unique":false,"updateable":true,"writeRequiresMasterRead":false},"QuoteToName":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":765,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Quote To Name","length":255,"mask":null,"maskType":null,"name":"QuoteToName","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"string","unique":false,"updateable":true,"writeRequiresMasterRead":false},"ShippingName":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":765,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Ship To Name","length":255,"mask":null,"maskType":null,"name":"ShippingName","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"string","unique":false,"updateable":true,"writeRequiresMasterRead":false},"BillingName":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":765,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Bill To Name","length":255,"mask":null,"maskType":null,"name":"BillingName","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"string","unique":false,"updateable":true,"writeRequiresMasterRead":false},"AdditionalAddress":{"aggregatable":false,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":false,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Additional To","length":0,"mask":null,"maskType":null,"name":"AdditionalAddress","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":true,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"urn:address","sortable":false,"type":"address","unique":false,"updateable":false,"writeRequiresMasterRead":false},"AdditionalGeocodeAccuracy":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":765,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":"AdditionalAddress","controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Additional To Geocode Accuracy","length":255,"mask":null,"maskType":null,"name":"AdditionalGeocodeAccuracy","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[{"active":true,"defaultValue":false,"label":"Address","validFor":null,"value":"Address"},{"active":true,"defaultValue":false,"label":"NearAddress","validFor":null,"value":"NearAddress"},{"active":true,"defaultValue":false,"label":"Block","validFor":null,"value":"Block"},{"active":true,"defaultValue":false,"label":"Street","validFor":null,"value":"Street"},{"active":true,"defaultValue":false,"label":"ExtendedZip","validFor":null,"value":"ExtendedZip"},{"active":true,"defaultValue":false,"label":"Zip","validFor":null,"value":"Zip"},{"active":true,"defaultValue":false,"label":"Neighborhood","validFor":null,"value":"Neighborhood"},{"active":true,"defaultValue":false,"label":"City","validFor":null,"value":"City"},{"active":true,"defaultValue":false,"label":"County","validFor":null,"value":"County"},{"active":true,"defaultValue":false,"label":"State","validFor":null,"value":"State"},{"active":true,"defaultValue":false,"label":"Unknown","validFor":null,"value":"Unknown"}],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":true,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"picklist","unique":false,"updateable":true,"writeRequiresMasterRead":false},"AdditionalLongitude":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":"AdditionalAddress","controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Additional To Longitude","length":0,"mask":null,"maskType":null,"name":"AdditionalLongitude","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":18,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":15,"searchPrefilterable":false,"soapType":"xsd:double","sortable":true,"type":"double","unique":false,"updateable":true,"writeRequiresMasterRead":false},"AdditionalLatitude":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":"AdditionalAddress","controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Additional To Latitude","length":0,"mask":null,"maskType":null,"name":"AdditionalLatitude","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":18,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":15,"searchPrefilterable":false,"soapType":"xsd:double","sortable":true,"type":"double","unique":false,"updateable":true,"writeRequiresMasterRead":false},"AdditionalCountry":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":240,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":"AdditionalAddress","controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Additional To Country","length":80,"mask":null,"maskType":null,"name":"AdditionalCountry","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"string","unique":false,"updateable":true,"writeRequiresMasterRead":false},"AdditionalPostalCode":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":60,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":"AdditionalAddress","controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Additional To Zip/Postal Code","length":20,"mask":null,"maskType":null,"name":"AdditionalPostalCode","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"string","unique":false,"updateable":true,"writeRequiresMasterRead":false},"AdditionalState":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":240,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":"AdditionalAddress","controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Additional To State/Province","length":80,"mask":null,"maskType":null,"name":"AdditionalState","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"string","unique":false,"updateable":true,"writeRequiresMasterRead":false},"AdditionalCity":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":120,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":"AdditionalAddress","controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Additional To City","length":40,"mask":null,"maskType":null,"name":"AdditionalCity","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"string","unique":false,"updateable":true,"writeRequiresMasterRead":false},"AdditionalStreet":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":765,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":"AdditionalAddress","controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":"plaintextarea","filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Additional To Street","length":255,"mask":null,"maskType":null,"name":"AdditionalStreet","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"textarea","unique":false,"updateable":true,"writeRequiresMasterRead":false},"QuoteToAddress":{"aggregatable":false,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":false,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Quote To","length":0,"mask":null,"maskType":null,"name":"QuoteToAddress","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":true,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"urn:address","sortable":false,"type":"address","unique":false,"updateable":false,"writeRequiresMasterRead":false},"QuoteToGeocodeAccuracy":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":765,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":"QuoteToAddress","controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Quote To Geocode Accuracy","length":255,"mask":null,"maskType":null,"name":"QuoteToGeocodeAccuracy","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[{"active":true,"defaultValue":false,"label":"Address","validFor":null,"value":"Address"},{"active":true,"defaultValue":false,"label":"NearAddress","validFor":null,"value":"NearAddress"},{"active":true,"defaultValue":false,"label":"Block","validFor":null,"value":"Block"},{"active":true,"defaultValue":false,"label":"Street","validFor":null,"value":"Street"},{"active":true,"defaultValue":false,"label":"ExtendedZip","validFor":null,"value":"ExtendedZip"},{"active":true,"defaultValue":false,"label":"Zip","validFor":null,"value":"Zip"},{"active":true,"defaultValue":false,"label":"Neighborhood","validFor":null,"value":"Neighborhood"},{"active":true,"defaultValue":false,"label":"City","validFor":null,"value":"City"},{"active":true,"defaultValue":false,"label":"County","validFor":null,"value":"County"},{"active":true,"defaultValue":false,"label":"State","validFor":null,"value":"State"},{"active":true,"defaultValue":false,"label":"Unknown","validFor":null,"value":"Unknown"}],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":true,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"picklist","unique":false,"updateable":true,"writeRequiresMasterRead":false},"QuoteToLongitude":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":"QuoteToAddress","controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Quote To Longitude","length":0,"mask":null,"maskType":null,"name":"QuoteToLongitude","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":18,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":15,"searchPrefilterable":false,"soapType":"xsd:double","sortable":true,"type":"double","unique":false,"updateable":true,"writeRequiresMasterRead":false},"QuoteToLatitude":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":"QuoteToAddress","controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Quote To Latitude","length":0,"mask":null,"maskType":null,"name":"QuoteToLatitude","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":18,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":15,"searchPrefilterable":false,"soapType":"xsd:double","sortable":true,"type":"double","unique":false,"updateable":true,"writeRequiresMasterRead":false},"QuoteToCountry":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":240,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":"QuoteToAddress","controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Quote To Country","length":80,"mask":null,"maskType":null,"name":"QuoteToCountry","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"string","unique":false,"updateable":true,"writeRequiresMasterRead":false},"QuoteToPostalCode":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":60,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":"QuoteToAddress","controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Quote To Zip/Postal Code","length":20,"mask":null,"maskType":null,"name":"QuoteToPostalCode","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"string","unique":false,"updateable":true,"writeRequiresMasterRead":false},"QuoteToState":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":240,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":"QuoteToAddress","controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Quote To State/Province","length":80,"mask":null,"maskType":null,"name":"QuoteToState","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"string","unique":false,"updateable":true,"writeRequiresMasterRead":false},"QuoteToCity":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":120,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":"QuoteToAddress","controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Quote To City","length":40,"mask":null,"maskType":null,"name":"QuoteToCity","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"string","unique":false,"updateable":true,"writeRequiresMasterRead":false},"QuoteToStreet":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":765,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":"QuoteToAddress","controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":"plaintextarea","filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Quote To Street","length":255,"mask":null,"maskType":null,"name":"QuoteToStreet","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"textarea","unique":false,"updateable":true,"writeRequiresMasterRead":false},"ShippingAddress":{"aggregatable":false,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":false,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Ship To","length":0,"mask":null,"maskType":null,"name":"ShippingAddress","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":true,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"urn:address","sortable":false,"type":"address","unique":false,"updateable":false,"writeRequiresMasterRead":false},"ShippingGeocodeAccuracy":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":765,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":"ShippingAddress","controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Ship To Geocode Accuracy","length":255,"mask":null,"maskType":null,"name":"ShippingGeocodeAccuracy","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[{"active":true,"defaultValue":false,"label":"Address","validFor":null,"value":"Address"},{"active":true,"defaultValue":false,"label":"NearAddress","validFor":null,"value":"NearAddress"},{"active":true,"defaultValue":false,"label":"Block","validFor":null,"value":"Block"},{"active":true,"defaultValue":false,"label":"Street","validFor":null,"value":"Street"},{"active":true,"defaultValue":false,"label":"ExtendedZip","validFor":null,"value":"ExtendedZip"},{"active":true,"defaultValue":false,"label":"Zip","validFor":null,"value":"Zip"},{"active":true,"defaultValue":false,"label":"Neighborhood","validFor":null,"value":"Neighborhood"},{"active":true,"defaultValue":false,"label":"City","validFor":null,"value":"City"},{"active":true,"defaultValue":false,"label":"County","validFor":null,"value":"County"},{"active":true,"defaultValue":false,"label":"State","validFor":null,"value":"State"},{"active":true,"defaultValue":false,"label":"Unknown","validFor":null,"value":"Unknown"}],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":true,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"picklist","unique":false,"updateable":true,"writeRequiresMasterRead":false},"ShippingLongitude":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":"ShippingAddress","controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Ship To Longitude","length":0,"mask":null,"maskType":null,"name":"ShippingLongitude","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":18,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":15,"searchPrefilterable":false,"soapType":"xsd:double","sortable":true,"type":"double","unique":false,"updateable":true,"writeRequiresMasterRead":false},"ShippingLatitude":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":"ShippingAddress","controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Ship To Latitude","length":0,"mask":null,"maskType":null,"name":"ShippingLatitude","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":18,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":15,"searchPrefilterable":false,"soapType":"xsd:double","sortable":true,"type":"double","unique":false,"updateable":true,"writeRequiresMasterRead":false},"ShippingCountry":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":240,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":"ShippingAddress","controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Ship To Country","length":80,"mask":null,"maskType":null,"name":"ShippingCountry","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"string","unique":false,"updateable":true,"writeRequiresMasterRead":false},"ShippingPostalCode":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":60,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":"ShippingAddress","controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Ship To Zip/Postal Code","length":20,"mask":null,"maskType":null,"name":"ShippingPostalCode","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"string","unique":false,"updateable":true,"writeRequiresMasterRead":false},"ShippingState":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":240,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":"ShippingAddress","controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Ship To State/Province","length":80,"mask":null,"maskType":null,"name":"ShippingState","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"string","unique":false,"updateable":true,"writeRequiresMasterRead":false},"ShippingCity":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":120,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":"ShippingAddress","controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Ship To City","length":40,"mask":null,"maskType":null,"name":"ShippingCity","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"string","unique":false,"updateable":true,"writeRequiresMasterRead":false},"ShippingStreet":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":765,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":"ShippingAddress","controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":"plaintextarea","filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Ship To Street","length":255,"mask":null,"maskType":null,"name":"ShippingStreet","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"textarea","unique":false,"updateable":true,"writeRequiresMasterRead":false},"BillingAddress":{"aggregatable":false,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":false,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Bill To","length":0,"mask":null,"maskType":null,"name":"BillingAddress","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":true,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"urn:address","sortable":false,"type":"address","unique":false,"updateable":false,"writeRequiresMasterRead":false},"BillingGeocodeAccuracy":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":765,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":"BillingAddress","controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Bill To Geocode Accuracy","length":255,"mask":null,"maskType":null,"name":"BillingGeocodeAccuracy","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[{"active":true,"defaultValue":false,"label":"Address","validFor":null,"value":"Address"},{"active":true,"defaultValue":false,"label":"NearAddress","validFor":null,"value":"NearAddress"},{"active":true,"defaultValue":false,"label":"Block","validFor":null,"value":"Block"},{"active":true,"defaultValue":false,"label":"Street","validFor":null,"value":"Street"},{"active":true,"defaultValue":false,"label":"ExtendedZip","validFor":null,"value":"ExtendedZip"},{"active":true,"defaultValue":false,"label":"Zip","validFor":null,"value":"Zip"},{"active":true,"defaultValue":false,"label":"Neighborhood","validFor":null,"value":"Neighborhood"},{"active":true,"defaultValue":false,"label":"City","validFor":null,"value":"City"},{"active":true,"defaultValue":false,"label":"County","validFor":null,"value":"County"},{"active":true,"defaultValue":false,"label":"State","validFor":null,"value":"State"},{"active":true,"defaultValue":false,"label":"Unknown","validFor":null,"value":"Unknown"}],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":true,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"picklist","unique":false,"updateable":true,"writeRequiresMasterRead":false},"BillingLongitude":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":"BillingAddress","controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Bill To Longitude","length":0,"mask":null,"maskType":null,"name":"BillingLongitude","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":18,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":15,"searchPrefilterable":false,"soapType":"xsd:double","sortable":true,"type":"double","unique":false,"updateable":true,"writeRequiresMasterRead":false},"BillingLatitude":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":"BillingAddress","controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Bill To Latitude","length":0,"mask":null,"maskType":null,"name":"BillingLatitude","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":18,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":15,"searchPrefilterable":false,"soapType":"xsd:double","sortable":true,"type":"double","unique":false,"updateable":true,"writeRequiresMasterRead":false},"BillingCountry":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":240,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":"BillingAddress","controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Bill To Country","length":80,"mask":null,"maskType":null,"name":"BillingCountry","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"string","unique":false,"updateable":true,"writeRequiresMasterRead":false},"BillingPostalCode":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":60,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":"BillingAddress","controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Bill To Zip/Postal Code","length":20,"mask":null,"maskType":null,"name":"BillingPostalCode","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"string","unique":false,"updateable":true,"writeRequiresMasterRead":false},"BillingState":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":240,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":"BillingAddress","controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Bill To State/Province","length":80,"mask":null,"maskType":null,"name":"BillingState","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"string","unique":false,"updateable":true,"writeRequiresMasterRead":false},"BillingCity":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":120,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":"BillingAddress","controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Bill To City","length":40,"mask":null,"maskType":null,"name":"BillingCity","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"string","unique":false,"updateable":true,"writeRequiresMasterRead":false},"BillingStreet":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":765,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":"BillingAddress","controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":"plaintextarea","filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Bill To Street","length":255,"mask":null,"maskType":null,"name":"BillingStreet","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"textarea","unique":false,"updateable":true,"writeRequiresMasterRead":false},"LineItemCount":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":true,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":false,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":9,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Line Items","length":0,"mask":null,"maskType":null,"name":"LineItemCount","nameField":false,"namePointing":false,"nillable":true,"permissionable":false,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:int","sortable":true,"type":"int","unique":false,"updateable":false,"writeRequiresMasterRead":false},"TotalPrice":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":true,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":false,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Total Price","length":0,"mask":null,"maskType":null,"name":"TotalPrice","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":18,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":2,"searchPrefilterable":false,"soapType":"xsd:double","sortable":true,"type":"currency","unique":false,"updateable":false,"writeRequiresMasterRead":false},"Subtotal":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":true,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":false,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Subtotal","length":0,"mask":null,"maskType":null,"name":"Subtotal","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":18,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":2,"searchPrefilterable":false,"soapType":"xsd:double","sortable":true,"type":"currency","unique":false,"updateable":false,"writeRequiresMasterRead":false},"Description":{"aggregatable":false,"aiPredictionField":false,"autoNumber":false,"byteLength":96000,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":"plaintextarea","filterable":false,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Description","length":32000,"mask":null,"maskType":null,"name":"Description","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":false,"type":"textarea","unique":false,"updateable":true,"writeRequiresMasterRead":false},"ExpirationDate":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Expiration Date","length":0,"mask":null,"maskType":null,"name":"ExpirationDate","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:date","sortable":true,"type":"date","unique":false,"updateable":true,"writeRequiresMasterRead":false},"Status":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":120,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Status","length":40,"mask":null,"maskType":null,"name":"Status","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[{"active":true,"defaultValue":false,"label":"Draft","validFor":null,"value":"Draft"},{"active":true,"defaultValue":false,"label":"Needs Review","validFor":null,"value":"Needs Review"},{"active":true,"defaultValue":false,"label":"In Review","validFor":null,"value":"In Review"},{"active":true,"defaultValue":false,"label":"Approved","validFor":null,"value":"Approved"},{"active":true,"defaultValue":false,"label":"Rejected","validFor":null,"value":"Rejected"},{"active":true,"defaultValue":false,"label":"Presented","validFor":null,"value":"Presented"},{"active":true,"defaultValue":false,"label":"Accepted","validFor":null,"value":"Accepted"},{"active":true,"defaultValue":false,"label":"Denied","validFor":null,"value":"Denied"}],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"picklist","unique":false,"updateable":true,"writeRequiresMasterRead":false},"Tax":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Tax","length":0,"mask":null,"maskType":null,"name":"Tax","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":18,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":2,"searchPrefilterable":false,"soapType":"xsd:double","sortable":true,"type":"currency","unique":false,"updateable":true,"writeRequiresMasterRead":false},"ShippingHandling":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Shipping and Handling","length":0,"mask":null,"maskType":null,"name":"ShippingHandling","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":18,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":2,"searchPrefilterable":false,"soapType":"xsd:double","sortable":true,"type":"currency","unique":false,"updateable":true,"writeRequiresMasterRead":false},"IsSyncing":{"aggregatable":false,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":false,"custom":false,"defaultValue":false,"defaultValueFormula":null,"defaultedOnCreate":true,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Syncing","length":0,"mask":null,"maskType":null,"name":"IsSyncing","nameField":false,"namePointing":false,"nillable":false,"permissionable":false,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:boolean","sortable":true,"type":"boolean","unique":false,"updateable":false,"writeRequiresMasterRead":false},"QuoteNumber":{"aggregatable":true,"aiPredictionField":false,"autoNumber":true,"byteLength":90,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":false,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":true,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Quote Number","length":30,"mask":null,"maskType":null,"name":"QuoteNumber","nameField":false,"namePointing":false,"nillable":false,"permissionable":false,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"string","unique":false,"updateable":false,"writeRequiresMasterRead":false},"ContactId":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":18,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Contact ID","length":18,"mask":null,"maskType":null,"name":"ContactId","nameField":false,"namePointing":false,"nillable":true,"permissionable":true,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":["Contact"],"relationshipName":"Contact","relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":true,"soapType":"tns:ID","sortable":true,"type":"reference","unique":false,"updateable":true,"writeRequiresMasterRead":false},"Pricebook2Id":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":18,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Price Book ID","length":18,"mask":null,"maskType":null,"name":"Pricebook2Id","nameField":false,"namePointing":false,"nillable":true,"permissionable":false,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":["Pricebook2"],"relationshipName":"Pricebook2","relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":true,"soapType":"tns:ID","sortable":true,"type":"reference","unique":false,"updateable":true,"writeRequiresMasterRead":false},"OpportunityId":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":18,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Opportunity ID","length":18,"mask":null,"maskType":null,"name":"OpportunityId","nameField":false,"namePointing":false,"nillable":false,"permissionable":false,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":["Opportunity"],"relationshipName":"Opportunity","relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":true,"soapType":"tns:ID","sortable":true,"type":"reference","unique":false,"updateable":true,"writeRequiresMasterRead":false},"LastReferencedDate":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":false,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Last Referenced Date","length":0,"mask":null,"maskType":null,"name":"LastReferencedDate","nameField":false,"namePointing":false,"nillable":true,"permissionable":false,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:dateTime","sortable":true,"type":"datetime","unique":false,"updateable":false,"writeRequiresMasterRead":false},"LastViewedDate":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":false,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Last Viewed Date","length":0,"mask":null,"maskType":null,"name":"LastViewedDate","nameField":false,"namePointing":false,"nillable":true,"permissionable":false,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:dateTime","sortable":true,"type":"datetime","unique":false,"updateable":false,"writeRequiresMasterRead":false},"SystemModstamp":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":false,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":true,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"System Modstamp","length":0,"mask":null,"maskType":null,"name":"SystemModstamp","nameField":false,"namePointing":false,"nillable":false,"permissionable":false,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:dateTime","sortable":true,"type":"datetime","unique":false,"updateable":false,"writeRequiresMasterRead":false},"LastModifiedById":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":18,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":false,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":true,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Last Modified By ID","length":18,"mask":null,"maskType":null,"name":"LastModifiedById","nameField":false,"namePointing":false,"nillable":false,"permissionable":false,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":["User"],"relationshipName":"LastModifiedBy","relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"tns:ID","sortable":true,"type":"reference","unique":false,"updateable":false,"writeRequiresMasterRead":false},"LastModifiedDate":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":false,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":true,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Last Modified Date","length":0,"mask":null,"maskType":null,"name":"LastModifiedDate","nameField":false,"namePointing":false,"nillable":false,"permissionable":false,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:dateTime","sortable":true,"type":"datetime","unique":false,"updateable":false,"writeRequiresMasterRead":false},"CreatedById":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":18,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":false,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":true,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Created By ID","length":18,"mask":null,"maskType":null,"name":"CreatedById","nameField":false,"namePointing":false,"nillable":false,"permissionable":false,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":["User"],"relationshipName":"CreatedBy","relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"tns:ID","sortable":true,"type":"reference","unique":false,"updateable":false,"writeRequiresMasterRead":false},"CreatedDate":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":false,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":true,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Created Date","length":0,"mask":null,"maskType":null,"name":"CreatedDate","nameField":false,"namePointing":false,"nillable":false,"permissionable":false,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:dateTime","sortable":true,"type":"datetime","unique":false,"updateable":false,"writeRequiresMasterRead":false},"RecordTypeId":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":18,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Record Type ID","length":18,"mask":null,"maskType":null,"name":"RecordTypeId","nameField":false,"namePointing":false,"nillable":true,"permissionable":false,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":["RecordType"],"relationshipName":"RecordType","relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"tns:ID","sortable":true,"type":"reference","unique":false,"updateable":true,"writeRequiresMasterRead":false},"Name":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":765,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":true,"inlineHelpText":null,"label":"Quote Name","length":255,"mask":null,"maskType":null,"name":"Name","nameField":true,"namePointing":false,"nillable":false,"permissionable":false,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"string","unique":false,"updateable":true,"writeRequiresMasterRead":false},"IsDeleted":{"aggregatable":false,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":false,"custom":false,"defaultValue":false,"defaultValueFormula":null,"defaultedOnCreate":true,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Deleted","length":0,"mask":null,"maskType":null,"name":"IsDeleted","nameField":false,"namePointing":false,"nillable":false,"permissionable":false,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:boolean","sortable":true,"type":"boolean","unique":false,"updateable":false,"writeRequiresMasterRead":false},"OwnerId":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":18,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":true,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Owner ID","length":18,"mask":null,"maskType":null,"name":"OwnerId","nameField":false,"namePointing":true,"nillable":false,"permissionable":false,"picklistValues":[],"polymorphicForeignKey":true,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":["Group","User"],"relationshipName":"Owner","relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"tns:ID","sortable":true,"type":"reference","unique":false,"updateable":true,"writeRequiresMasterRead":false},"Id":{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":18,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":false,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":true,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":true,"inlineHelpText":null,"label":"Quote ID","length":18,"mask":null,"maskType":null,"name":"Id","nameField":false,"namePointing":false,"nillable":false,"permissionable":false,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"tns:ID","sortable":true,"type":"id","unique":false,"updateable":false,"writeRequiresMasterRead":false}}},"error":"OK"} ``` # getUngroupedRecords Method Returns a set of paginated non-members of a specific member-type. ## Class ## Input Parameters | Parameter | Required | Description | | ---------- | ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | parentId | Required | Opportunity ID. | | contextId | Required | Parent cart ID (Master or Enterprise quote or order ID). | | pageSize | Optional: Defaults to 20 | Page size for pagination. | | offset | Optional: Defaults to 0 | Offset for pagination. | | cartType | Optional: Defaults to Quote | Quote or order. | | memberType | Optional: Defaults to return all the types | CPQ Group Member Type Name. For example: ServicePoint. | | filters | Optional | Consists of Field to search on and the sub-string value to search against, separated by colon(:). Supports multiple such sets, separated by comma(,). Example: `vlocity_cmt__LoadProfile__c:SMB%20Low,vlocity_cmt__IsKeyAtPremises__c:true` | | sortBy | Optional | Field to sort on along with the sort order. Example: `vlocity_cmt__PremisesId__r.vlocity_cmt__StreetAddress__c ASC` | ## Output Parameters | Parameter | Description | | --------- | -------------------------------------------------------------- | | result | JSONResult with non-member records for a specific member-type. | ## Example Input Data ``` {"parentId":"0060b00000vGbYbAAK","contextId":"0Q00b000000znTYCAY","offset":0,"pageSize":20,"memberType":"ServicePoint","cartType":"Quote"} ``` ## Example Output Data ``` {"totalSize":0,"records":[{"displaySequence":-1,"Name":{"value":"May06_Acc01-Premise - ServicePoint - 2","previousValue":null,"originalValue":null,"messages":[],"label":null,"hidden":null,"fieldName":null,"editable":null,"dataType":null,"alternateValues":null,"actions":{}},"h_cpq_ecomm__PremisesId__r":{"Name":"May06_Acc01-Premise","h_cpq_ecomm__StreetAddress__c":"lone Street","h_cpq_ecomm__City__c":"San Francisco","h_cpq_ecomm__PostalCode__c":"30080"},"h_cpq_ecomm__IsKeyAtPremises__c":{"value":false,"previousValue":null,"originalValue":null,"messages":[],"label":null,"hidden":null,"fieldName":null,"editable":null,"dataType":null,"alternateValues":null,"actions":{}},"h_cpq_ecomm__LoadProfile__c":{"value":"SMB Low","previousValue":null,"originalValue":null,"messages":[],"label":null,"hidden":null,"fieldName":null,"editable":null,"dataType":null,"alternateValues":null,"actions":{}},"h_cpq_ecomm__MarketIdentifier__c":{"value":"Identifier - 572.1531770676341 - 2","previousValue":null,"originalValue":null,"messages":[],"label":null,"hidden":null,"fieldName":null,"editable":null,"dataType":null,"alternateValues":null,"actions":{}},"h_cpq_ecomm__ActivationDate__c":{"value":"2020-05-07","previousValue":null,"originalValue":null,"messages":[],"label":null,"hidden":null,"fieldName":null,"editable":null,"dataType":null,"alternateValues":null,"actions":{}},"h_cpq_ecomm__UtilityProvider__c":{"value":"Other","previousValue":null,"originalValue":null,"messages":[],"label":null,"hidden":null,"fieldName":null,"editable":null,"dataType":null,"alternateValues":null,"actions":{}},"h_cpq_ecomm__VoltageLevel__c":{"value":"Low","previousValue":null,"originalValue":null,"messages":[],"label":null,"hidden":null,"fieldName":null,"editable":null,"dataType":null,"alternateValues":null,"actions":{}},"h_cpq_ecomm__AverageMonthlyUsage__c":{"value":9122,"previousValue":null,"originalValue":null,"messages":[],"label":null,"hidden":null,"fieldName":null,"editable":null,"dataType":null,"alternateValues":null,"actions":{}},"h_cpq_ecomm__OperationArea__c":{"value":null,"previousValue":null,"originalValue":null,"messages":[],"label":null,"hidden":null,"fieldName":null,"editable":null,"dataType":null,"alternateValues":null,"actions":{}},"Id":{"value":"a3h0b00000CwSUDAA3","previousValue":null,"originalValue":null,"messages":[],"label":null,"hidden":null,"fieldName":null,"editable":null,"dataType":null,"alternateValues":null,"actions":{}}}],"data":{"totalCount":1}} ``` # groupRollup Method Calculates the pricing rollups (OneTime, Recurring, Usage) for a group. ## Class ## Input Parameters | Parameter | Required | Description | | ------------ | ------------------------------------------------- | ------------------------------------------------- | | parentId | Required | Opportunity ID. | | contextId | Required | Parent cart Id (Master/Enterprise Quote/Order Id) | | groupId | Required | Group ID. | | groupCartId | Optional: Required only if groupId is not passed. | Group Cart Id. | | groupFields | Optional | Group Field list. | | masterFields | Optional | Master Field list. | | quoteFields | Optional | Quote Field list. | ## Output Parameters | Parameter | Description | | --------- | --------------------- | | message | In case of any error. | ## Example Input Data ``` {"groupId": "a3O3t000003ADvzEAG", "contextId": "0Q03t000001ugKu", "parentId": "0063t00000tPwO7"} ``` ## Example Output Data ``` {"message": "Not able to find out Group"}"error":"OK"} ``` # Guest User Security Restrictions Beginning with the Winter '21 Salesforce release, [Guest Users](https://help.salesforce.com/articleView?id=networks_public_access.htm&type=5), also called anonymous users, cannot access any records by default. This affects all Salesforce orgs. For more about the guest user implementation for Industries CPQ, see [Guest User Enhancements Overview](https://help.salesforce.com/s/articleView?id=ind.v_admin_guest_user_enhancements_overview_27751.htm). Beginning with CME Spring '20 Minor Release, Salesforce does not allow guest users to create and update records by default with the exception of Cart-Based and Digital Commerce APIs listed in this topic. **See Also** - [Guest User Access](https://www.learncommunitycloud.com/s/article/Guest-User-Record-Access-Development-Best-Practices#SecureGuestUserRecordAccessSetting) - [Guest User Security Policies and Timelines](https://help.salesforce.com/articleView?id=networks_guest_policies_timelines.htm) - [Give Secure Access to Unauthenticated Users with the Guest User Profile](https://help.salesforce.com/articleView?id=networks_public_access.htm) # Guest User Security Restrictions Beginning with the Winter '21 Salesforce release, [Guest Users](https://help.salesforce.com/articleView?id=networks_public_access.htm&type=5), also called anonymous users, cannot access any records by default. This affects all Salesforce orgs. For more about the guest user implementation for Industries CPQ, see [Guest User Enhancements Overview](https://help.salesforce.com/s/articleView?id=ind.v_admin_guest_user_enhancements_overview_27751.htm). Beginning with CME Spring '20 Minor Release, Salesforce does not allow guest users to create and update records by default with the exception of Cart-Based and Digital Commerce APIs listed in this topic. **See Also** - [Guest User Access](https://www.learncommunitycloud.com/s/article/Guest-User-Record-Access-Development-Best-Practices#SecureGuestUserRecordAccessSetting) - [Guest User Security Policies and Timelines](https://help.salesforce.com/articleView?id=networks_guest_policies_timelines.htm) - [Give Secure Access to Unauthenticated Users with the Guest User Profile](https://help.salesforce.com/articleView?id=networks_public_access.htm) # Hierarchy API The Hierarchy API takes a product's ID as input and populates its flat hierarchy in the cache. The hierarchy populated is the runtime hierarchy and not the admin time hierarchy. You must execute this API for each product offerId that you received in the response from the Catalog Profile API. You can obtain the offerId required in the URI of this API from the apiResponse.data.catalogProductRelationDetails.Product node in the response body of the [Catalog Profile API](/docs/commerce/commerce/guide/comms-t-catalog-profile-api.html). This API is for product Ids only. Do not use promotion Ids with this API. Promotions are handled by the Promotion Wrapper API. ## Precondition You must first run the [Catalog Profile API](/docs/commerce/commerce/guide/comms-t-catalog-profile-api.html) to obtain the offerId required in the request body of this API. ## URI /services/apexrest/{namespace}/v3/admin/catalogs/{catalogCode}/offers/{offerId}/hierarchy ## HTTP Method POST ## URI Parameters If you specify just one of these two parameters, it follows the behavior described in the table below and accepts your defined time for the parameter you specified. If you are using one or both parameters, you must specify them with the same values for all of the Populate Cache APIs in this sequence. | Parameter | Example | Default | Optional/Required | Notes | | ------------------ | ------------------- | ------------------------------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | effectiveStartTime | 2001-07-04T12:08:56 | Current date and time | Optional | effectiveStartTime is the time that you want your cached catalog entries to be effective. It should be in the UTC date-time format. Your effectiveStartTime must occur after the current time for which you are executing the Populate Cache APIs or you will receive an error message. | | expirationTime | 2001-07-04T12:08:56 | effectiveStartTime + TimeToLive | Optional | expirationTime is the time that you want your cached catalog entries to expire. It should also be in the UTC date-time format. Your expirationTime must occur after your effectiveStartTime or you receive an error message. TimeToLive is a custom setting created in CPQ Configuration Setup. It has a default value of 30 days. | Here is an example of how to pass the URI parameters: ```nolang GET /services/apexrest/vlocity_cmt/v3/admin/catalogs/AS-Test-Catalog/hierarchy?effectiveStartTime=2021-07-04T12:08:56&expirationTime=2021-08-04T12:08:56 ``` ## Remote API This is an example of how you invoke the API using Apex: ```nolang String methodName; String requestBodyJSON; Map input = new Map(); Map output = new Map(); Map options = new Map(); // Setting remote parameters methodName = 'getHierarchy'; input.put('apiName', 'CMHierarchy'); // required input.put('methodName', methodName); // required input.put('catalogCode', 'TestCatalog'); // required input.put('offerId', '01t4x000000x269AAA'); // required input.put('effectiveStartTime', null); // optional input.put('expirationTime', null); // optional input.put('requestURL', '/v3/admin/catalogs/{catalogCode}/offers/{offerId}/hierarchy'); //required //remote action invocation vlocity_cmt.CpqAppHandler appHandler = new vlocity_cmt.CpqAppHandler(); appHandler.invokeMethod(methodName, input, output, options); ``` ## Parallel Invocation This API can run in parallel for multiple offers. For example, if there are 10 catalogs (Catalog1, Catalog2..Catalog 10) and each catalog has 100 offers, you can run this API for all 1,000 offers in parallel threads. ```nolang THREAD1 - POST /services/apexrest/{namespace}/v3/admin/catalogs/catalog1/offers/offer1/hierarchy THREAD2 - POST /services/apexrest/{namespace}/v3/admin/catalogs/catalog1/offers/offer2/hierarchy ...... THREAD100 - POST /services/apexrest/{namespace}/v3/admin/catalogs/catalog1/offers/offer100/hierarchy THREAD101 - POST /services/apexrest/{namespace}/v3/admin/catalogs/catalog2/offers/offer101/hierarchy ...... THREAD1000 - POST /services/apexrest/{namespace}/v3/admin/catalogs/catalog10/offers/offer1000/hierarchy ``` ## HTTP Headers | Header | Description | | ------------ | ---------------- | | Content-Type | application/json | ## Response Body This example shows product offer IDs. ``` [ "01t5g000002vVPdAAM", "01t5g000002vVQmAAM", "01t5g000002vVF2AAM" ] ``` ## HTTP Response Codes | Code | Description | | ---- | --------------------- | | 200 | OK | | 500 | Internal Server Error | # Historical Products (POST) Get the products a customer previously ordered, with quantities aggregated by unit of measure. ## Resource ``` /connect/macz/historical-product ``` ## Resource example ``` https://yourInstance.salesforce.com/services/data/v68.0/connect/macz/historical-product ``` ## Available version 68.0 ## HTTP methods POST ## Request body for POST See [Advanced Order Product Recommendation Input](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/requests/advanced-order-product-recommendation-input.md). ```json { "customerAccountId": "001RM000004Wk8xYAC", "orderSpecId": "0OSRM00000004Cx2AAE", "operationType": "avg", "orderStatuses": ["Activated"], "orderItemSpecIds": ["0OSRM00000004Cx2AAE"], "includeProductDetails": true } ``` | Name | Type | Description | Required or Optional | Available Version | | ----------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------- | ----------------- | | `customerAccountId` | String | The ID of the customer account. | Required | 68.0 | | `includeProductDetails` | Boolean | If true, retrieves full product details from Configure, Price, Quote (CPQ) Product Discovery and includes them in the productDetails field. The default value is false. | Optional | 68.0 | | `operationType` | String | The aggregation operation used to calculate product quantities across multiple orders. Determines how quantity is calculated when a product appears in multiple orders. Valid values are sum, avg, min, and max. The default value is avg. | Optional | 68.0 | | `orderItemSpecIds` | String[] | An optional list of order item specification IDs to filter order items by. Only items that match these specifications are included in recommendations. | Optional | 68.0 | | `orderSpecId` | String | The ID of the order specification that defines the lookback period and order template. | Required | 68.0 | | `orderStatuses` | String[] | An optional list of order statuses to filter by, such as Draft or Activated. If no status is specified, all statuses are included. | Optional | 68.0 | ## Response body for POST See [Advanced Order Product Recommendation Output](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/responses/advanced-order-product-recommendation-output.md). # Installation and Deployment To use the Digital Commerce SDK, you must first import the node_module for it. Follow the steps here: 1. Add the digitalcommerce-sdk dependency in your package.json, as shown here: ```nolang "dependencies": { // Existing dependencies "@vlocity-cme-sdk/digitalcommerce-sdk" : "^109.0.1" } ``` 2. Create an NPM configuration file called `.npmrc`. The `.npmrc` file is needed to authenticate with the private npm registry. Here is a sample: ```nolang email=you@example.com always-auth=true _auth= (see Note, below) registry=https://repo.vlocity.com/repository/npm-public/ ``` **note:** To obtain the password for the .npmrc file: - Contact Salesforce Customer Support. Note that you must have purchased a CPQ License. For public access, use the default authorization token mentioned in the above example. ```nolang // To fetch the module you would need to run npm install ``` The artifact can be found in the node_modules folder under the module name @vlocity-cme-sdk/digitalcommerce-sdk 3. You can access digitalcommerce.sdk.js either from node_modules (inside the above-mentioned folder) or by moving it inside public/static resource of the application that is using it. Following is an example of what it should look like: ```nolang ``` Once the digitalcommerce.sdk.js is added into the application, the following steps can be followed for using it. 4. Instantiate DigitalCommerceSDK: ```nolang // Instantiate DigitalCommerceConfig for anonymous user const digitalCommerceConfig = VlocitySDK.digitalcommerce.createConfigForAnonymousUser(); // Instantiate the SDK itself const digitalCommerce = VlocitySDK.digitalcommerce.getInstance(digitalCommerceConfig); OR // Instantiate DigitalCommerceConfig for login user const digitalCommerceConfig = VlocitySDK.digitalcommerce.createConfigForLoginUser(salesforceUrl, sessionToken); // Instantiate the SDK itself const digitalCommerce = VlocitySDK.digitalcommerce.getInstance(digitalCommerceConfig); // To override the default namespace with your custom namespace this.digitalCommerce.namespace = "vlocity_cmt"; // use your custom namespace Note: digitalCommerce is a Singleton object. Calling getInstance(digitalCommerceConfig) repeatedly will return the same instance instantiated the first time when getInstance(digitalCommerceConfig) was called. To instantiate a new instance of digitalCommerce, set create to true in the digitalCommerceConfig object: digitalCommerceConfig.create = true; digitalCommerce = VlocitySDK.digitalcommerce.getInstance(digitalCommerceConfig); // To override the anonymous site url with your custom url digitalCommerce.apiURL = "https://myaws.execute-api.us-west-2.amazonaws.com/prod/dc"; // use your AWS gateway ``` # InternalOrgUnitUser Represents the assignment of a User to an InternalOrganizationUnit, along with that user's mobile/field-service preferences (calendar view, distance units, visit filters) for working within that organization unit — used to model which internal or external business unit a user operates in and how the mobile experience is configured for them. This object is available in API version 68.0 and later. ## Supported Calls `create()`, `delete()`, `describeLayout()`, `describeSObjects()`, `getDeleted()`, `getUpdated()`, `query()`, `retrieve()`, `undelete()`, `update()`, `upsert()` ## Special Access Rules Available only in orgs with Manufacturing Cloud, Automotive Cloud, or Consumer Goods Cloud enabled, or with the relevant Account Hierarchy / B2B relationship features licensed. ## Fields ### CalendarStartTime **Type:** time **Properties:** Create, Filter, Nillable, Sort, Update **Description:** The time of day this user's calendar view begins by default. ### CurrencyIsoCode **Type:** picklist **Properties:** Create, Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The ISO currency code associated with this record. Possible values are: AED (UAE Dirham), USD (U.S. Dollar), and every other active currency ISO code configured for the org. The default value is USD. ### DefaultAccountId **Type:** reference **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The account this user defaults to when working within this organization unit. **Relationship Name:** DefaultAccount **Refers To:** Account ### DefaultBluetoothDvcTyp **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The default Bluetooth-connected device type this user uses for data capture in the field. Possible values are Keyboard and Scanner. ### DefaultCalendarView **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The default calendar view this user sees. Possible values are DayWithMap—Day With Map and Week. ### DistanceUnit **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The unit of distance this user's mobile experience is displayed in. Possible values are Kilometers and Miles. ### ImageCaptureSize **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The default resolution used when this user captures images in the field. Possible values are ExtraLarge—Extra Large, Large, Medium, and Small. ### InternalOrganizationUnitId **Type:** reference **Properties:** Create, Filter, Group, Sort, Update **Description:** The internal organization unit this user is assigned to. **Relationship Name:** InternalOrganizationUnit **Refers To:** InternalOrganizationUnit ### IsDefaultInternalOrgUnit **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether this is the user's default internal organization unit when the user belongs to more than one. The default value is false. ### IsDfltMobIntrOrgUnit **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether this is the user's default organization unit specifically for the mobile app experience. The default value is false. ### LandingPage **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The page this user lands on after logging in to the mobile app for this organization unit. Possible values are MainMenu—Main Menu, StoreCockpit—Store Cockpit, and UserCockpit—User Cockpit. ### LastReferencedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** The timestamp when the current user last accessed this record or a related record. ### LastViewedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** The timestamp when the current user last viewed this record. ### Name **Type:** string **Properties:** Autonumber, Defaulted on create, Filter, idLookup, Sort **Description:** The autonumber name that uniquely identifies this record. ### OperatingHoursId **Type:** reference **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The operating hours that apply to this user within this organization unit. **Relationship Name:** OperatingHours **Refers To:** OperatingHours ### OwnerId **Type:** reference **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** The user or queue that owns this record. **Relationship Name:** Owner **Refers To:** Group, User ### ShouldShowFriday, ShouldShowMonday, ShouldShowSaturday, ShouldShowSunday, ShouldShowThursday, ShouldShowTuesday, ShouldShowWednesday **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether the given day of the week is shown in this user's calendar/agenda view. The default value is false for each. ### ShouldShowRoutesOnMap **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether planned routes are displayed on this user's map view. The default value is false. ### ShouldShowTrafficInMap **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether live traffic data is displayed on this user's map view. The default value is false. ### ShouldShowVstTmInAgenda **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether visit times are displayed in this user's agenda view. The default value is false. ### ShouldShowWkNbrInCal **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether week numbers are displayed in this user's calendar view. The default value is false. ### UserId **Type:** reference **Properties:** Create, Filter, Group, Sort **Description:** The user this organization-unit assignment applies to. **Relationship Name:** User **Refers To:** User ### UserRole **Type:** multipicklist **Properties:** Create, Filter, Nillable, Update **Description:** The role(s) this user holds within this organization unit. ### VstStsFltrOpt **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The default visit-status filter applied to this user's visit list. Possible values are All and Open. ## Associated Objects This object has the following associated objects. If the API version isn't specified, they're available in the same API versions as this object. Otherwise, they're available in the specified API version and later. - [InternalOrgUnitUserChangeEvent](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/change-event.md): Change events are available for the object. - [InternalOrgUnitUserFeed](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/feed.md): Feed tracking is available for the object. - [InternalOrgUnitUserHistory](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/history.md): History is available for tracked fields of the object. - [InternalOrgUnitUserOwnerSharingRule](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/owner-sharing-rule.md): Sharing rules are available for the object. - [InternalOrgUnitUserShare](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/share.md): Sharing is available for the object. # InternalOrgUnitUser Represents the assignment of a User to an InternalOrganizationUnit, along with that user's mobile/field-service preferences (calendar view, distance units, visit filters) for working within that organization unit, used to model which internal or external business unit a user operates in and how the mobile experience is configured for them. This object is available in API version 68.0 and later. ## Supported Calls `create()`, `delete()`, `describeLayout()`, `describeSObjects()`, `getDeleted()`, `getUpdated()`, `query()`, `retrieve()`, `undelete()`, `update()`, `upsert()` ## Special Access Rules Available only in orgs with Manufacturing Cloud, Automotive Cloud, or Consumer Goods Cloud enabled, or with the relevant Account Hierarchy / B2B relationship features licensed. ## Fields ### CalendarStartTime **Type:** time **Properties:** Create, Filter, Nillable, Sort, Update **Description:** The time of day this user's calendar view begins by default. ### CurrencyIsoCode **Type:** picklist **Properties:** Create, Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The ISO currency code associated with this record. Possible values are: AED (UAE Dirham), USD (U.S. Dollar), and every other active currency ISO code configured for the org. The default value is USD. ### DefaultAccountId **Type:** reference **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The account this user defaults to when working within this organization unit. **Relationship Name:** DefaultAccount **Refers To:** Account ### DefaultBluetoothDvcTyp **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The default Bluetooth-connected device type this user uses for data capture in the field. Possible values are Keyboard and Scanner. ### DefaultCalendarView **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The default calendar view this user sees. Possible values are DayWithMap (Day With Map) and Week. ### DistanceUnit **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The unit of distance this user's mobile experience is displayed in. Possible values are Kilometers and Miles. ### ImageCaptureSize **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The default resolution used when this user captures images in the field. Possible values are ExtraLarge—Extra Large, Large, Medium, and Small. ### InternalOrganizationUnitId **Type:** reference **Properties:** Create, Filter, Group, Sort, Update **Description:** The internal organization unit this user is assigned to. **Relationship Name:** InternalOrganizationUnit **Refers To:** InternalOrganizationUnit ### IsDefaultInternalOrgUnit **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether this is the user's default internal organization unit when the user belongs to more than one. The default value is false. ### IsDfltMobIntrOrgUnit **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether this is the user's default organization unit specifically for the mobile app experience. The default value is false. ### LandingPage **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The page this user lands on after logging in to the mobile app for this organization unit. Possible values are MainMenu (Main Menu), StoreCockpit (Store Cockpit), and UserCockpit (User Cockpit). ### LastReferencedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** The timestamp when the current user last accessed this record or a related record. ### LastViewedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** The timestamp when the current user last viewed this record. ### Name **Type:** string **Properties:** Autonumber, Defaulted on create, Filter, idLookup, Sort **Description:** The autonumber name that uniquely identifies this record. ### OperatingHoursId **Type:** reference **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The operating hours that apply to this user within this organization unit. **Relationship Name:** OperatingHours **Refers To:** OperatingHours ### OwnerId **Type:** reference **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** The user or queue that owns this record. **Relationship Name:** Owner **Refers To:** Group, User ### ShouldShowFriday, ShouldShowMonday, ShouldShowSaturday, ShouldShowSunday, ShouldShowThursday, ShouldShowTuesday, ShouldShowWednesday **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether the given day of the week is shown in this user's calendar/agenda view. The default value is false for each. ### ShouldShowRoutesOnMap **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether planned routes are displayed on this user's map view. The default value is false. ### ShouldShowTrafficInMap **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether live traffic data is displayed on this user's map view. The default value is false. ### ShouldShowVstTmInAgenda **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether visit times are displayed in this user's agenda view. The default value is false. ### ShouldShowWkNbrInCal **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether week numbers are displayed in this user's calendar view. The default value is false. ### UserId **Type:** reference **Properties:** Create, Filter, Group, Sort **Description:** The user this organization-unit assignment applies to. **Relationship Name:** User **Refers To:** User ### UserRole **Type:** multipicklist **Properties:** Create, Filter, Nillable, Update **Description:** The role(s) this user holds within this organization unit. ### VstStsFltrOpt **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The default visit-status filter applied to this user's visit list. Possible values are All and Open. ## Associated Objects This object has the following associated objects. If the API version isn't specified, they're available in the same API versions as this object. Otherwise, they're available in the specified API version and later. - [InternalOrgUnitUserChangeEvent](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/associated-objects/change-event.md): Change events are available for the object. - [InternalOrgUnitUserFeed](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/associated-objects/feed.md): Feed tracking is available for the object. - [InternalOrgUnitUserHistory](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/associated-objects/history.md): History is available for tracked fields of the object. - [InternalOrgUnitUserOwnerSharingRule](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/associated-objects/owner-sharing-rule.md): Sharing rules are available for the object. - [InternalOrgUnitUserShare](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/associated-objects/share.md): Sharing is available for the object. # Introduction To use the Configure, Price, Quote (CPQ) functionality through APIs, you may choose to implement either the Cart APIs or Standard Cart APIs. ## Cart APIs Industries CPQ's Cart-based APIs enable client application users to shop for and order products and services. The Cart-Based APIs and their remote methods provide a layer of abstraction between client application development and the configuration of the underlying CPQ logic. Users can access and manipulate the quote, order, and cart data using the industries Configure, Price, Quote (CPQ) APIs. For Cart-based REST API reference information, see [Industries Configure, Price, Quote Web APIs v2 Documentation](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Standard Cart APIs Standard cart APIs are the next-generation version of the cart-based APIs introduced in Summer '23. These APIs use standard Salesforce libraries, Scale Cache for optimized processing, and revamped pricing and validation methods to reduce the number of SOQL queries and DML operations. These improvements have significantly enhanced API performance. See [Standard Cart APIs](https://developer.salesforce.com/docs/industries/cme/guide/std-cart-get-started.md). ## Factors for Considering Cart APIs and Standard Cart APIs You are required to consider various factors when choosing between Cart APIs and Standard Cart APIs. New customers can review the list of APIs supported on Cart APIs and Standard Cart APIs to determine the best fit for their use cases. - [Cart APIs Usage Examples](https://developer.salesforce.com/docs/industries/cme/guide/cart-api-examples.html) - [Standard Cart APIs Usage Examples](https://developer.salesforce.com/docs/industries/cme/guide/stdcart-api-examples.html) Existing customers can: - Review the list of APIs supported on Cart APIs and Standard Cart APIs to determine the best fit for their use cases. - [Cart APIs Usage Examples](https://developer.salesforce.com/docs/industries/cme/guide/cart-api-examples.html) - [Standard Cart APIs Usage Examples](https://developer.salesforce.com/docs/industries/cme/guide/stdcart-api-examples.html) - Check if the APIs you are looking to use are available on your current version. Else, you need to upgrade to the latest version. See [Standard Cart APIs](https://developer.salesforce.com/docs/industries/cme/guide/std-cart-get-started.html). - Review the documentation on how to enable Standard Cart APIs and start using it. See [Enable the Standard Cart APIs](https://developer.salesforce.com/docs/industries/cme/guide/enable-standard-cart-apis.html). - Review the documentation on the migration consideration required to adopt Standard Cart APIs. See [Migration Considerations](https://developer.salesforce.com/docs/industries/cme/guide/comms-migration-consideration-cart.html). - Review the migration scenarios section to better understand the benefits of using Standard Cart APIs for your use case. ## Cart APIs vs Standard Cart APIs Standard Cart APIs use the same REST resource family and remote method names as Cart APIs (Classic). Enabling Standard Cart APIs changes the execution path for the APIs listed in [Standard Cart APIs](https://developer.salesforce.com/docs/industries/cme/guide/std-cart-get-started.md). Those APIs run on Salesforce core with Scale Cache. Cart APIs that are not on that list continue to run on managed-package Apex. | Area | Cart APIs (Classic) | Standard Cart APIs | | ---- | ------------------- | ------------------ | | Engine | Managed-package Apex libraries, Platform Cache | Salesforce core libraries, Scale Cache, and `CachedAPIResponse__c` compiled data | | Governor limits | CPU time, SOQL (100 synchronous / 200 asynchronous), and heap size (6 MB synchronous / 12 MB asynchronous) apply to cart processing | Heavy pricing, validation, and cart logic runs on core, which reduces Apex CPU, SOQL, and heap pressure for supported APIs | | Bundle and line-item capacity | Smaller out-of-the-box bundle sizes | Larger bundle sizes and higher line-item counts for supported transactions. See [Application Constraints](https://developer.salesforce.com/docs/industries/cme/guide/comms-application-constraints.md) | | Customization model | Line-item sObjects and `PricingPlanService` context | `CpqCartDocument` in the input map, Cpq interfaces, and field mappers for custom fields. See [Use CpqCartDocument](https://developer.salesforce.com/docs/industries/cme/guide/use-cart-document-cpq.md) | | JSONAttribute v2 | Optional | Required. See [Enable the JSONAttribute V2 Schema](https://developer.salesforce.com/docs/industries/cme/guide/enable-json-attributev2-schema.md) | | Response `actions` node | Populates both `remote` and `rest` nodes | Populates only the protocol you invoked | | Custom fields in the response | Field Settings / CPQV2 field settings | Pass the `fields` parameter. Field Settings apply only to getCarts and GetCartsItems | | Currency and pricing values | Integer values are often accepted | Double is required (for example, `0` must be `0.0`) | Not every Classic Cart API is a Standard Cart API. Review [Standard Cart APIs](https://developer.salesforce.com/docs/industries/cme/guide/std-cart-get-started.md) for the supported list, and [Known Limitations](https://developer.salesforce.com/docs/industries/cme/guide/standard-cart-known-limitations.md) before you enable the feature. ## Benefits of Standard Cart APIs Here's the table that highlights benefits of transitioning from Cart APIs to Standard APIs. | Scenario | Standard Cart APIs vs Cart APIs | | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Your typical cart operations involve creating Quotes or Orders with large line items | Standard Cart APIs can support larger Bundle Sizes ( Number of OLI) compared to Cart APIs. Review the [Application Constraints](https://developer.salesforce.com/docs/industries/cme/guides/comms-application-constraints.md) for more details. | | Time taken to perform cart operations | Standard Cart APIs are faster for cart based operations such as config, price, add, update as compared to Cart APIs.
Standard cart-based APIs use standard Salesforce libraries to process the cart operation logic, which reduces the time taken for each call.
Performance / response time is based on complexity of the Product Catalog, results may vary based on factors such as customizations, rules, and so on. | | Complex rules and pricing hit Apex CPU, SOQL, or heap limits | Standard Cart APIs move pricing and validation onto core and Scale Cache, which reduces JSON serialize/deserialize cost and database round trips on supported APIs. Custom hooks, rules, and catalog complexity still affect response time. | | You need Multi-Edit, Cart Document, or Relies On attribute propagation | Multi-Edit Cart Line Items, `CpqCartDocument`, and out-of-the-box Relies On attribute propagation are available when Standard Cart APIs are enabled. Relies On attribute propagation does not run if Standard Cart APIs are disabled. | ## Base URI Structure and Namespaces All Cart-Based API requests use the following base URI: `https://{instance}.salesforce.com/services/apexrest/{namespace}` Where: - instance identifies the Salesforce instance that hosts your Salesforce organization (org) - namespace identifies the app package, such as vlocity_cmt ## API Authentication and Security Apex REST supports two authentication mechanisms: OAuth 2.0 or Session ID. Usually, you use Session ID authentication only for testing purposes during development. OAuth 2.0 is recommended. For more information, see the following topics in the **Force.com REST API Developer Guide**: - [Step Two: Set Up Authorization](https://developer.salesforce.com/docs/atlas.en-us.198.0.api_rest.meta/api_rest/quickstart_oauth.htm) - [Understanding Authentication](https://developer.salesforce.com/docs/atlas.en-us.198.0.api_rest.meta/api_rest/intro_understanding_authentication.htm) ## API Limits To maintain optimum performance and ensure that the Force.com API is available to all customers, Salesforce imposes two types of API limits: concurrent API request limits and total API request limits. When a call exceeds a request limit, an error is returned. The actual limit depends on the type of Salesforce edition org you are using, the number of user licenses you have purchased, and the number of additional API calls you may have purchased. Total API request limits govern the total API requests (or calls) per 24-hour period for an org. Vlocity Omnichannel Web APIs are designed to provide more functionality and data with each request to minimize the number of calls required per user per hour. However, the client application determines the number of API calls. For more information about API limits, see [API Limits](https://developer.salesforce.com/docs/atlas.en-us.206.0.salesforce_app_limits_cheatsheet.meta/salesforce_app_limits_cheatsheet/salesforce_app_limits_platform_api_overview.htm) in the **Salesforce Developer Limits Quick Reference**. Other limits apply. Vlocity Omnichannel Web APIs are based on Apex REST. Calls to these APIs count against the deploying company’s API governor limits. All standard Apex governor limits apply to Apex REST classes. For example, the maximum request or response size is 6 MB for synchronous Apex or 12 MB for asynchronous Apex. For more information, see [Execution Governors and Limits](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_gov_limits.htm) in the **Force.com Apex Code Developer Guide**. ## API Response Status Codes Apex REST APIs return the standard HTTP response status codes. For more information, see [Apex Rest Methods](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_rest_methods.htm#RequestDataConsiderationsTitle), “Response Status Codes,” in the **Force.com Apex Code Developer Guide**. # Introduction Standard cart REST APIs are the next-generation version of the cart-based APIs available in Summer'23. The standard cart APIs and their remote methods provide a layer of abstraction between client application development and the configuration of the underlying CPQ cart-based operation logic. Users can access and manipulate the quote, order, and cart data in the industries Configure, Price, Quote (CPQ). Following are some of the features of standard cart APIs. - RESTful Web APIs designed to enable client application users to shop for and order products and services at a much faster rate. - Deliver the industries-specific CPQ engine on Salesforce core to improve the performance of cart-based operations. - Optimized for highly interactive cart operations done by contact centre agents and sales representatives with faster processing of the API calls. - Improve the performance and scalability of the existing cart-based APIs. ## Architecture Classic Cart APIs run the CPQ engine in managed-package Apex. That path shares governor limits (CPU time, SOQL, and heap size) with other Apex work in the transaction. When you enable Standard Cart APIs, supported cart operations are routed to Salesforce core (Java) handlers for pricing, cart, and validation. Compiled catalog data is stored in Scale Cache and `CachedAPIResponse__c`. Cart APIs that are not yet on the Standard list continue to run on the Classic Apex path. Custom implementations that run for both paths must switch dynamically: use `CpqCartDocument` for Standard Cart APIs, and line-item sObjects for Classic Cart APIs. See [Use CpqCartDocument](https://developer.salesforce.com/docs/industries/cme/guide/use-cart-document-cpq.md) and [Cart APIs vs Standard Cart APIs](https://developer.salesforce.com/docs/industries/cme/guide/comms-cart-based-apis-for-industries-cpq.md#cart-apis-vs-standard-cart-apis). ## Cart APIs Data Layer Workflow The following flow diagram provides high-level overview of CPQ data layer workflow. ![CPQ Data Workflow](https://developer.salesforce.com/docs/media/LWC_CPQ_Flowchart_3.png "CPQ Data Workflow") Before you begin, [Check Feature Compatibility](https://developer.salesforce.com/docs/industries/cme/guide/review-the-considerations.md) for using the standard cart APIs. Review [Known Limitations](https://developer.salesforce.com/docs/industries/cme/guide/standard-cart-known-limitations.md) for behaviors that still differ from Classic Cart APIs. # Invalidate Affected Response API The Invalidate Affected Response API invalidates the cache entries that have become inaccurate due to catalog offer changes. You must pass the cachedAPIResponseIds provided in the invalidateAction node received in the response from the [Affected Cache API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-affected-cache-api.md). You can obtain the List\ or cachedAPIChangeIds required in the request body of this API from the cachedAPIChangeIds node (`records.invalidateAction.invalidateCachedResponse.rest.requestBody.cachedAPIResponseIds`) in the response body of the Get Affected Cache API. ## URI /services/apexrest/vlocity_cmt/v3/admin/catalogs/regenerate/invalidate ## HTTP Method POST ## URL Parameters For example: `POST /services/apexrest/vlocity_cmt/v3/admin/catalogs/regenerate/invalidate?expirationTime=2021-08-24T12:08:56` | Parameter | Example | Default | Optional/Required | Description | | -------------- | ------------------- | ------- | ----------------- | ------------------------------------------------------------- | | expirationTime | 2021-08-24T12:08:56 | Null | Optional | For the future dated cache. The format is YYYY-MM-DDThh:mm:ss | ## Request Body Parameters | Parameter | Data Type | Description | Optional/Required | | -------------------- | --------- | -------------------------------------------------------------------- | ----------------- | | cachedAPIResponseIds | String | cachedAPIResponse Ids that are invalid due to catalog offer changes. | Required | ## Sample Input cachedAPIChangeIds contain the IDs of the cached API response objects, which could consist of a list of changes. This is sample input for the ID of the cachedAPIResponse object. ```nolang { "cachedAPIResponseIds": [ "a0a5g000000Dn6pAAC", "a0a5g000000Doj4AAC", "a0a5g000000DoJVAA0", "a0a5g000000DpBjAAK", "a0a5g000000DpG7AAK" ] } ``` ## Sample Input for invalidateAction Node ```nolang { "invalidateAction": { "invalidateCachedResponse": { "rest": { "requestBody": { "cachedAPIResponseIds": [ "a0a5g0000005JbKAAU", "a0a5g0000005JaGAAU", "a0a5g0000005JbTAAU", "a0a5g0000005JbUAAU", "a0a5g0000005JbVAAU", "a0a5g0000005JbWAAU" ] }, "params": { }, "link": "/v3/admin/catalogs/regenerate/invalidate", "method": "POST" } } } } ``` ## HTTP Headers | Header | Description | | ------------ | ---------------- | | Content-Type | application/json | ## Remote API This is an example of how you invoke the API using Apex: ```nolang String methodName; Map input = new Map(); Map output = new Map(); Map options = new Map(); // Setting remote parameters methodName = 'invalidateCachedAPIResponse'; input.put('methodName',methodName);//required input.put('apiName','regenerate'); //requires List cachedAPIResponseIds = new List(); cachedAPIResponseIds.add('a4Q5g000000TmnaEAC'); input.put('cachedAPIResponseIds',cachedAPIChangeMap); //required //remote action invocation jk_232_cam.CpqAppHandler appHandler = new jk_232_cam.CpqAppHandler(); appHandler.invokeMethod(methodName, input, output, options); ``` ## Parallel Invocation You can run this API in parallel for different cachedAPIResponseIds. For example, if there are 100 invalidate Action nodes from the GetAffected cache API (INVALID_ACTION1, INVALID_ACTION 2.....INVALID_ACTION100) and each action node contains a list of cachedAPIResponseIds, such as INVALID_ACTION1.CAR1, then you can run parallel threads of Invalidate APIs with each individual invalidate Action node. ```nolang THREAD1 - POST /services/apexrest/vlocity_cmt/v3/admin/catalogs/regenerate/invalidate Body : {"cachedAPIResponseIds":INVALID_ACTION1.CAR1} THREAD2 - POST /services/apexrest/vlocity_cmt/v3/admin/catalogs/regenerate/invalidate Body : {"cachedAPIResponseIds":INVALID_ACTION2.CAR2} THREAD3 - POST /services/apexrest/vlocity_cmt/v3/admin/catalogs/regenerate/invalidate Body : {"cachedAPIResponseIds":INVALID_ACTION3.CAR3} . . . . THREAD100 - POST /services/apexrest/vlocity_cmt/v3/admin/catalogs/regenerate/invalidate Body : {"cachedAPIResponseIds":INVALID_ACTION4.CAR100} ``` ## Response Body The return status indicates success or failure with a reason for the error. For example: ``` { "message": "Successfully completed.", "errorCode": "INVOKE-200", "error": "OK" } ``` ## HTTP Response Codes | Code | Description | | ---- | --------------------- | | 200 | OK | | 500 | Internal Server Error | # Invalidate/Set Current Cache Validity With the futureDatedCache custom setting enabled, the batch job sets the validity of the currently active version of the cache to be until the effective time the user has selected while running the Regenerate batch job. This flexibility allows the user to avoid downtime and project the current database changes to the future date. When the custom setting is disabled, the batch job expires the cache by setting the effectivity of the cache entry to be less than the current time. When versioning and the futureDatedCache custom setting are enabled, the changes that impact the current cache version are cached with the time effectivity, starting with the selected date time. At run time, when the Regenerate batch job runs, there is no downtime and the current cache instance is valid until the selected date time. The future time slice start and end dates are not impacted. If the selected start date exceeds the date-time of the future time slice, then the end of the current time slice is considered as current cache effectivity. When versioning and custom settings are disabled, the changes made in EPC that affect the currently active version of the cached entries are invalidated by setting the cache expiration time to be less than the current time. Even for the cache entries with future effectivity dates, the invalidation batch job invalidates the entries and sets the expiration time as less than the current time. # Invoke Cache Migration when OAuth2 is Deployed Make sure you have completed the [DCG OAuth2 Setup and Usage](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-dcg-oauth2-setup-and-usage.md) and received the credentials from Technical Support. When OAuth2 credentials are mentioned in this topic, use the `cmig` set of credentials. If you are using ​Salesforce Industries Communications, Media, and Energy Fall '20 or later, then set the following parameter values: | Parameter | Value | | --------------------------------- | --------------------------------------------------------------------------------- | | CacheAPI.ExternalSystemAuthHeader | JSON with { "oauth2_server":"" , "customer_app_key":"" ,"customer_app_secret":""} | | oauth2_server | OAuth2 URL | | customer_app_key | OAuth2 application key | | customer_app_secret | OAuth2 application secret | For example: `{ "oauth2_server": "vlocity-exaple.amazoncognito.com", "customer_app_key": "testKey", "customer_app_secret": "testSecret" }` Then, add the URL to the remote site URL. For versions Salesforce Industries Communications, Media, and Energy Summer '20 and prior, you can migrate CachedAPIResponse\_\_c records from the Salesforce platform to DCG when OAuth2 is deployed by using the: - Command Line Interface: Obtain the OAuth2 JWT token and call GET /cm/migrate endpoint. - GUI (this solution is valid for one hour, after which the CacheAPI.ExternalSystemAuthHeader needs to be updated again). - Obtain the OA uth2 JWT token. - Replace the CacheAPI.ExternalSystemAuthHeader field with the Bearer token value (oauth2_jwt_token_value). - Make the API GET call. # invokeBatchSerially Method Performs multiple batch operations (one after another) on a set of records. It executes a number of Integration Procedures-based batch jobs in succession. It also supports the pre and post-processing steps on every batch. For example, you could use it for various group-level (Quote/Order Group) actions to perform different sequential batch jobs on a set of quotes and orders. 1. Validate and Price: - Validation - Pricing (gets fired once the validation batch-job is finished) 2. Create and Submit Order: - Create Order (Quote checkout with price:false) - Price Sub-Orders - Submit Order (checkout the orders created in the initial batch) For other uses, see [invokeBatchSerially Method](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-invokebatchserially-method.md). ## Class ## Input Parameters `batchInput` expects the list of objects as input. Every individual object represents a single batch job to execute. | Parameter | Required | Description | | --------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | batchOperationTypeindicates | Required | The name of the batch process. | | batchSize | Required | Batch-size configuration for the batch job to run. | | className | Required | The corresponding Apex class to invoke for the batch job. This class should extend MSInvokeVIPInBatch and can override start, execute, and finish methods if required. | | classParams | Required | The Integration Procedures to execute at different stages of the batch job.
    |
  • `vipName` listed in `startVIP` is executed at the start of the batch.
  • `executeVIP` is called as part of the execution process.
  • `finishVIP` runs during the finish process of the batch.
  • Additional VIP-level inputs can be provided in `vipParams`.
Also, `classParams` can contain an additional set of class-level inputs.| ## Output Parameters | Parameter | Description | | ------------ | ---------------------------------------------- | | isJobStarted | True — The batch job has started successfully. | ## Example Input Data ``` "batchInput": [ { "batchOperationType": "Validate", "batchSize": 1, "className": "vlocity_cmt.MSInvokeCartValidationBatch", "classParams": { "startVIP": { "vipName": "", "vipParams": {} }, "executeVIP": { "vipName": "MultiService_RunCartValidation", "vipParams": {} }, "finishVIP": { "vipName": "MultiService_FinishCartValidation", "vipParams": {} } } }, { "batchOperationType": "Price", "batchSize": 1, "className": "vlocity_cmt.MSInvokeCartPricingBatch", "classParams": { "startVIP": { "vipName": "", "vipParams": {} }, "executeVIP": { "vipName": "MultiService_RunCartPricing", "vipParams": {} }, "finishVIP": { "vipName": "MultiService_FinishCartPricing", "vipParams": {} } } } ] ``` ## Example Output Data ``` { "isJobStarted": "false", "error": "OK", "errorLabel" : "Batch Job Failed to Start", "message": "Batch job cannot be started as salesforce limit exceeded. Please contact administrator." } ``` ## Process Different Records This remote action can also support the scenario where the next batch is expected to process a different set of records than the previous one. For example, in the Create and Submit Order batch, the finish stage of Create-Order and the whole Price and Submit-Order batches should process the new orders created by the previous batch. This is possible by splitting the finish of the Create-Order process into three steps: 1. Run `beforeCtxSwitchFinishVIP`. 2. Perform context switch. 3. Run `afterCtxSwitchFinishVIP`. The corresponding batch-object of the input is shown in the following example. ```nolang { "batchOperationType": "CreateOrder", "batchSize": 1, "className": "vlocity_cmt.MSInvokeCreateOrderBatch", "classParams": { "startVIP": { "vipName": "MultiService_StartCheckoutQuote", "vipParams": {} }, "executeVIP": { "vipName": "MultiService_CheckoutQuote", "vipParams": {} }, "beforeCtxSwitchFinishVIP": { "vipName": "", "vipParams": {} }, "afterCtxSwitchFinishVIP": { "vipName": "MultiService_FinishCheckoutQuote", "vipParams": {} } } } ``` # isAllGroupsValidatedAndPriced Method Checks if all groups are validated and priced successfully. This runs validate VIP. ## Class ## Input Parameters | Parameter | Required | Description | | --------- | -------- | ------------------------------------------------------- | | contextId | Required | Parent cart ID (Master or Enterprise quote or order ID) | ## Output Parameters | Parameter | Description | | ----------------------------- | --------------------- | | isAllGroupsValidatedAndPriced | Boolean value | | message | In case of any error. | ## Example Input Data ``` {"contextId":"0063t00000tPCmM"} ``` ## Example Output Data ``` {"isAllGroupsValidatedAndPriced": true} ``` # Known Limitations for Standard Cart APIs Standard Cart APIs retain the same API names, inputs, and response formats as Cart APIs (Classic) unless a topic calls out a difference. This topic lists behaviors that still differ from Classic, and Cart APIs that continue to run on the Classic Apex path. Before you enable Standard Cart APIs, review [Check Feature Compatibility](https://developer.salesforce.com/docs/industries/cme/guide/review-the-considerations.md) and the API list in [Standard Cart APIs](https://developer.salesforce.com/docs/industries/cme/guide/std-cart-get-started.md). ## APIs that remain on the Classic path You can enable only the APIs listed in [Standard Cart APIs](https://developer.salesforce.com/docs/industries/cme/guide/std-cart-get-started.md). Other Cart APIs continue to run using Apex libraries. The following operations have Classic usage examples and are not on the Standard Cart APIs list. Treat them as Classic unless a later release adds them to that list. | Operation | Remote method | Classic usage example | | --------- | ------------- | --------------------- | | Validate Cart | `runCartValidation` | [Validate Cart Action](https://developer.salesforce.com/docs/industries/cme/guide/comms-validate-cart-action.md) | | Clone Line Items | `cloneItems` | [Clone Line Items in Cart](https://developer.salesforce.com/docs/industries/cme/guide/comms-clone-line-items-in-cart.md) | | Cancel Order / Submit Cancel | `cancelCart` / `submitCancelOrder` | [Cancel Order](https://developer.salesforce.com/docs/industries/cme/guide/comms-cancel-order.md), [Submit a Cancel Order Request](https://developer.salesforce.com/docs/industries/cme/guide/comms-submit-a-cancel-order-request.md) | | Get Product Details / Get Products by ID | `getCartsProductDetails` / `getCartsProductsById` | [Get Details of Product](https://developer.salesforce.com/docs/industries/cme/guide/comms-get-details-of-product.md), [Get Products by ID](https://developer.salesforce.com/docs/industries/cme/guide/comms-get-products-by-id.md) | | Get Catalog Information | `getCatalogs` | [Get Catalog Information](https://developer.salesforce.com/docs/industries/cme/guide/comms-get-catalog-information.md) | | Get Price Lists for Cart | `getCartsPriceLists` | [Get Price Lists for Cart](https://developer.salesforce.com/docs/industries/cme/guide/comms-get-price-lists-for-cart.md) | | Update Item Attributes | `putCartsItemsAttributes` | [Update Item Attributes](https://developer.salesforce.com/docs/industries/cme/guide/comms-update-item-attributes.md) | | Get / Add Promotions | `getCartsPromotions` / `postCartsPromotions` | [Get Cart Promotions](https://developer.salesforce.com/docs/industries/cme/guide/comms-get-cart-promotions.md), [Add Promotion to Cart](https://developer.salesforce.com/docs/industries/cme/guide/comms-add-promotion-to-cart.md) | | Get Price Waterfall | `getCartsItemPrices` | [Get Price Waterfall for Price](https://developer.salesforce.com/docs/industries/cme/guide/comms-get-price-waterfall-for-price.md) | | Delete Adjustment | `deleteAdjustment` | [Delete Adjustment](https://developer.salesforce.com/docs/industries/cme/guide/comms-delete-adjustment.md) | | Get All Assets | `getAllAssets` | [Get Assets for Account](https://developer.salesforce.com/docs/industries/cme/guide/comms-get-assets-for-account.md) | For validation and pricing on the Standard path, use [Run Pricing for Items to Cart](https://developer.salesforce.com/docs/industries/cme/guide/standard_cart/std_comms-run-pricing-for-items-to-cart.md). Dedicated `runCartValidation` remains a Classic Cart API. ## Feature and API behavior differences | Area | Classic Cart APIs | Standard Cart APIs | | ---- | ----------------- | ------------------ | | Transformation of multi-play offers | Supported | Change of Plans is compatible for single-asset operations, but `replaceOffers` does not support complex multi-play transformations | | Bulk Change and Bulk Update | Supported | Not compatible. Bulk Change, Bulk Update, and bulk disconnect fail when Standard Cart APIs are enabled | | ProductSelector interface | Supported | Not supported. Use the `sortBy` parameter on `getCartsProducts` | | Field Settings / CPQV2 field settings | Supported for cart responses | Supported for `getCarts` and GetCartsItems only. For other Standard Cart APIs, pass custom fields in the `fields` parameter | | `noResponseNeeded` | Supported. `cloneItems` supports `noResponseNeeded` from the Winter'27 release | Supported for Add, Update, and Delete Standard Cart APIs from 258. Multi-item add defaults to `noResponseNeeded=true` unless you pass `false` | | `maintainAssetPrice` | Supported | Supported from 258 | | `includeAttachment` | Supported | Ignored on addToCart. Product attachments are not returned or displayed in LWC Cart (FlexCard-based or Enhanced) | | Custom Expression mode in RuleSets | Supported | Not supported | | Context mappings with Initialization Type `Type In` and Scope `SObject` | Supported | Not supported | | `nameResult` node (`attributeCategories`, `productAttributes`) | Present | Not present. Data nodes are returned directly | | `actions` node | Populates both `remote` and `rest` | Populates only the protocol you invoked | | Cart document / line items in custom code | Full line-item sObject list | `CpqCartDocument` contains only items affected by the current operation. [GetCartsItems](https://developer.salesforce.com/docs/industries/cme/guide/standard_cart/std_comms-get-cart-items.md) is the full-cart read | | Duplicate pricebook entry IDs in one add-to-cart call | Collapsed into a single cart line item | Each `items` array entry creates a distinct line item, even when `itemId` is the same | | Date fields in `fieldsToUpdate` | Locale-based `Date.parse()` (for example, `dd/mm/yyyy` for day-first locales) | ISO only (`yyyy-MM-dd`). Org and user locale are ignored | | Currency and pricing field types | Integer values are often accepted | Double is required (for example, `0` must be `0.0`) | | AssetToOrder invocation | `OmniFDOWrapper` uses the Classic flow | REST `/v2/carts` uses the Standard flow | | AssetToOrder CPQ settings | `UsingPromotions`, `DeltaPrice`, and `IsCachingEnabledForAssetToOrder` apply | Functionality exists, but those settings do not control Standard AssetToOrder | | PCP rule execution | Runs twice on add-to-cart: before validation and pricing, then in the post-execute hook after pricing | Runs once, before validation and pricing. See [PCP Execution Order](https://developer.salesforce.com/docs/industries/cme/guide/comms-migration-consideration-cart.md#product-configuration-procedure-pcp-execution-order) | **note:** Because not all APIs have migrated to the Standard Cart framework, custom implementations must accommodate both Classic and Standard Cart flows and switch dynamically based on context. See [Use CpqCartDocument](https://developer.salesforce.com/docs/industries/cme/guide/use-cart-document-cpq.md). # Limit Assets Collected by the Digital Commerce API Communication, Media, and Energy cloud leverages the Salesforce asset object to indicate what products and services have been bought by the customer, according to the customer account. Other packages, code, or businesses processes, including those of a third party, can also leverage the Salesforce asset object and populate records in the object. When too many asset records are created on the object outside of the CME-managed package, Digital Commerce reaches a governor limit and throws a SOQL error, such as `Too many query rows: 50001`, when trying to execute the Asset to Basket API. To avoid reaching governor limits and getting the SOQL error, you can limit the assets collected by the Digital Commerce API. 1. Create an Apex class named TransactionContextUtils. ```nolang public class TransactionContextUtils { private static vlocity_cmt.VOIInvoker invoker = vlocity_cmt.VOIInvoker.getInstance(); private static vlocity_cmt.VlocityOpenInterface transactionContext = (vlocity_cmt.VlocityOpenInterface)invoker.invoke('DefaultTrxnCtxImplementation', 'debugCreate', null, null, null); public static Boolean put(String key, Object value) { return (Boolean)invokeMethod('put', key, null, value); } public static Object get(String key) { return invokeMethod('get', key, null, null); } public static void printTransactionContext() { Map input = new Map(); Map output = new Map(); Map options = new Map(); transactionContext.invokeMethod('debug', input, output, options); } public static Object invokeMethod(String methodName, String key, Set keys, Object value) { Map input = new Map(); Map output = new Map(); Map options = new Map(); if (key != null) { input.put('key', key); } else if (keys != null) { input.put('keys', keys); } if (value != null) { input.put('value', value); } transactionContext.invokeMethod(methodName, input, output, options); return output.get('value'); } } ``` 2. Create an Apex class named CustomAssetsContextParser. ```nolang global class CustomAssetsContextParser implements vlocity_cmt.VlocityOpenInterface { public static String NSP = 'vlocity_cmt'; public Boolean invokeMethod(String methodName, Map input, Map output, Map options) { try { if (methodName.equalsIgnoreCase('parseContextInput')) { return parseContextInput(input, output, options); } else { return false; } } catch(Exception e) { //EcommLogger.error('AssetsContextParser', e); return false; } } private Boolean parseContextInput(Map input, Map output, Map options) { List assets = new List(); TransactionContextUtils.put('AssetObjects', assets); Map rootItemIdAssetKeyMap = new Map(); TransactionContextUtils.put('RootItemIdAssetKeyMap', rootItemIdAssetKeyMap); List contextVal = new List(); output.put('ContextValue', contextVal); return true; } } ``` 3. Add and activate a new interface implementation for AssetsContextInterface named CustomAssetsContextParser. 1. From the App Launcher, click Interface Implemtations. 2. Click New. 3. In the **New Interface Implementation** dialog, for **Interface Name**, enter `AssetsContextInterface`. 4. Click Save. 5. Click the Related tab. 6. Beside **Interface Implementation Detail**, click New. 7. In the **New Interface Implementation Detail** dialog: - For **Available Implementation**, enter `CustomAssetsContextParser`. - For **Interface Name**, enter `CustomAssetsContextParser`. - Click the **Active** check box to activate the interface implementation. 8. Click Save. ![Assets Context Interface](https://developer.salesforce.com/docs/media/assetscontextinterface.png) # Location Represents a physical or virtual place of business — such as a warehouse, plant, store, site, or delivery vehicle — used across Manufacturing/Automotive/Consumer Goods Cloud to model where inventory is held, where assortments are assigned, and where operations occur. Locations can be organized into a hierarchy via ParentLocationId and RootLocationId. This object is available in API version 68.0 and later. ## Supported Calls `create()`, `delete()`, `describeLayout()`, `describeSObjects()`, `getDeleted()`, `getUpdated()`, `query()`, `retrieve()`, `search()`, `undelete()`, `update()`, `upsert()` ## Special Access Rules Available only in orgs with Manufacturing Cloud, Automotive Cloud, or Consumer Goods Cloud features (including Inventory Management and Location/Assortment management) enabled. ## Fields ### CloseDate **Type:** date **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The date this location closed or is scheduled to close. ### ConstructionEndDate **Type:** date **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The date construction of this location finished. ### ConstructionStartDate **Type:** date **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The date construction of this location began. ### CurrencyIsoCode **Type:** picklist **Properties:** Create, Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The ISO currency code associated with this location. Possible values are: AED (UAE Dirham), USD (U.S. Dollar), and every other active currency ISO code configured for the org. The default value is USD. ### Description **Type:** string **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** A free-text description of this location. ### DrivingDirections **Type:** string **Properties:** Create, Filter, Nillable, Sort, Update **Description:** Free-text driving directions to reach this location. ### Email **Type:** email **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The primary email address associated with this location. ### ExternalReference **Type:** string **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** An external identifier used to correlate this record with the same location in an external or source system. ### Fax **Type:** phone **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The fax number for this location. ### InternalOrganizationUnitId **Type:** reference **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The internal organization unit that owns or operates this location. **Relationship Name:** InternalOrganizationUnit **Refers To:** InternalOrganizationUnit ### IsInventoryLocation **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether inventory can be tracked and stored at this location. The default value is false. ### IsMobile **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether this location is mobile (for example, a delivery van) rather than a fixed site. The default value is false. ### LastReferencedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** The timestamp when the current user last accessed this record or a related record. ### LastViewedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** The timestamp when the current user last viewed this record. ### Latitude **Type:** double **Properties:** Create, Filter, Nillable, Sort, Update **Description:** The geolocation latitude of this location. ### Location **Type:** location **Properties:** Nillable **Description:** The compound geolocation field composed of the Latitude and Longitude values. ### LocationLevel **Type:** int **Properties:** Filter, Group, Nillable, Sort **Description:** The depth of this location within the location hierarchy, relative to its root location. ### LocationType **Type:** picklist **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** The type of place this location represents. Possible values are Plant, Site, Van, Virtual, and Warehouse. The default value is Warehouse. ### LogoId **Type:** reference **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The content asset used as this location's logo/image. **Relationship Name:** Logo **Refers To:** ContentAsset ### Longitude **Type:** double **Properties:** Create, Filter, Nillable, Sort, Update **Description:** The geolocation longitude of this location. ### Mobile **Type:** phone **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The mobile phone number associated with this location. ### MobileLocationType **Type:** picklist **Properties:** Create, Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** When IsMobile is true, indicates the type of mobile location. Possible values are Bike, Car, CargoUnit—Cargo Unit, and Truck. The default value is Car. ### Name **Type:** string **Properties:** Create, Filter, Group, idLookup, Sort, Update **Description:** The name of this location. ### OpenDate **Type:** date **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The date this location opened for business. ### OwnerId **Type:** reference **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** The user or queue that owns this record. **Relationship Name:** Owner **Refers To:** Group, User ### ParentLocationId **Type:** reference **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The immediate parent location in the location hierarchy. **Relationship Name:** ParentLocation **Refers To:** Location ### Phone **Type:** phone **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The primary phone number for this location. ### PossessionDate **Type:** date **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The date possession of this location was taken (for example, on lease or purchase). ### RegistrationNumber **Type:** string **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** A government or business registration number associated with this location. ### RemodelEndDate **Type:** date **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The date a remodel of this location finished. ### RemodelStartDate **Type:** date **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The date a remodel of this location began. ### RootLocationId **Type:** reference **Properties:** Filter, Group, Nillable, Sort **Description:** The top-level (root) location at the base of this location's hierarchy branch. **Relationship Name:** RootLocation **Refers To:** Location ### TimeZone **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The time zone this location operates in, expressed as an IANA time zone identifier (for example, America/New_York). ## Associated Objects This object has the following associated objects. If the API version isn't specified, they're available in the same API versions as this object. Otherwise, they're available in the specified API version and later. - [LocationChangeEvent](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/change-event.md): Change events are available for the object. - [LocationFeed](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/feed.md): Feed tracking is available for the object. - [LocationHistory](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/history.md): History is available for tracked fields of the object. - [LocationOwnerSharingRule](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/owner-sharing-rule.md): Sharing rules are available for the object. - [LocationShare](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/share.md): Sharing is available for the object. # LocationAssortment Represents the assignment of an Assortment (a defined set of products) to a specific Location, indicating which products that location is authorized to sell, stock, or order. This object is available in API version 68.0 and later. ## Supported Calls `create()`, `delete()`, `describeLayout()`, `describeSObjects()`, `getDeleted()`, `getUpdated()`, `query()`, `retrieve()`, `undelete()`, `update()`, `upsert()` ## Special Access Rules Available only in orgs with Consumer Goods Cloud or Retail Execution features enabled. ## Fields ### AssortmentId **Type:** reference **Properties:** Create, Filter, Group, Sort, Update **Description:** The ID of the Assortment assigned to the location. **Relationship Name:** Assortment **Refers To:** Assortment ### CurrencyIsoCode **Type:** picklist **Properties:** Create, Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The ISO code for the currency of this record. Possible values are: AED (UAE Dirham), USD (U.S. Dollar), and every other active currency ISO code configured for the org. The default value is USD. ### IsActive **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether this assortment-to-location assignment is currently active. The default value is false. ### LastReferencedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** The timestamp when the current user last accessed this record, a related record, or a list view. ### LastViewedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** The timestamp when the current user last viewed this record. ### LocationId **Type:** reference **Properties:** Create, Filter, Group, Sort **Description:** The ID of the Location this assortment is assigned to. **Relationship Name:** Location **Refers To:** Location ### Name **Type:** string **Properties:** Autonumber, Defaulted on create, Filter, idLookup, Sort **Description:** The auto-generated name of the location assortment record. ## Associated Objects This object has the following associated objects. If the API version isn't specified, they're available in the same API versions as this object. Otherwise, they're available in the specified API version and later. - [LocationAssortmentChangeEvent](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/change-event.md): Change events are available for the object. - [LocationAssortmentFeed](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/feed.md): Feed tracking is available for the object. - [LocationAssortmentHistory](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/history.md): History is available for tracked fields of the object. - [LocationAssortmentOwnerSharingRule](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/owner-sharing-rule.md): Sharing rules are available for the object. - [LocationAssortmentShare](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/share.md): Sharing is available for the object. # Make Sure Your IDE Is Configured for Java Many integrated development environments (IDEs) are configured for Java by default. If your IDE isn't, make sure to add the Java features you need. For example, the Visual Studio Code IDE has an Extension Pack for Java. To configure Visual Studio Code: 1. Click the Extensions icon and type `java` in the search field. Find **Extension Pack for Java** and click **Install**. 2. If a message on the Extension Pack for Java tab says you must install Java or a higher version of Java, click the button and run the installation. 3. Locate the home folder for Java. For example: ```nolang /Library/Java/JavaVirtualMachines/temurin-11.jdk/Contents/Home ``` 4. Open the Visual Studio Code Settings tab. To open Settings on a Mac, type command-comma. 5. Type `java.home` in the Settings tab search field. 6. Select **User**, then click the **Edit in settings.json** link. 7. Add the path to the Java home folder to the `settings.json` file and save the file. For example: ```nolang { "java.home": "/Library/Java/JavaVirtualMachines/temurin-11.jdk/Contents/Home" } ``` [Get the Sample Orchestrator Code for CacheManagement APIs](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-get-the-sample-orchestrator-code-for-cachemanagement-apis.md) # Migrate to Standard Cart APIs The structured migration process involves these phases. This approach ensures a seamless transition to Standard Cart APIs by validating changes in a Sandbox environment before deploying them to Production. Users can follow this phased approach, to minimize risks, enhance system performance, and leverage advanced features for improved efficiency and scalability. - [Evaluation Phase](#evaluation-phase) - [Implementation Phase](#implementation-phase) ## Evaluation Phase The evaluation phase is critical for understanding the benefits of transitioning to Standard Cart APIs and ensuring compatibility with existing functionalities. This phase involves assessing performance improvements, available features, and designing an implementation strategy tailored to specific business needs. ### Understand the Value of Standard Cart APIs Migrating to Standard Cart APIs offers these advantages. - **Better Performance and Thresholds**: Standard Cart APIs are optimized for efficiency, offering improved response times, scalability, and handling higher transaction volumes without performance degradation. - **Exclusive Features and Roadmap**: Standard Cart APIs provide access to advanced capabilities and continuous enhancements, ensuring alignment with future technological advancements and platform updates. ### Evaluate Feature Compatibility Before proceeding with migration, it is essential to assess the compatibility of existing features with Standard Cart APIs: - **Check Supported Features**: Identify which current functionalities are supported by Standard Cart APIs and determine whether any modifications or alternatives are required. See [Check Feature Compatibility](https://developer.salesforce.com/docs/industries/cme/guide/review-the-considerations.md) and [Known Limitations](https://developer.salesforce.com/docs/industries/cme/guide/standard-cart-known-limitations.md). Product attachments on cart line items are not supported with Standard Cart APIs or LWC Cart. - **Identify Standard vs Classic APIs**: Only the APIs listed in [Standard Cart APIs](https://developer.salesforce.com/docs/industries/cme/guide/std-cart-get-started.md) run on the Standard path. Other Cart APIs continue to run on Classic Apex. See [Cart APIs vs Standard Cart APIs](https://developer.salesforce.com/docs/industries/cme/guide/comms-cart-based-apis-for-industries-cpq.md#cart-apis-vs-standard-cart-apis). - **Future Roadmap Considerations**: Evaluate upcoming enhancements and new capabilities in Standard Cart APIs to align with long-term business objectives and avoid potential rework. ### Design and Estimate A well-structured migration plan ensures minimal disruption to business operations: - **Identify Relevant Standard Cart APIs**: Determine which APIs are applicable for the use cases specific to the business. See [Standard Cart APIs Usage Examples](https://developer.salesforce.com/docs/industries/cme/guide/stdcart-api-examples.html). - **Evaluate Benefits and Feasibility**: Assess the expected gains in terms of performance, scalability, and ease of maintenance to justify the migration effort. ## Implementation Phase The implementation phase is divided into these two major stages. 1. [Sandbox Migration Steps](#sandbox-migration-steps): For initial testing and validation. 2. [UAT/Production Migration Steps](#uat-or-production-migration-steps): For final deployment and production rollout. ### Sandbox Migration Steps 1. Enable JSON Attribute V2 Schema (prerequisite). Ensure that JSON Attribute V2 Schema is enabled before proceeding with further changes. See [JSONAttribute v2 Schema Upgrade Considerations](https://help.salesforce.com/s/articleView?id=ind.comms_jsonattribute_v2_schema_upgrade_considerations.htm&language=en_US&type=5). 2. Review interfaces and implementations. Analyze and update implementation class names and interfaces that are compatible with Standard Cart APIs. See [Interfaces and Implementations](https://developer.salesforce.com/docs/industries/cme/guide/comms-migration-consideration-cart.html#interfaces-and-implementations). 3. Update Attribute-Based Pricing Modify the existing pricing logic to align with the attribute-based pricing model in Standard Cart APIs. See [Set up Attribute-Based Pricing](https://developer.salesforce.com/docs/industries/cme/guide/comms-set-up-attribute-based-pricing-cart.html). 4. Handle changes to response Ensure that any modifications in API response formats are accounted for in dependent systems to avoid integration issues. See [Changes to Response](https://developer.salesforce.com/docs/industries/cme/guide/comms-migration-consideration-cart.html#changes-to-response). 5. Move customizations - If there are any custom hook implementations, make the necessary updates. - Use [Field Mappers](https://developer.salesforce.com/docs/industries/cme/guide/use-field-mappers-cart-document.html) to add and manage custom fields, ensuring they are properly integrated. - Update any existing hook implementations using the [CPQ Cart Document](https://developer.salesforce.com/docs/industries/cme/guide/use-cart-document-cpq.html) to align with Standard Cart APIs. - Because not all APIs have migrated to the Standard Cart framework, custom implementations must accommodate both Classic and Standard Cart flows and switch dynamically based on context. 6. Enable Standard Cart APIs Activate the necessary Standard Cart APIs to replace legacy implementations. See [Enable the Standard Cart APIs](https://developer.salesforce.com/docs/industries/cme/guide/enable-standard-cart-apis.html). 7. Execute the administration tasks. Complete the required configuration updates and administrative tasks to support the migration. See [Execute the Administration Tasks](https://developer.salesforce.com/docs/industries/cme/guide/execute-administration-tasks.html). 8. Validation Conduct thorough testing in the Sandbox environment to verify that all functionalities work as expected before moving to production. ### UAT or Production Migration Steps 1. Enable JSON Attribute V2 Schema (prerequisite). Ensure that JSON Attribute V2 Schema is enabled in the production environment before proceeding. See [JSONAttribute v2 Schema Upgrade Considerations](https://help.salesforce.com/s/articleView?id=ind.comms_jsonattribute_v2_schema_upgrade_considerations.htm&language=en_US&type=5). 2. Deploy Sandbox/UAT changes in Production. Migrate the tested configurations and changes from Sandbox/UAT to the production environment through the existing deployment process. 3. Enable Standard Cart APIs. Activate the Standard Cart APIs in the production environment. See [Enable the Standard Cart APIs](https://developer.salesforce.com/docs/industries/cme/guide/enable-standard-cart-apis.html). 4. Execute the administration tasks. Complete the required configuration updates and administrative tasks to support the migration. See [Execute the Administration Tasks](https://developer.salesforce.com/docs/industries/cme/guide/execute-administration-tasks.html). 5. Validation Conduct thorough testing in the Production environment to verify that all functionalities work as expected before moving to production. # Migrate to Standard Digital Commerce Migrate from Digital Commerce to Standard Digital Commerce. # Migration Considerations Before you begin, [Check Feature Compatibility](https://developer.salesforce.com/docs/industries/cme/guide/review-the-considerations.md) for using the standard cart APIs. ## Interfaces and Implementations Following table lists supported interfaces and implementation class names. | Interface Name (in Cart APIs) | Supported in Cart APIs | Supported with Standard Cart APIs | Interface Name (when Standard Cart APIs are enabled) | Active Implementation Class Name | | ----------------------------------------------------------------------------------------------------- | ---------------------- | --------------------------------- | ---------------------------------------------------- | -------------------------------- | | PricingInterface | Y | Y | CpqPricing | CpqPricingOrchestratorService | | ProductValidationInterface | Y | Y | CpqValidation | CpqValidationService | | TightestMatchInterface | Y | Y | CpqTightestMatch | CpqTightestMatchPLEService | | TimePolicyInterface | Y | Y | CpqTimePolicy | CpqTimePolicyService | | CpqAppHandlerHook | Y | Y | CpqAppHandlerHook | | | PricingElementServiceImplementationH
PricingPlanServiceHook
CustomPricingElementServiceImplHook | Y | Y | CpqPricingHook | Custom Hook Implementation Name | | ContextRuleService | Y | Y | CpqContextRule | CpqContextRuleService | | DefaultPricingVariableCalcImplementaInterface | Y | Y | CpqPricingVariableCalc | CpqPricingVariableCalcService | | | | | CartResponse | CartResponseService | | PricingSelector | Y | N | | | | CtxRulesPriceListsOpen | Y | Y | CpqPricingEligibility | CpqPricingEligibilityService | **important:** - If a product is marked as IsOrderable\_\_c=false, Advanced rules and PCPs will not work correctly in Standard Cart APIs. Instead, configure the Product with IsOrderable\_\_c=true and filter the Products in [Availability and Eligibility Interface Implementations](https://help.salesforce.com/s/articleView?id=ind.v_dev_t_availability_and_eligibility_interface_implementations_652003.htm&type=5). - When EPC job is run without selecting any PriceList, it caches the PCP data for products marked IsOrderable\_\_c=false. Then PCP rules will work for all the products. - To return a custom field in a Cart API response, the field must be explicitly included in the fields parameter, either in the API URL parameters or the request body. The CPQV2 field settings approach for controlling response fields is supported for the getCarts and GetCartsItems APIs. It does not apply to other Standard Cart APIs. - Standard Cart APIs enforce Double as the required data type for the pricing or currency-related fields. Users must update such Integer values in their custom code to Double type (for example, 0 → 0.0) as Integer types might cause type mismatch exceptions at the runtime. All future implementations must use Double type for the currency related fields. ## Cart Documents To learn how to use cart documents, see [Use Cart Documents](https://developer.salesforce.com/docs/industries/cme/guides/use-cart-document-cpq.md). ## Product Configuration Procedure (PCP) Execution Order Product configuration procedure (PCP) rules must run before validation and pricing so that any attribute or line-item changes they make are included in those steps. Treat Standard Cart API behavior as the correct reference implementation. ### Standard Cart APIs In Standard Cart APIs, PCP rules run once, before validation and pricing. Attribute values that PCP rules change are therefore available to the pricing engine. When you set attribute values from custom code, use `setItemAttributes` so that PCP rules pick up the new values. See [Use CpqCartDocument](https://developer.salesforce.com/docs/industries/cme/guide/use-cart-document-cpq.md#update-attribute-values). Do not update attributes or line items during the pricing step. Pricing must operate on a stable, finalized set of line-item data. ### Classic Cart APIs In Classic Cart APIs, PCP rules currently execute twice during Add Line Item (`postCartItems`) operations: 1. Once before validation and pricing 2. Once during the post-execute hook (after pricing) The second execution is not the intended behavior: - Changes made during the post-execute hook are not persisted. - Modifying line items after pricing has started is not recommended, because pricing should operate on a stable, finalized set of line-item data. To stop PCP rules from running in the post-execute hook, set both of these values to `False` in **Vlocity CMT Administration** → **CPQ Configuration Setup**: - `RunPCPInAddPostExecuteMethod` - `RunPCPInUpdatePostExecuteMethod` ## Attribute-Based Pricing To learn how to use Attribute-Based Pricing, see [Set up Attribute-Based Pricing](https://developer.salesforce.com/docs/industries/cme/guides/comms-set-up-attribute-based-pricing-cart.md). For more information, see [Attribute-Based Pricing](https://help.salesforce.com/s/articleView?id=ind.comms_attribute_based_pricing.htm&type=5) ## Context Mappings Context Rules with context mappings having Initialisation Type as `Type In` and `Scope SObject` are not supported in Standard DC and Cart APIs. ## Changes to Response ### Messages Node in postCartItems API (Standard Cart API) When a postCartItems API adds a product with configuration issues to the cart, the `messages` node in the Standard Cart API response shows both success and error messages. For example, if a required attribute lacks a default value and the product is still added, the `messages` node in response includes both the success and the error messages. Here's a sample messages node in the postCartItems API response: ``` {"severity": "INFO","message": "Successfully added.","code": "150"} {"severity":"ERROR","message":"Required attribute missing for ProdWithTextAttr.", "code":"204","messageId":"...","bundleId":"..."} ``` **note:** The GetCartItems API still has the same behavior in Standard CPQ as in Classic CPQ for backward compatibility. ### Actions Node The `actions` node consists of two main protocols to invoke CPQ APIs, and there are separate nodes for each protocol: `remote` and `rest`. In Classic CPQ, whether the API is invoked via REST or as a Remote call, it populates both `remote` and `rest` nodes. In Standard CPQ, the API populates actions node based on the protocol. - If a REST call is made, the API populates the rest action node in the response. - If a Remote call is made, the API populates the remote action node in response. # Migration Considerations Before you migrate to Standard Digital Commerce, learn how Standard Digital Commerce differs from Digital Commerce. ## Cart Documents In Digital Commerce, when you ran Basket operations, the API calls sometimes created the following: - Pseudo-accounts and pseudo-orders - Order line items - Order price adjustments - Order applied promotions - Order applied promotion items In Standard Digital Commerce, these objects aren't created during Basket operations. Therefore, you can't use any custom triggers for Configure or Basket operations on these objects that you created. This includes any custom code written in interface implementations such as custom hooks or steps. Refactor any such customizations to use cart documents instead. Cart documents provide additional scalability and performance during Configure and Basket operations. Cart documents are trimmed and flexible JSON structures that can be used with the CPQ on Core services. You can then translate the output JSON to send a response to the top layer APIs such as DC APIs. To learn how to use cart documents, see [Use Cart Documents](https://developer.salesforce.com/docs/industries/cme/guide/comms-use-cart-documents.html?q=Use%20Cart%20Documents). **note:** Cart field retrieval from the CPQ Cart Document is not yet supported in the Standard DC API. ## Custom Fields You an add custom fields to cart documents using field mapping. After you create the custom field for Order or OrderItem sObjects, map them to a key in the cart document. The key is the internal representation of the custom fields in the cart document. Therefore, they don't include prefixes such as the namespace or "\_\_c". When you specify the key, please follow these requirements: - Use the field name. - Don't add prefixes such as the namespace or "\_\_c". - Lowercase. - Unique for the org. When the cart document wrapper updates the value for a custom field, this mapping is used to get the key in the cart document. The corresponding node is also updated with the value. This mapping is also used to create a response such as the external representation that contains the namespace prefix and "\_\_c" using the internal cart document. ![Sample Cart Document Mapping Record](https://developer.salesforce.com/docs/media/cart_document_sample_map.png "Sample Cart Document Mapping Record") In this example, if a new custom field is created on OrderItem, then you must also create a mapping record for the field. To create a new mapping, from Setup, in the Quick Find box, enter `Custom Settings`, and then select **Custom Settings**. Next to Custom Field Maps, click **Manage** and click **New**. **note:** Custom fields are not supported for following objects in Standard CPQ. - OrderAppliedPromotionItem - QuoteAppliedPromotionItem - OpportunityAppliedPromotionItem ## Attribute-Based Pricing You can use attribute-based pricing in the following ways: - Using the Java Core Service: Use custom designed services on Salesforce Core to implement Attribute-Based Pricing. With this approach, attribute-based pricing uses the Salesforce platform. Using the default attribute-based pricing behavior allows for faster, efficient, and optimized execution versus Apex code. If your implementation of attribute-based pricing doesn't use significant customizations, we recommend using this approach. - Using VPL Code running on the Apex Tier: Use existing VPL classes to work with the cart document JSON. If you want to customize your implementation, use this approach. See [Set up Attribute-Based Pricing](https://help.salesforce.com/s/articleView?id=ind.comms_Set_up_Attribute-Based_Pricing.htm&type=5). ## Promotions Begininning from Standard DC APIs, catalog product relationships for all promotion items are necessary for each promotions. ## Basket Eligibility Check The `BasketValidationResult` node in the response will contain these details when eligibility check fails for one product. ``` "BasketValidationResult": { "IneligibleOffers": { "IneligibleOffers": { "<> ( <> )": "items in the cart are no longer eligible, Please delete the offers before proceeding further" } } } ``` The `BasketValidationResult` node in the response will contain these details when eligibility check fails for more than one product. ``` "BasketValidationResult": { "IneligibleOffers": { "IneligibleOffers": { "<> (<> ),<> (<> )": "items in the cart are no longer eligible, Please delete the offers before proceeding further" } } } ``` The `BasketValidationResult` node in the response will contain these details when eligibility check fails for one promotion. ``` "BasketValidationResult": { "IneligibleOffers": { "IneligibleOffers": { "<>": "promotions are not eligible to be added to the cart. Please check the context info" } } } ``` The `BasketValidationResult` node in the response will contain these details when eligibility check fails for one product and one promotion. ``` "BasketValidationResult": { "IneligibleOffers": { "IneligibleOffers": { "<> ( <> ),<> ( ProductItemId )": "items in the cart are no longer eligible, Please delete the offers before proceeding further" } } } ``` **note:** When a bundle is added to basket, the eligibility check is performed only for root product. # Modify Basket You can modify the contents of the basket in several ways as shown in the sections here. - Add Additional Product to Basket: This API is described by Create Basket (AddWithNoConfig) and Create Basket (AddAfterConfig). The difference is the cartContextKey of the previous basket. Copy the cartContextKey from the response; it should resemble the following: ```nolang "cartContextKey": "c96443b4c5ad00c2f6820a9d8b37f5cb" ``` Insert the value into the **cartContextKey** Path variable: ![Value for cartContextKey Path variable](https://developer.salesforce.com/docs/media/postman_modifybasket1.png) **note:** The cartContextKey is generated every time a change is made to the basket. Make sure to take the latest from the response to make additional changes to the basket. - Delete or Update Basket Item: The Basket response contains all of the required parameters to perform these actions. Look for the **actions** node. ![Delete Basket Item](https://developer.salesforce.com/docs/media/postman_modifybasketdelete.png) ![Update Basket Item](https://developer.salesforce.com/docs/media/postman_modifybasketupdate.png) Use the values from the actions node to form the request body: ```nolang {     "bundleContextKey": "",     "lineItemKey": "",     "basketAction": "" } ``` - Update Item Quantity or Attributes: To update items, add **Quantity** or **attributeCategories** to the request body, as shown here. ```nolang {     "bundleContextKey": "",     "lineItemKey": "",     "basketAction": "",     "Quantity": "",     "attributeCategories": "" } ``` - Add Child Item: This API call is similar to the previous call. To run, inspect the data that is in the basket and copy the values to the related keys in the request. ![Add Child Item](https://developer.salesforce.com/docs/media/postman_modifybasketaddchild.png) - Get Basket Details: This API requires **cartContextKey** and **catalogcode**. ![Get Basket Details](https://developer.salesforce.com/docs/media/postman_getbasketdetails.png) # Multi Edit Cart Line Items Multi Edit Cart Line Items API allows the user to update multiple items present in the cart in a single transaction. It could be to update all modified attributes and fields at once across line items. **note:** This API follows an all or nothing approach such that either the changes made to all line items are applied to the cart or none are applied at all. ## URI ```nolang /services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/items ``` ## HTTP Method PATCH ## Apex Method `multiEditCartItems` ## Apex Remote Service ```nolang CpqAppHandler ``` ## Request Parameters | Parameter | Description | | ----------- | ------------------------------------------------------------------------------ | | `namespace` | `vlocity_cmt` | | `cart_ID` | The unique ID of the cart, which is the ID of the opportunity, quote, or order | ## Query Parameters | Parameter | Description | | ---------- | ------------------------------------------------------------------- | | `price` | Execute the pricing service and price the affected items. | | `validate` | Execute the context rules and advance rules for the affected items. | ## Example Request ```nolang PATCH /services/apexrest/vlocity_cmt/v2/cpq/carts/{cartid}/items?price=true&validate=true Request Body: { "items": [ { "rootItemId": "f6e846b1-2a7e-4d8a-8de5-50e5f986ca4e", "assetReferenceId": "c548e1d2-8078-4eca-8a79-916ba79b2595", "fields": { "": "value1", "": "value2", "quantity": "value3", ... }, "attributes": { "" : "userValue", "" : ["userValue2", "userValue3"], ... } } ] } ``` ## Example putCartsItems Request In order to update quantity for the multiple line item, it requires to update the Quantity fields under corresponding rootItemId and assetReferenceId for the line item as per above JSON format, and send a PATCH request for update. ```nolang { "items": [ { "rootItemId": "f6e846b1-2a7e-4d8a-8de5-50e5f986ca4e", "assetReferenceId": "f6e846b1-2a7e-4d8a-8de5-50e5f986ca4e", "fields": { "Quantity": 5 } }, { "rootItemId": "f6e846b1-2a7e-4d8a-8de5-50e5f986ca4e", "assetReferenceId": "c548e1d2-8078-4eca-8a79-916ba79b2595", "fields": { "Quantity": 7 } } ] } ``` ## Example Response The API does not provide a complete response after each modification. It’s just success or failure. In order to fetch the updated cart info, customers are required to execute the getCartItems API further. **Success Scenario** ```nolang { "status":"success", "message":"Line Items are updated successfully.", "code":"200.MultiEditCartItems.000" } ``` **Failure Scenario** ```nolang { "status" : "error", "code" : "400.MultiEditCartItems.002", "message" : "Invalid cartId passed in request URL." } ``` ```nolang { "status" : "error", "code" : "400.MultiEditCartItems.011", "message" : "Set CPQ Configuration UseAssetReferenceIdForParentAndRoot to true for MultiEditCartItem API to work." } ``` ```nolang { "status" : "error", "code" : "413.MultiEditCartItems.001", "message" : "Guardrail Exception : Limit for MultiEditCartItem API is : 20 per API call." } ``` ```nolang { "status" : "error", "code" : "400.MultiEditCartItems.010", "message" : "Invalid Asset Ref Ids: [Id] passed in Input." } ``` ```nolang { "status" : "error", "code" : "400.MultiEditCartItems.006", "message" : "Disconnected line item cannot be edited." } ``` ```nolang { "status" : "error", "code" : "400.MultiEditCartItems.015", "message" : "No Fields or Attributes to Edit for Asser Reference Ids : [ID]." } ``` ```nolang { "status" : "error", "code" : "400.MultiEditCartItems.014", "message" : "Duplicate Line Items for assetRefIds : [ID]." } ``` ```nolang { "status" : "error", "code" : "400.MultiEditCartItems.001", "message" : "Field passed [FieldName] is invalid." } ``` ```nolang { "status" : "error", "code" : "400.MultiEditCartItems.002", "message" : "Field passed [FieldName] is not editable." } ``` # Multi-Transaction Service The Multi-Transaction Service (MTS) is integrated with the Digital Commerce Basket APIs to split Apex transactions into multiple transactions to avoid exceeding Salesforce Governor limits. Use its configuration settings to enable it: - [MaxCPUTimePerTransaction](https://help.salesforce.com/s/articleView?id=ind.comms_t_cpq_configuration_settings_reference_148927.htm): Sets the maximum allowed CPU time per Apex transaction before the transaction is split. - [MaxHeapSizePerTransaction](https://help.salesforce.com/s/articleView?id=ind.comms_t_cpq_configuration_settings_reference_148927.htm): Sets the maximum allowed heap size per Apex transaction before the transaction is split. - [MTSEnabled](https://help.salesforce.com/s/articleView?id=ind.comms_t_cpq_configuration_settings_reference_148927.htm): Enables the Multi-Transaction Service. - [NumberOfDMLPerTransaction](https://help.salesforce.com/s/articleView?id=ind.comms_t_cpq_configuration_settings_reference_148927.htm): Sets the maximum allowed data manipulation language (DML) statements per Apex transaction before the transaction is split. - [NumberOfQueriesPerTransaction](https://help.salesforce.com/s/articleView?id=ind.comms_t_cpq_configuration_settings_reference_148927.htm): Sets the maximum allowed SOQL queries per Apex transaction before the transaction is split. The MTS supports long-running transactions and returns a `multiTransactionKey` in the `nexttransaction` action. To proceed, call the API again with the `multitransactionKey` in the request payload as shown in the following example Add to Basket requests and responses with MTSEnabled set to true (the default). **Example Requests and Responses** Example Add to Basket Request ```nolang POST /services/apexrest/{namespace}/v3/catalogs/{catalog_code}/basket?contextKey=017d3c3f990567a3ce2ca3e60262ec90&context={"accountId":"0019P000024jKuZ"}&isloggedin=true Body { "offer": "TelcoResidential", "basketAction": "AddWithNoConfig" } ``` Example Intermediate Response ```nolang { "nexttransaction": { "rest": { "params": { "multiTransactionKey": "3d719d4a3b14cea4187ea9a5332cff0e", "method": "addWithNoConfig" } } } } ``` Example Request to Pass the multiTransactionKey ```nolang POST  /services/apexrest/{namespace}/v3/catalogs/{catalog_code}/basket?contextKey=017d3c3f990567a3ce2ca3e60262ec90&context={"accountId":"0019P000024jKuZ"}&isloggedin=true Body { "offer": "TelcoResidential", "basketAction": "AddWithNoConfig", "multiTransactionKey": "3d719d4a3b14cea4187ea9a5332cff0e" } ``` Example Response This example is truncated. ```nolang { "cartContextKey": "20933d86217050b8d3b15654aeceae30", "result": { "totals": { "EffectiveOneTimeTotal__c": 400, "EffectiveRecurringTotal__c": 200 }, "totalSize": 1, "records": [ { "actions": { "deleteFromBasketAction": { "rest": { "params": { "basketAction": "deleteFromBasket", "lineItemKey": "533befb7d15a0a400f09c59ecaef21ee", "bundleContextKey": "533befb7d15a0a400f09c59ecaef21ee" }, "link": "/v3/catalogs/vlocity_cmt/basket/20933d86217050b8d3b15654aeceae30?contextKey=017d3c3f990567a3ce2ca3e60262ec90&isloggedin=true", "method": "deleteFromBasketAction" } }, "updateBasketAction": { "rest": { "params": { "basketAction": "updateBasket", "lineItemKey": "533befb7d15a0a400f09c59ecaef21ee", "bundleContextKey": "533befb7d15a0a400f09c59ecaef21ee" }, "link": "/v3/catalogs/{catalog_code}/basket/20933d86217050b8d3b15654aeceae30?contextKey=017d3c3f990567a3ce2ca3e60262ec90&isloggedin=true", "method": "updateBasketAction" } } }, "lineItemKey": "533befb7d15a0a400f09c59ecaef21ee", "bundleContextKey": "533befb7d15a0a400f09c59ecaef21ee", "displaySequence": -1, "Id": { "value": "8024P000001gdBNQAY", "previousValue": null, "originalValue": null, "messages": [], "label": "Order Product ID", "hidden": false, "fieldName": "Id", "editable": false, "dataType": "ID", "alternateValues": null, "actions": {} }, "Pricebook2Id": "01s4P000002BoBuQAK", "Product2Id": "01t4P000007VDOkQAO", "ProductCode": "TelcoResidential", "UnitPrice": { "value": 0, "previousValue": null, "originalValue": null, "messages": [], "label": "Unit Price", "hidden": true, "fieldName": "UnitPrice", "editable": false, "dataType": "CURRENCY", "alternateValues": null, "actions": {} }, "Name": "Telco Residential", "IsActive": true, "vlocity_cmt__RecurringPrice__c": 200, "Product2": { "attributes": { "type": "Product2", "url": "/services/data/v46.0/sobjects/Product2/01t4P000007VDOkQAO" }, "Id": "01t4P000007VDOkQAO", "Name": "Telco Residential", "vlocity_cmt__IsConfigurable__c": false, "vlocity_cmt__Type__c": "None", "vlocity_cmt__SubType__c": "None", "vlocity_cmt__SellingStartDate__c": "2019-05-01T18:00:00.000+0000", "vlocity_cmt__SellingEndDate__c": "2019-09-30T18:00:00.000+0000", "vlocity_cmt__JSONAttribute__c": null }, "CurrencyCode": "USD", "productId": "01t4P000007VDOkQAO", "defaultQuantity": 1, "minQuantity": 0, "maxQuantity": 99999, "groupMinQuantity": 0, "groupMaxQuantity": 99999, "sequenceNumber": 1, "productChildItemDefinition": { "attributes": { "type": "vlocity_cmt__ProductChildItem__c" }, "Name": "Root PCI", "vlocity_cmt__IsVirtualItem__c": false, "vlocity_cmt__Quantity__c": 1, "vlocity_cmt__MaxQuantity__c": 99999, "vlocity_cmt__MinQuantity__c": 0, "vlocity_cmt__MaximumChildItemQuantity__c": 99999, "vlocity_cmt__MinimumChildItemQuantity__c": 0, "vlocity_cmt__IsOverride__c": false, "vlocity_cmt__ParentProductId__c": "01t4P000007VDOkQAO", "vlocity_cmt__ChildLineNumber__c": "1", "vlocity_cmt__SeqNumber__c": 1, "vlocity_cmt__CollapseHierarchy__c": false, "vlocity_cmt__IsRootProductChildItem__c": true, "vlocity_cmt__ParentProductId__r": { "attributes": { "type": "Product2", "url": "/services/data/v46.0/sobjects/Product2/01t4P000007VDOkQAO" }, "Id": "01t4P000007VDOkQAO", "Name": "Telco Residential", "vlocity_cmt__SellingStartDate__c": "2019-05-01T18:00:00.000+0000", "vlocity_cmt__SellingEndDate__c": "2019-09-30T18:00:00.000+0000" } }, "productHierarchyPath": "01t4P000007VDOkQAO", "name": "Telco Residential", "isVirtualItem": false, "lineNumber": "0001", "action": "Add", "hasChildren": true, "SellingPeriod": "Present", "itemType": "lineItem", "PricebookEntryId": { "value": "01u4P00000s2eZjQAI", "previousValue": null, "originalValue": null, "messages": [], "label": "Price Book Entry ID", "hidden": false, "fieldName": "PricebookEntryId", "editable": false, "dataType": "REFERENCE", "alternateValues": null, "actions": {} }, "Quantity": { "value": 1, "previousValue": null, "originalValue": null, "messages": [], "label": "Quantity", "hidden": false, "fieldName": "Quantity", "editable": true, "dataType": "DOUBLE", "alternateValues": null, "actions": {} }, "vlocity_cmt__OneTimeTotal__c": { "value": 400, "previousValue": null, "originalValue": null, "messages": [], "label": "One Time Total", "hidden": false, "fieldName": "vlocity_cmt__OneTimeTotal__c", "editable": false, "dataType": "CURRENCY", "alternateValues": null, "actions": { "adjustmentcodes": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/listsofvalues?listkeys=AdjustmentCodes&cartId=8014P0000022G0jQAE&id=8024P000001gdBNQAY&fields=vlocity_cmt__OneTimeTotal__c&PricingVariableCode=OT_STD_PRC_TOTAL" }, "remote": { "params": {} }, "client": { "records": [], "params": {} } }, "pricedetail": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/8014P0000022G0jQAE/items/8024P000001gdBNQAY/pricing?cartId=8014P0000022G0jQAE&id=8024P000001gdBNQAY&fields=vlocity_cmt__OneTimeTotal__c" }, "remote": { "params": {} }, "client": { "records": [], "params": {} } } } ... } } ] }, "createCartAction": { "rest": { "params": { "cartContextKey": "20933d86217050b8d3b15654aeceae30" }, "link": "/v3/carts", "method": "createCartAction" } }, "errorCode": "INVOKE-200", "error": "OK" } ``` # MultiServiceAppHandler MultiServiceAppHandler is a wrapper for CpqAppHandler that automatically handles scaling for processing thousands of sites and orders. Use this class and its methods when processing multiple items for multiple sites. You can add a pre and post hook for MultiServiceAppHandler as you would for CpqAppHandler. See [Create Hooks for MultiServiceAppHandler](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-create-hooks-for-multiserviceapphandler.md). The methods are listed below in logical groups. | Method | Description | | --------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | | [getMasterCarts Method](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-getmastercarts-method.md) | Returns a list of master carts (quotes and orders) for an opportunity. | | [cloneMasterCart Method](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-clonemastercart-method.md) | Clones an existing master quote or order. It copies all groups and their members. It doesn’t copy Sub Quote/Order. | | [getGroups Method](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-getgroups-method.md) | Returns a list of groups under a Master/Enterprise (Mega) quote or order, specific for a member-type. | | [createNewGroup Method](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-createnewgroup-method.md) | Creates a new group (quote or order) with or without the corresponding Group Quote or Group Order record. | | [updateGroup Method](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-updategroup-method.md) | Updates the name and description of a group. | | [addToGroup Method](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-addtogroup-method.md) | Adds a service point to a group. | | [getObjectFieldsDescribe Method](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-getobjectfieldsdescribe-method.md) | For a given set of objects, returns all their fields and details, such as label, name, type, and others. | | [runCartValidation Method](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-runcartvalidation-method.md) | Runs the Industries CPQ Validate API on a sub quote. | | [priceCart Method](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-pricecart-method.md) | Runs Industries CPQ pricing API on sub quotes. | | [groupRollup Method](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-grouprollup-method.md) | Calculates the pricing rollups (OneTime, Recurring, Usage) for a group. | | [applyToGroup Method](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-applytogroup-method.md) | Starts the Apply to Group batch job for a group. | | [createOrderAndSubmit Method](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-createorderandsubmit-method.md) | Starts the checkout batch job for a group. | | [isAllGroupsValidatedAndPriced Method](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-isallgroupsvalidatedandpriced-method.md) | Checks if all groups are validated and priced successfully. This runs validate VIP. | | [updateExternalPricingStatus Method](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-updateexternalpricingstatus-method.md) | Updates the external pricing status of a master quote. | | [removeGroups Method](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-removegroups-method.md) | Deletes a list of groups and their members. | | [getGroupMembers Method](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-getgroupmembers-method.md) | Returns a set of paginated member-records within a group. | | [deleteMembers Method](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-deletemembers-method.md) | Deletes the selected members from one or multiple groups. | | [getUngroupedRecords Method](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-getungroupedrecords-method.md) | Returns a set of paginated non-members of a specific member type. | | [invokeBatchSerially Method](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-invokebatchserially-method.md) | Perform multiple batch operations (one after another) on a set of records. | | [getFieldList Method](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-getfieldlist-method.md) | Returns the configured fields in `FieldSet__c` for a specific feature name. | | [getMemberTypeList Method](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-getmembertypelist-method.md) | Returns a list of CPQ Member Type custom metadata. | | [refreshCartMSMessage Method](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-refreshcartmsmessage-method.md) | Regenerates all the messages of a group cart. | | [refreshGroupMSMessage Method](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-refreshgroupmsmessage-method.md) | Regenerates all the messages of a group. | | [cartRollup Method](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-cartrollup-method.md) | Responsible for cart rollups. | | [priceLineItems Method](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-pricelineitems-method.md) | Responsible for pricing the line items. | # Nonworking Days Configuration The non-working weekday configuration per the order specification. ## JSON example ```json { "nonWorkingDays": ["Saturday", "Sunday"] } ``` ## Properties | Property Name | Type | Description | Filter Group and Version | Available Version | | ---------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ | ----------------- | | `nonWorkingDays` | String[] | The list of weekdays that aren't working days per the order specification configuration. This list is empty when every day of the week is a working day. Values are Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, and Sunday. | Small, 68.0 | 68.0 | # Off Platform AWS Caching Digital Commerce has an AWS tier to use as a caching layer for API response caching. It uses the Redis cache for caching the data and runs Lambda instances. It also supports data migration from Salesforce persistent cache to the AWS cache tier. Versioning allows different versions of the products in different frames of time using two layers of cache. - The first layer contains a currently active response value cached with a cache key with a time to live (TTL) value of the expiration time of the cached response entry. - The second layer is a hashmap of the keys that are effective on a future date with the key as cacheKey_future. - The future cache keys are appended with the timeframes on which they become active. When there is a request made to the AWS tier, the system checks the Redis cache for an entry with that key. If found, the system returns the response. If the key is not found, or has exceeded the TTL, it checks for the key in the second layer (cachekey_future). This key contains the list of cacheKeys with future effectivity. From that, the system gets the currently effective key, caches it against the cacheKey, and returns in the response. If another request is made, the response is fetched from layer1 with the same cache key. ![Off Platform AWS Caching](https://developer.salesforce.com/docs/media/dc_awscaching.png) ## Cache Migration The Cache Migration feature allows the cache on SFDC to migrate to the AWS Redis cache. There are two main use cases for cache migration: - There is no cache on Redis and fresh cache data migrates from SFDC to AWS. - There is already cached data on Redis and data needs correcting because of changes in EPC. New cache is generated on SFDC. With versioning, there could be multiple instances of cache data with the same cache key but different effectivity dates. With two layers of caching, the effective cache in the current time frame overrides the earlier cache data with the same cache key. With the data having future effectivity and the same cache key, the timeframes are appended to the cache key and the record is cached with that cachekey. A hashmap is created (cacheKey_future) and adds the versioned cache key to the list. The versioned cache key overrides any existing cache key with the same future time frame dates. ![Off Platform AWS Caching - Cache Migration](https://developer.salesforce.com/docs/media/dc_cachemigration.png) # Offer Details API The Offer Details API takes an offer's ID as input and populates its details in the cache. The entry contains information about the product, such as its hierarchy, price-keys, attribute details, etc. You must execute this API for each product offerId that you received in the response from the Catalog Profile API. You can obtain the offerId required in the URI of this API from the combined result of the apiResponse.data.catalogProductRelationDetails.Product and apiResponse.data.catalogProductRelationDetails.Promotion nodes in the response body of the [Catalog Profile API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-catalog-profile-api.md). ## Precondition You must first run the [Catalog Profile API](/docs/commerce/commerce/guide/comms-t-catalog-profile-api.html) to obtain the offerId required in the request body of this API. ## URI /services/apexrest/{namespace}/v3/admin/catalogs/{catalogCode}/offers/{offerId}/offerdetails ## HTTP Method POST ## URI Parameters If you specify just one of these two parameters, it follows the behavior described in the table below and accepts your defined time for the parameter you specified. If you are using one or both parameters, you must specify them with the same values for all of the Populate Cache APIs in this sequence. | Parameter | Example | Default | Optional/Required | Notes | | ------------------ | ------------------- | ------------------------------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | effectiveStartTime | 2001-07-04T12:08:56 | Current date and time | Optional | effectiveStartTime is the time that you want your cached catalog entries to be effective. It should be in the UTC date-time format. Your effectiveStartTime must occur after the current time for which you are executing the Populate Cache APIs or you will receive an error message. | | expirationTime | 2001-07-04T12:08:56 | effectiveStartTime + TimeToLive | Optional | expirationTime is the time that you want your cached catalog entries to expire. It should also be in the UTC date-time format. Your expirationTime must occur after your effectiveStartTime or you receive an error message. TimeToLive is a custom setting created in CPQ Configuration Setup. It has a default value of 30 days. | Here is an example of how to pass the URI parameters: ```nolang GET /services/apexrest/vlocity_cmt/v3/admin/catalogs/AS-Test-Catalog/offerdetails?effectiveStartTime=2021-07-04T12:08:56&expirationTime=2021-08-04T12:08:56 ``` ## Remote API This is an example of how you invoke the API using Apex: ```nolang String methodName; String requestBodyJSON; Map input = new Map(); Map output = new Map(); Map options = new Map(); // Setting remote parameters methodName = 'getOfferDetails'; input.put('apiName', 'CMOfferDetails'); // required input.put('methodName', methodName); // required input.put('catalogCode', 'TestCatalog'); // required input.put('offerId', '01t4x000000x269AAA'); // required input.put('effectiveStartTime', null); // optional input.put('expirationTime', null); // optional input.put('requestURL', '/v3/admin/catalogs/{catalogCode}/offers/{offerId}/offerdetails'); //required //remote action invocation vlocity_cmt.CpqAppHandler appHandler = new vlocity_cmt.CpqAppHandler(); appHandler.invokeMethod(methodName, input, output, options); ``` ## Parallel Invocation You can run this API in parallel for multiple offers. For example, if there are 10 catalogs (Catalog1, Catalog2..Catalog 10) and each catalog has 100 offers, you can run this API for all 1,000 offers in parallel threads. ```nolang THREAD1 - POST /services/apexrest/{namespace}/v3/admin/catalogs/catalog1/offers/offer1/offerdetails THREAD2 - POST /services/apexrest/{namespace}/v3/admin/catalogs/catalog1/offers/offer2/offerdetails ...... THREAD100 - POST /services/apexrest/{namespace}/v3/admin/catalogs/catalog1/offers/offer100/offerdetails THREAD101 - POST /services/apexrest/{namespace}/v3/admin/catalogs/catalog2/offers/offer101/offerdetails ...... THREAD1000 - POST /services/apexrest/{namespace}/v3/admin/catalogs/catalog10/offers/offer1000/offerdetails ``` ## HTTP Headers | Header | Description | | ------------ | ---------------- | | Content-Type | application/json | ## Response Body This example contains an offer and its associated details. ``` { "offerDetails": { "offer": { "offerType": "Promotion", "childProducts": [ { "priceKeys": [ "01t5g000002vVZPAA2;;;a3D5g000000HAiNEAW", "01t5g000002vVZPAA2;;a3T5g000000CvgkEAC;a3D5g000000HAiNEAW" ], "IsActive": true, "pr_dc_002__IsOrderable__c": true, "pr_dc_002__EndOfLifeDate__c": null, "pr_dc_002__SellingEndDate__c": null, "pr_dc_002__SellingStartDate__c": null, "Description": null, "Id": "01t5g000002vVZPAA2", "AttributeCategory": { "records": [ { "productAttributes": { "records": [ { "userValues": null, "values": [ { "disabled": false, "readonly": false } ], "isNotTranslatable": false, "cloneable": true, "hidden": false, "hasRules": false, "displaySequence": 1, "label": "DateForBuyBack2", "attributeId": "a0X5g000000GZNkEAO", "filterable": true, "disabled": false, "readonly": false, "required": false, "multiselect": false, "cacheable": true, "inputType": "date", "dataType": "date", "code": "DateForBuyBack2" }, { "userValues": null, "values": [ { "disabled": false, "readonly": false } ], "isNotTranslatable": false, "cloneable": true, "hidden": false, "hasRules": false, "displaySequence": 1, "label": "DateTimeForDelivery2", "attributeId": "a0X5g000000GZNlEAO", "filterable": true, "disabled": false, "readonly": false, "required": false, "multiselect": false, "cacheable": true, "inputType": "datetime", "dataType": "datetime", "code": "DateTimeForDelivery2" } ], "totalSize": 2 }, "id": "a0W5g0000009UidEAE", "Name": "BASIC", "Code__c": "BASIC", "displaySequence": 1 }, { "productAttributes": { "records": [ { "userValues": null, "values": [ { "displaySequence": 1, "defaultSelected": false, "value": "false", "disabled": false, "readonly": false, "label": "false", "name": "8a8b4ef3-765a-6933-b99a-8d64dc2194a0", "id": "8a8b4ef3-765a-6933-b99a-8d64dc2194a0" }, { "displaySequence": 2, "defaultSelected": false, "value": "true", "disabled": false, "readonly": false, "label": "true", "name": "34c72160-5234-5a70-432b-e2382fcae4f5", "id": "34c72160-5234-5a70-432b-e2382fcae4f5" } ], "isNotTranslatable": false, "cloneable": true, "hidden": false, "hasRules": false, "displaySequence": 1, "label": "IsValueForMoney2", "attributeId": "a0X5g000000GZNmEAO", "filterable": true, "disabled": false, "readonly": false, "required": false, "multiselect": false, "cacheable": true, "inputType": "dropdown", "dataType": "text", "code": "IsValueForMoney2" }, { "userValues": null, "values": [ { "disabled": false, "readonly": false } ], "isNotTranslatable": false, "cloneable": true, "hidden": false, "hasRules": false, "displaySequence": 1, "label": "Networth2", "attributeId": "a0X5g000000GZNnEAO", "filterable": true, "disabled": false, "readonly": false, "required": false, "multiselect": false, "cacheable": true, "inputType": "number", "dataType": "currency", "code": "Networth2" }, { "userValues": null, "values": [ { "disabled": false, "readonly": false } ], "isNotTranslatable": false, "cloneable": true, "hidden": false, "hasRules": false, "displaySequence": 1, "label": "LikelhoodOfRecommendation2", "attributeId": "a0X5g000000GZNoEAO", "filterable": true, "disabled": false, "readonly": false, "required": false, "multiselect": false, "cacheable": true, "inputType": "number", "dataType": "percentage", "code": "LikelhoodOfRecommendation2" }, { "userValues": null, "values": [ { "disabled": false, "readonly": false } ], "isNotTranslatable": false, "cloneable": true, "hidden": false, "hasRules": false, "displaySequence": 1, "label": "Age2", "attributeId": "a0X5g000000GZNpEAO", "filterable": true, "disabled": false, "readonly": false, "required": false, "multiselect": false, "cacheable": true, "inputType": "number", "dataType": "number", "code": "Age2" }, { "userValues": false, "values": [ { "defaultValue": false, "disabled": false, "readonly": false } ], "isNotTranslatable": false, "cloneable": true, "hidden": false, "hasRules": false, "displaySequence": 1, "label": "NeedInsurance2", "attributeId": "a0X5g000000GZNqEAO", "filterable": true, "disabled": false, "readonly": false, "required": false, "multiselect": false, "cacheable": true, "inputType": "checkbox", "dataType": "text", "code": "NeedInsurance2" } ], "totalSize": 5 }, "id": "a0W5g0000009UieEAE", "Name": "SURVEY", "Code__c": "SURVEY", "displaySequence": 2 } ], "totalSize": 2 }, "Attachments": null, "lineNumber": "0001", "productHierarchyPath": "01t5g000002vVZPAA2", "groupMaxQuantity": 99999, "groupMinQuantity": 0, "maxQuantity": 2, "minQuantity": 0, "Quantity": 0, "PricebookEntryId": "01u5g000002n2RaAAI", "Product2Id": "01t5g000002vVZPAA2", "ProductCode": "T11_p_151", "Name": "T11_p_151" } ], "pr_dc_002__IsOrderable__c": true, "pr_dc_002__IsActive__c": true, "pr_dc_002__Code__c": "T11_promo151", "Name": "T11_promo151", "Id": "a3T5g000000CvgkEAC" } } } ``` ## HTTP Response Codes | Code | Description | | ---- | --------------------- | | 200 | OK | | 500 | Internal Server Error | # Offer Level Batch Jobs These types of batch jobs, for example, OfferDetails and Promotion Wrapper, cache information about a particular offer, such as a product or a promotion. ## Get Offers Item Batch Job The Get Offers Item batch job generates the offer profile data used in the response of the getOffers API. This job generates the offers profile including name, code, priceKeys, attachment URLs, etc., and any extra fields that are added as a part of API metadata. The system uses the versionInfo list populated by the versionInfo generator batch for a selected catalog with the list of offerIds (product, promotion, promotionItem) that are effective between a given start and end date. The offerProfile is calculated and cached with the version start and end date for a particular offer version. The offer profile for a product contains the details about the root offer, name, code, description, attribute category, etc. Details for a promotion offer type are populated for the promotion as well as the promotional products, not including its hierarchy. ![Get Offers Item Batch Job](https://developer.salesforce.com/docs/media/dc_getoffersitem_batchjob.png) ## GetPrices Batch Job This GetPrices batch job generates and caches the pricing information for a product or a promotional product. These products can be a part of the catalog or part of the hierarchy of a product bundle belonging to the catalog. This batch job generates the price results of all the products and promotions that are part of the catalog, iterating through each catalog product relationship and generating the price results of each. The cache keys are the priceKeys against which the information for the product or promotion is cached and includes productId as a part of the key. With versioning enabled, there can be different product versions with different priceListEntries for those between a selected start and end date. The batch job takes all the productIds, promotions, and promotionItemIds between the cache start and end dates, processes them, and caches the priceResults without pricing the same product twice but with different versions overlapping, so there is no inconsistent data. Each product version has its own Id, and priceKey contains the productId, so the versioning uptake in the priceResults are automatically included. ![GetPrices Batch Job](https://developer.salesforce.com/docs/media/dc_getprices_batchjob.png) ## GetContainsOffers Batch Job The getContainsOffers batch job generates the cache entries for use by the Contains API for all products in a catalog that are part of another product hierarchy or linked as promotional items to a promotion. The batch job works on the data profile of each catalog. With versioning enabled, the number of data profiles for a catalog equals the number of time slices. The catalog data profile changes according to the time slice. During the initialization phase, the first time slice is fetched and then the catalog data profile for each time slice is treated as input for the execution phase of the batch job. In the execution phase for each time slice, the list product versions for the CPRs are processed to get the list of offers that contain a particular product version. The response is then created and populated by calculating the eligibility for each context dimension, paginated, and sorted. ![GetContainsOffers Batch Job](https://developer.salesforce.com/docs/media/dc_getcontainsoffers_batchjob.png) ## Hierarchy Batch Job The Hierarchy batch job caches the flat hierarchy of the products and promotional products associated with the catalog. This offerDetails batch uses this information to compute the details of the full hierarchy, including its child products, virtual products, promotional item overrides, offer overrides, etc. With versioning enabled, there can be multiple versions of the child products for a version of its parent and vice-versa. The hierarchy level batch job caches the flat hierarchy of the catalog products, generates the time slices for that offer, and caches the hierarchy with the effectivity of the time slice. The offer level time-slicing applies to the hierarchy results. The batch job first queries and gets the version info list from the cache, then gets the time slices from the data store object for each productId. The data store object has the effective start and end time to represent the time slice times for that offer. For each time slice, the batch job generates the flat hierarchy by filtering out orphaned child products and products that are in the draft state (not in the released state). If the restructuring of the time slices is required after the filtration of orphans and draft products, the system restructures, generates, and caches the hierarchy according to the offer time slice. ![Hierarchy Batch Job](https://developer.salesforce.com/docs/media/dc_hierarchy_batchjob.png) ## PromotionWrapper Batch Job The promotion wrapper batch job generates the in-memory details of simple promotions, such as line items associated with promotions and adjustment details. With versioning applied, you can have different promotion items for the same product for a given time slice, depending on the product version linked to the promotion. The hierarchy of the promotion items with their changes for line items is populated based on the time slice information. For a given promotion, the number of records generated equals the number of time slices. ![PromotionWrapper Batch Job](https://developer.salesforce.com/docs/media/dc_promotionwrapper_batchjob.png) ## GetOfferDetails Batch Job The getOfferDetails batch job creates and caches the details of all the product offers and promotions in the catalog. This batch job generates details for the offer and the associated offer. For products, this batch job generates details for the root offer and any child products associated with the root offer for the full hierarchy. For promotions, this batch job generates details for the complete hierarchy of the promotional item. With versioning enabled, when getting and processing the input records, each time slice can include different versions of the product. The number of batches for a product equals the number of time slices. For a given catalog, the total number of batches that run equals the number of catalog product relationships multiplied by the number of time slices. While populating the input record, the time slice effective date is stored and eventually used as the effective date for the cache entry for that version of the product. The details generated for an offer remain the same but are generated for each version of the product. Details for promotions include the version of the promotion item. ![GetOfferDetails Batch Job](https://developer.salesforce.com/docs/media/dc_offerdetails_batchjob.png) # Offers APIs The Digital Commerce APIs are optimized for consumer shopping use cases where the user may be anonymous until well into the check-out process. These APIs are also optimized to enable caching of API responses to provide performance enhancements and scalability. These APIs are also optimized for lower bandwidth connections between the client app and the server by minimizing the metadata returned in the response. The Digital Commerce APIs are provided in addition to the Industries Cart-based APIs. The Cart-based APIs are optimized for highly interactive cart operations by contact center agents and sales reps using an editor such as the Industries Cart UI. Therefore, Cart-based APIs provide more metadata to the client browser enabling a wide array of operations. Both the Cart-based CPQ APIs and the Digital Commerce APIs are supported and actively enhanced. The Digital Commerce APIs are not intended to replace the Cart-based APIs. All the Vlocity Omnichannel REST APIs simplify client app development by hiding the details of internal CPQ processing. Client-side developers do not need to understand details of the underlying CPQ logic or need to know the proper order to apply eligibility and availability rules. ## GetOffers The GetOffers API returns the list of qualified offers in a catalog for the passed context input. The response behavior for the logged-in user and anonymous users is different. For anonymous users, only the qualified offers are returned in the response. For logged-in users, all the offers are returned but with a qualification node on it stating whether the offer is qualified or not qualified for the context shape derived from the account and contract ID passed in the input request URL. The cache warmup batch jobs only populate the qualified list data for the anonymous users for the generated context combinations by taking the values for caching for the context dimensions having the cacheable mode set as true. The batch jobs also consider the context values defined in the rule conditions. If a context value is passed that has not been cached or the request is first made for a logged-in user having a context key that has not yet been encountered, a cache miss scenario occurs and the response is generated at run-time and cached. The cache miss scenario uses the time-sliced catalog data profile currently effective in the cache. That profile contains the list of exact offer versions under the currently effective catalog. The context eligibility maps are calculated and the prices and offers profile are stitched together. The data is cached with the effectiveness of that time slice. A cache hit scenario where the cacheKey is found in the cache includes the currently active version. Even though the cache key is the same, the version effectivity is different because of the different effective start and end time of the cache entry. At any given point in time, only one version of the cache is effective, with no overlaps, so there is no change in the computation of the cache key. The priceResults and offers profile for the offers are populated by the cache initialization batch jobs. At run-time, the batch jobs only stitch the already cached data and calculate only the eligibility maps or qualified list. Only the offers with a lifecycle status of Released are present in the response. ![GetOffers API](https://developer.salesforce.com/docs/media/dc_getoffers_api.png) ## GetContainsOffers The GetContainsOffers API finds the offers that contain a particular product in its hierarchy. For the cache miss scenario, the time slice information is fetched based on the current date. For that particular time slice, the containsOffer information is populated, cached, and returned. The response contains the offer with the version of the product for the time slice based on the current date. ![GetContainsOffers API](https://developer.salesforce.com/docs/media/dc_getcontainsoffers_api.png) ## GetOfferDetails The GetOfferDetails API gets the details of an offer (product or promotion) from a specified catalog. The offer details generated are the complete details of the product and its hierarchy (if the offer is a product) or the details of the promotion and its promotional items along with the full hierarchy of the promotional item. The response contains detailed information about all the child products. For anonymous users, the default pricing defined at admin-time is considered. For logged-in users, the tightest match prices are computed and added in the response. The prices are cached separately and are stitched to the root and child products at runtime using price keys as the slot. Price keys are generated using the product, promotion, offer, and price list IDs. These are also used when generating price keys during getPrices batch job. For anonymous users, the price results are agnostic of the context of the user and consist of only the base prices and adjustments without honouring any qualifying context rules association. For logged-in users, weights and qualifying rules on the PLEs are honoured and price results are computed and cached. The cache key is generated using the offer code and the user context. The cache entry is checked for validity in the current time frame for that cache key. If the cache key is found, it becomes a cache hit scenario and price details are added at runtime. If price results for an offer in the hierarchy are not found, an error occurs and states that no price results were found. For a logged-in user, the cache miss for offer details is processed using the hierarchyResult as the list of child products. If the price results are not found in the cache at run time, then they are generated and cached separately. The tightest match pricing runs with the reference date time as the current time. Price list entries and rules that are valid in the current time frame are considered in the pricing. Offer details are cached with the same effectivity as the current time slice effectivity. The current offer version is derived from the offer version details already cached by the version info generator batch job. The current hierarchy is cached as generated by the hierarchy result batch jobs. The cache miss for offer details applies to all the offers in the hierarchy for the parent. ![GetOfferDetails API](https://developer.salesforce.com/docs/media/dc_getofferdetails_api.png) ## Configure Offer The configureOffer API lets a user configure a product bundle before adding items to the basket. In a single transaction, users can update the quantity, change attributes, and add a child product by changing the quantity. All the advanced rules, pricing rules, matrix-based pricing, etc. work in the configure API to generate the response. The input to the API is the offerDetails response for that offer and the updated quantity or attributes. With versioning enabled for an offer code in different frames of time, there can be different versions of the offer details. Therefore, the validation services check whether the current offerVersion configuration in the input is valid in the current time frame. To check for the version effectivity in the response of the getOfferDetails, time slice information is attached that mainly includes time slice effectivity start time, time slice effectivity, and end time to determine the effectivity of the input configuration. The validation service also checks cardinality and version. The system creates the XLIs using the offer details configuration that was passed. Validation and pricing run with the reference dates as the current date-time. The generated response is cached with the effectivity of the time slice of that offer detail. ![configureOffer API](https://developer.salesforce.com/docs/media/dc_configoffer_api.png) # Offers Item API The Offers Item API generates the details of an offer passed in the API request body. You can obtain the list of offers for this API from the response body of the [Catalog Profile API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-catalog-profile-api.md). To get the full list of offers for this catalog, fetch the two lists under `apiResponse.data.catalogProductRelationDetails.Promotion` and `apiResponse.data.catalogProductRelationDetails.Product` and merge them. Pass no more than 20 offers at a time to the API to avoid reaching Salesforce governor limits. ## Precondition You must first run the [Catalog Profile API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-catalog-profile-api.md) to obtain the list of offers for this API. ## URI /services/apexrest/{namespace}/v3/admin/catalogs/{catalogCode}/offersitem ## HTTP Method POST ## URI Parameters If you specify just one of these two parameters, it follows the behavior described in the table below and accepts your defined time for the parameter you specified. If you are using one or both parameters, you must specify them with the same values for all of the Populate Cache APIs in this sequence. | Parameter | Example | Default | Optional/Required | Notes | | ------------------ | ------------------- | ------------------------------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | effectiveStartTime | 2001-07-04T12:08:56 | Current date and time | Optional | effectiveStartTime is the time that you want your cached catalog entries to be effective. It should be in the UTC date-time format. Your effectiveStartTime must occur after the current time for which you are executing the Populate Cache APIs or you will receive an error message. | | expirationTime | 2001-07-04T12:08:56 | effectiveStartTime + TimeToLive | Optional | expirationTime is the time that you want your cached catalog entries to expire. It should also be in the UTC date-time format. Your expirationTime must occur after your effectiveStartTime or you receive an error message. TimeToLive is a custom setting created in CPQ Configuration Setup. It has a default value of 30 days. | Here is an example of how to pass the URI parameters: ```nolang GET /services/apexrest/vlocity_cmt/v3/admin/catalogs/AS-Test-Catalog/offersitem?effectiveStartTime=2021-07-04T12:08:56&expirationTime=2021-08-04T12:08:56 ``` ## Request Body Parameters | Parameter | Data Type | Description | Default | Optional/Required | | --------- | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | ----------------- | | offerIds | List of strings | The list of offer IDs in this catalog for which you populate the offers item cache. You can obtain the list of offers for this API from the response body of the [Catalog Profile API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-catalog-profile-api.md). | N/A | Required | ## Sample Request Body This is a sample request for offerIds. ```nolang { "offerIds": [ "01t4x000000wx2vAAA", "01t4x000000wx2wAAA", "01t4x000000wx2xAAA", "01t4x000000wx2yAAA", "01t4x000000wx2zAAA", "01t4x000000wx30AAA", "01t4x000000wx31AAA", "a3T4x000000l39BEAQ", "a3T4x000000l39CEAQ" ] } ``` ## Remote API This is an example of how you invoke the API using Apex: ```nolang String methodName; String requestBodyJSON; Map input = new Map(); Map output = new Map(); Map options = new Map(); // Setting remote parameters methodName = 'getOffersItem'; requestBodyJSON = '{"offerIds":["01t5w00000FbI08AAF"]}'; input.put('apiName', 'CMOffersItem'); // required input.put('methodName', methodName); // required input.put('catalogCode', 'TestCatalog'); // required input.put('requestBody', requestBodyJSON); // required input.put('effectiveStartTime', null); // optional input.put('expirationTime', null); // optional input.put('requestURL', '/v3/admin/catalogs/TestCatalog/offersitem'); //required //remote action invocation vlocity_cmt.CpqAppHandler appHandler = new vlocity_cmt.CpqAppHandler(); appHandler.invokeMethod(methodName, input, output, options); ``` ## Parallel Invocation Each item profile in getOffers API can be processed in parallel. For example, if there are 10 catalogs with 200 offers each, then each of these 2,000 items can be populated in parallel using 2,000 threads. This API can also take a list of offers to reduce the number of API calls. ```nolang THREAD1 - POST /services/apexrest/{namespace}/v3/admin/catalogs/catalog1/offersitem THREAD2 - POST /services/apexrest/{namespace}/v3/admin/catalogs/catalog1/offersitem ... THREAD200 - POST /services/apexrest/{namespace}/v3/admin/catalogs/catalog1/offersitem THREAD201 - POST /services/apexrest/{namespace}/v3/admin/catalogs/catalog2/offersitem ...... THREAD2000 - POST /services/apexrest/{namespace}/v3/admin/catalogs/catalog10/offersitem ``` ## HTTP Headers | Header | Description | | ------------ | ---------------- | | Content-Type | application/json | ## Response Body This example contains a list of offers and their details. ``` { "priceListId": "a3D5g000000HAiIEAW", "offerType": "Product", "Attachments": null, "AttributeCategory": { "BASIC": [ { "$$AttributeDefinitionEnd$$": null, "attributeRunTimeInfo": { "uiDisplayType": "Single Value", "dataType": "Date" }, "isnotassetizable__c": false, "attributegrouptype__c": null, "valuedescription__c": null, "valuedatatype__c": "Date", "value__c": null, "uidisplaytype__c": "Single Value", "rulemessage__c": null, "isrequired__c": false, "id": "a245g000000cEJTAA2", "querylabel__c": null, "isquerydriven__c": false, "isnottranslatable__c": false, "isreadonly__c": false, "querycode__c": null, "objecttype__c": null, "valueinnumber__c": null, "ishidden__c": false, "isconfigurable__c": true, "hasrule__c": false, "formatmask__c": null, "customconfiguitemplate__c": null, "categorydisplaysequence__c": 1, "displaysequence__c": null, "attributedisplayname__c": "DateForBuyBack2", "isactive__c": true, "attributecloneable__c": true, "attributefilterable__c": true, "attributedisplaysequence__c": "1", "attributeconfigurable__c": true, "attributeuniquecode__c": "DateForBuyBack2", "categoryname__c": "BASIC", "categorycode__c": "BASIC", "attributecategoryid__c": "a0W5g0000009UidEAE", "attributeid__c": "a0X5g000000GZNkEAO", "objectid__c": "01t5g000002vVUuAAM", "$$AttributeDefinitionStart$$": null }, { "$$AttributeDefinitionEnd$$": null, "attributeRunTimeInfo": { "uiDisplayType": "Single Value", "dataType": "Datetime" }, "isnotassetizable__c": false, "attributegrouptype__c": null, "valuedescription__c": null, "valuedatatype__c": "Datetime", "value__c": null, "uidisplaytype__c": "Single Value", "rulemessage__c": null, "isrequired__c": false, "id": "a245g000000cEJUAA2", "querylabel__c": null, "isquerydriven__c": false, "isnottranslatable__c": false, "isreadonly__c": false, "querycode__c": null, "objecttype__c": null, "valueinnumber__c": null, "ishidden__c": false, "isconfigurable__c": true, "hasrule__c": false, "formatmask__c": null, "customconfiguitemplate__c": null, "categorydisplaysequence__c": 1, "displaysequence__c": null, "attributedisplayname__c": "DateTimeForDelivery2", "isactive__c": true, "attributecloneable__c": true, "attributefilterable__c": true, "attributedisplaysequence__c": "1", "attributeconfigurable__c": true, "attributeuniquecode__c": "DateTimeForDelivery2", "categoryname__c": "BASIC", "categorycode__c": "BASIC", "attributecategoryid__c": "a0W5g0000009UidEAE", "attributeid__c": "a0X5g000000GZNlEAO", "objectid__c": "01t5g000002vVUuAAM", "$$AttributeDefinitionStart$$": null } ], "SURVEY": [ { "$$AttributeDefinitionEnd$$": null, "attributeRunTimeInfo": { "default": [], "values": [ { "value": "false", "sequence": 1, "id": "8a8b4ef3-765a-6933-b99a-8d64dc2194a0", "displayText": "false" }, { "value": "true", "sequence": 2, "id": "34c72160-5234-5a70-432b-e2382fcae4f5", "displayText": "true" } ], "uiDisplayType": "Dropdown", "dataType": "Picklist" }, "isnotassetizable__c": false, "attributegrouptype__c": null, "valuedescription__c": null, "valuedatatype__c": "Picklist", "value__c": null, "uidisplaytype__c": "Dropdown", "rulemessage__c": null, "isrequired__c": false, "id": "a245g000000cEJSAA2", "querylabel__c": null, "isquerydriven__c": false, "isnottranslatable__c": false, "isreadonly__c": false, "querycode__c": null, "objecttype__c": null, "valueinnumber__c": null, "ishidden__c": false, "isconfigurable__c": true, "hasrule__c": false, "formatmask__c": null, "customconfiguitemplate__c": null, "categorydisplaysequence__c": 2, "displaysequence__c": null, "attributedisplayname__c": "IsValueForMoney2", "isactive__c": true, "attributecloneable__c": true, "attributefilterable__c": true, "attributedisplaysequence__c": "1", "attributeconfigurable__c": true, "attributeuniquecode__c": "IsValueForMoney2", "categoryname__c": "SURVEY", "categorycode__c": "SURVEY", "attributecategoryid__c": "a0W5g0000009UieEAE", "attributeid__c": "a0X5g000000GZNmEAO", "objectid__c": "01t5g000002vVUuAAM", "$$AttributeDefinitionStart$$": null }, { "$$AttributeDefinitionEnd$$": null, "attributeRunTimeInfo": { "uiDisplayType": "Single Value", "dataType": "Currency" }, "isnotassetizable__c": false, "attributegrouptype__c": null, "valuedescription__c": null, "valuedatatype__c": "Currency", "value__c": null, "uidisplaytype__c": "Single Value", "rulemessage__c": null, "isrequired__c": false, "id": "a245g000000cEJVAA2", "querylabel__c": null, "isquerydriven__c": false, "isnottranslatable__c": false, "isreadonly__c": false, "querycode__c": null, "objecttype__c": null, "valueinnumber__c": null, "ishidden__c": false, "isconfigurable__c": true, "hasrule__c": false, "formatmask__c": null, "customconfiguitemplate__c": null, "categorydisplaysequence__c": 2, "displaysequence__c": null, "attributedisplayname__c": "Networth2", "isactive__c": true, "attributecloneable__c": true, "attributefilterable__c": true, "attributedisplaysequence__c": "1", "attributeconfigurable__c": true, "attributeuniquecode__c": "Networth2", "categoryname__c": "SURVEY", "categorycode__c": "SURVEY", "attributecategoryid__c": "a0W5g0000009UieEAE", "attributeid__c": "a0X5g000000GZNnEAO", "objectid__c": "01t5g000002vVUuAAM", "$$AttributeDefinitionStart$$": null }, { "$$AttributeDefinitionEnd$$": null, "attributeRunTimeInfo": { "uiDisplayType": "Single Value", "dataType": "Percent" }, "isnotassetizable__c": false, "attributegrouptype__c": null, "valuedescription__c": null, "valuedatatype__c": "Percent", "value__c": null, "uidisplaytype__c": "Single Value", "rulemessage__c": null, "isrequired__c": false, "id": "a245g000000cEJWAA2", "querylabel__c": null, "isquerydriven__c": false, "isnottranslatable__c": false, "isreadonly__c": false, "querycode__c": null, "objecttype__c": null, "valueinnumber__c": null, "ishidden__c": false, "isconfigurable__c": true, "hasrule__c": false, "formatmask__c": null, "customconfiguitemplate__c": null, "categorydisplaysequence__c": 2, "displaysequence__c": null, "attributedisplayname__c": "LikelhoodOfRecommendation2", "isactive__c": true, "attributecloneable__c": true, "attributefilterable__c": true, "attributedisplaysequence__c": "1", "attributeconfigurable__c": true, "attributeuniquecode__c": "LikelhoodOfRecommendation2", "categoryname__c": "SURVEY", "categorycode__c": "SURVEY", "attributecategoryid__c": "a0W5g0000009UieEAE", "attributeid__c": "a0X5g000000GZNoEAO", "objectid__c": "01t5g000002vVUuAAM", "$$AttributeDefinitionStart$$": null }, { "$$AttributeDefinitionEnd$$": null, "attributeRunTimeInfo": { "uiDisplayType": "Single Value", "dataType": "Number" }, "isnotassetizable__c": false, "attributegrouptype__c": null, "valuedescription__c": null, "valuedatatype__c": "Number", "value__c": null, "uidisplaytype__c": "Single Value", "rulemessage__c": null, "isrequired__c": false, "id": "a245g000000cEJXAA2", "querylabel__c": null, "isquerydriven__c": false, "isnottranslatable__c": false, "isreadonly__c": false, "querycode__c": null, "objecttype__c": null, "valueinnumber__c": null, "ishidden__c": false, "isconfigurable__c": true, "hasrule__c": false, "formatmask__c": null, "customconfiguitemplate__c": null, "categorydisplaysequence__c": 2, "displaysequence__c": null, "attributedisplayname__c": "Age2", "isactive__c": true, "attributecloneable__c": true, "attributefilterable__c": true, "attributedisplaysequence__c": "1", "attributeconfigurable__c": true, "attributeuniquecode__c": "Age2", "categoryname__c": "SURVEY", "categorycode__c": "SURVEY", "attributecategoryid__c": "a0W5g0000009UieEAE", "attributeid__c": "a0X5g000000GZNpEAO", "objectid__c": "01t5g000002vVUuAAM", "$$AttributeDefinitionStart$$": null }, { "$$AttributeDefinitionEnd$$": null, "attributeRunTimeInfo": { "default": false, "uiDisplayType": "Single Value", "dataType": "Checkbox" }, "isnotassetizable__c": false, "attributegrouptype__c": null, "valuedescription__c": null, "valuedatatype__c": "Checkbox", "value__c": null, "uidisplaytype__c": "Single Value", "rulemessage__c": null, "isrequired__c": false, "id": "a245g000000cEJYAA2", "querylabel__c": null, "isquerydriven__c": false, "isnottranslatable__c": false, "isreadonly__c": false, "querycode__c": null, "objecttype__c": null, "valueinnumber__c": null, "ishidden__c": false, "isconfigurable__c": true, "hasrule__c": false, "formatmask__c": null, "customconfiguitemplate__c": null, "categorydisplaysequence__c": 2, "displaysequence__c": null, "attributedisplayname__c": "NeedInsurance2", "isactive__c": true, "attributecloneable__c": true, "attributefilterable__c": true, "attributedisplaysequence__c": "1", "attributeconfigurable__c": true, "attributeuniquecode__c": "NeedInsurance2", "categoryname__c": "SURVEY", "categorycode__c": "SURVEY", "attributecategoryid__c": "a0W5g0000009UieEAE", "attributeid__c": "a0X5g000000GZNqEAO", "objectid__c": "01t5g000002vVUuAAM", "$$AttributeDefinitionStart$$": null } ] }, "IsActive": true, "pr_dc_002__IsOrderable__c": true, "ProductCode": "T10_p_21", "Name": "T10_p_21", "Id": "01t5g000002vVUuAAM" } ``` ## HTTP Response Codes | Code | Description | | ---- | --------------------- | | 200 | OK | | 500 | Internal Server Error | # Offers List API The Offers List API paginates the list of eligible offers for a context combination and ensures the sequence of those offers on each page and the order of pages remain the same for every run of the getOffers API. The ctxEligibilityCacheKey must be passed in the request body of this API. You can obtain the ctxEligibilityCacheKey required in the request body from the apiResponse.eligibilityContextKey node in the response body of the [Context Eligibility API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-context-eligibility-api.md). ## Precondition You must first the [Context Eligibility API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-context-eligibility-api.md) to obtain the ctxEligibilityCacheKey required in the request body of this API. ## URI /services/apexrest/{namespace}/v3/admin/catalogs/{catalogCode}/offers ## HTTP Method POST ## URI Parameters If you specify just one of these two parameters, it follows the behavior described in the table below and accepts your defined time for the parameter you specified. If you are using one or both parameters, you must specify them with the same values for all of the Populate Cache APIs in this sequence. | Parameter | Example | Default | Optional/Required | Notes | | ------------------ | ------------------- | ------------------------------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | effectiveStartTime | 2001-07-04T12:08:56 | Current date and time | Optional | effectiveStartTime is the time that you want your cached catalog entries to be effective. It should be in the UTC date-time format. Your effectiveStartTime must occur after the current time for which you are executing the Populate Cache APIs or you will receive an error message. | | expirationTime | 2001-07-04T12:08:56 | effectiveStartTime + TimeToLive | Optional | expirationTime is the time that you want your cached catalog entries to expire. It should also be in the UTC date-time format. Your expirationTime must occur after your effectiveStartTime or you receive an error message. TimeToLive is a custom setting created in CPQ Configuration Setup. It has a default value of 30 days. | Here is an example of how to pass the URI parameters: ```nolang GET /services/apexrest/vlocity_cmt/v3/admin/catalogs/AS-Test-Catalog/offers?effectiveStartTime=2021-07-04T12:08:56&expirationTime=2021-08-04T12:08:56 ``` ## Request Body Parameters | Parameter | Data Type | Description | Default | Optional/Required | | ---------------------- | --------- | -------------------------------------------------------------------------- | ------- | ----------------- | | ctxEligibilityCacheKey | String | Cache key pointing to the context eligibility record to sort and paginate. | N/A | Required | ## Sample Request Body This is a sample request for a context eligibility cache key (ctxEligibilityCacheKey). ```nolang { "ctxEligibilityCacheKey": "418744a77cd0344bcc501f2ed72aa920" } ``` ## Remote API This is an example of how you invoke the API using Apex: ```nolang String methodName; String requestBodyJSON; Map input = new Map(); Map output = new Map(); Map options = new Map(); // Setting remote parameters methodName = 'getOffers'; requestBodyJSON = '{"ctxEligibilityCacheKey":"418744a77cd0344bcc501f2ed72aa920"}'; input.put('apiName','CMOffers'); //required input.put('catalogCode', 'TestCatalog'); //required input.put('effectiveStartTime', null); //optional input.put('expirationTime', null); //optional input.put('requestBody', requestBodyJSON); //required input.put('methodName',methodName); //required input.put('requestURL', '/v3/admin/catalogs/TestCatalog/offers'); //required //remote action invocation vlocity_cmt.CpqAppHandler appHandler = new vlocity_cmt.CpqAppHandler(); appHandler.invokeMethod(methodName, input, output, options); ``` ## Parallel Invocation Each context eligibility result can be processed in parallel. For example, if there are 10 catalogs and each catalog links to 12 context eligibility results, then all 120 results can run in parallel. ```nolang THREAD1 - POST /services/apexrest/{namespace}/v3/admin/catalogs/catalog1/offers THREAD2 - POST /services/apexrest/{namespace}/v3/admin/catalogs/catalog1/offers ... THREAD12 - POST /services/apexrest/{namespace}/v3/admin/catalogs/catalog1/offers THREAD13 - POST /services/apexrest/{namespace}/v3/admin/catalogs/catalog2/offers ...... THREAD120 - POST /services/apexrest/{namespace}/v3/admin/catalogs/catalog10/offers ``` ## HTTP Headers | Header | Description | | ------------ | ---------------- | | Content-Type | application/json | ## Response Body This example shows a list of eligible offers for a context combination in the correct sequence and order of pages. ``` { "nextOffersAction": { "rest": { "params": {}, "method": "GET", "link": "/v3/catalogs/T9_cache_mgmt/offers?context={\"DIM_0\":\"V_0_2\",\"DIM_1\":\"V_1_1\",\"DIM_2\":\"V_2_2\",\"DIM_3\":\"V_3_1\",\"DIM_4\":\"V_4_2\"}&offset=100&pagesize=20" }, "remote": { "params": {} }, "client": { "records": [], "params": {} } }, "result": { "Promotion": [ "a3T5g000000CvcvEAC", "a3T5g000000Cvd0EAC", "a3T5g000000Cvd1EAC" ], "Product": [ "01t5g000002vVUIAA2", "01t5g000002vVUJAA2", "01t5g000002vVUKAA2", "01t5g000002vVULAA2", "01t5g000002vVUMAA2", "01t5g000002vVUNAA2", "01t5g000002vVUOAA2", "01t5g000002vVUPAA2", "01t5g000002vVUQAA2", "01t5g000002vVURAA2", "01t5g000002vVUSAA2", "01t5g000002vVUTAA2", "01t5g000002vVUUAA2", "01t5g000002vVUVAA2", "01t5g000002vVUWAA2", "01t5g000002vVUXAA2", "01t5g000002vVUYAA2" ] } } ``` ## HTTP Response Codes | Code | Description | | ---- | --------------------- | | 200 | OK | | 500 | Internal Server Error | # Open the Orchestrator Folder in Your IDE After you’ve downloaded the orchestrator classes, the next step is to load them into your IDE. Each IDE works differently. In Visual Studio Code, opening a folder that contains Java classes automatically creates a project. 1. In Visual Studio Code, select **File > Open** from the menu. 2. Locate and select the **cache_and_populate_orchestrators** folder, which contains the orchestrator classes. 3. Click **Open**. 4. Click the Explorer icon and expand the MAVEN pane. 5. In the MAVEN pane, right-click the **populateCache** file and select **install**. [Run the PopulateCacheOrchestratorApplication Class](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-run-the-populatecacheorchestratorapplication-class.md) # Optimize the Cache Catalog Product Definition Job Use the Cache Management API to speed up the Cache Catalog Product Definition job. If your org is running the CME 240.9 package, run the following prerequisite steps: 1. Create the following Apex class. For information on creating Apex classes, see [Define Apex Classes](https://help.salesforce.com/s/articleView?id=sf.code_define_package.htm&type=5). ``` global class CustomCacheDataImplementation implements vlocity_cmt.VlocityOpenInterface { private vlocity_cmt.VOIInvoker invoker = vlocity_cmt.VOIInvoker.getInstance(); private vlocity_cmt.VlocityOpenInterface voi = (vlocity_cmt.VlocityOpenInterface)invoker.invoke('DefaultGetCacheDataImplementation', 'debugCreate', null, null, null); global Boolean invokeMethod(String methodName, Map input, Map output, Map options) { normalizeApiName(); voi.invokeMethod(methodName ,input, output, options); return true; } private void normalizeApiName() { if(vlocity_cmt.FlowStaticMap.flowMap.get('apiName') != null) { String apiName = (String) vlocity_cmt.FlowStaticMap.flowMap.get('apiName'); switch on apiName { when 'getOffers'{ vlocity_cmt.FlowStaticMap.flowMap.put('apiName','GetOffers'); } when 'getOfferDetails' { vlocity_cmt.FlowStaticMap.flowMap.put('apiName','GetOfferDetails'); } when 'getContainOffers'{ vlocity_cmt.FlowStaticMap.flowMap.put('apiName','GetContainOffers'); } } } } } ``` 2. Create an Interface Implementation. - Interface Name: `GetCacheData` - Active Implementation Class: `CustomCacheDataImplementation` 3. For the Interface Implementation, create an Interface Implementation Detail with the Available Implementation of `CustomCacheDataImplementation`. Optimize the Cache Catalog Product Definition job. 1. Click the ![Gear](https://developer.salesforce.com/docs/media/gear_1.png) icon and then **Developer Console**. 2. Create a configuration snapshot. ``` vlocity_cmt.TelcoAdminConsoleController controller = new vlocity_cmt.TelcoAdminConsoleController(); Map input = new Map(); input.put('startDateTime', DateTime.now().format()); input.put('endDateTime', DateTime.now().addDays(30).format()); controller.invokeMethod('createConfigurationSnapshot',input); ``` 3. Populate the cache for the getOfferDetails and getOffersByCatalogCodeAPIs by running steps 1 - 8 in [Workflow for Using the Cache Management API Sample Orchestrator](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-workflow-for-using-the-cache-management-api-sample-orchestrator-.md). 4. Activate the configuration snapshot. ``` vlocity_cmt.TelcoAdminConsoleController controller = new vlocity_cmt.TelcoAdminConsoleController(); Map input = new Map(); controller.invokeMethod('activateConfigurationSnapshot',input); ``` If you see any errors when populating the cache, you can abort the process. ``` vlocity_cmt.TelcoAdminConsoleController controller = new vlocity_cmt.TelcoAdminConsoleController(); Map input = new Map(); controller.invokeMethod('abortConfigurationSnapshot',input); ``` **important:** To optimize the Cache Catalog Product Definition Job's operation and prevent any errors, it is recommended to ensure that all promotions in the catalog are active and orderable. # Optimized Configurations and Settings for Maximum Performance These configurations and best practices enhance performance. The listed impact applies to OOTB packages, but customizations may affect results. Evaluate functional and implementation outcomes before making any changes. ## CPQ Performance Best Practices | Implementation | Performance
Impact
| | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [Calculation Matrices Cache](https://help.salesforce.com/s/articleView?id=ind.comms_set_up_cache_for_calculation_matrices_for_performance.htm&type=5) | For better performance, when using Attribute Based Pricing, create a custom partition for caching calculation matrices. Please refer to the link on the left | | UOW Mode: True | Default is True starting Spring '21 releaseOverview - If set to true, enables Unit of Work performance enhancements that save DMLs and SOQL statements when making Cart-Based API calls
Impact - CPQ APIs have shown up good improvement with this mode on (the impact varies based on the complexity of use case). | | [V2 JSON/V2 AttributeModel:](https://help.salesforce.com/s/articleView?id=ind.v_admin_upgrading_the_attribute_schema_25922.htm&type=5) Enabled (Feature) | Overview - `JSONAttributeSupport` is a service implementation that enables users to apply multiple types of actions to the attributes JSON string
Impact - DB Storage usage is lesser with V2 Json model enable | | [CME Custom Indexes](https://help.salesforce.com/s/articleView?id=ind.comms_required_indexes_for_vlocity_cpq_implementations.htm&type=5): Applied | Overview - All CME customers should install custom indexes in their organisation during install. Therefore, if you are implementing Vlocity CPQ, you will need to add the following recommended indexes to support the related CPQ objects. [Complete list of Custom Indexes to be applied](https://help.salesforce.com/s/articleView?id=ind.comms_required_indexes_for_vlocity_cpq_implementations.htm&type=5)
Impact - Performance Gain | | For using Cart-based APIs
Pricing: false
Validate: false
| Overview - A flag which describes if the pricing & validation should be run in createCart api. If price is true, it runs pricing on the created cart. If price is false, it does not run pricing on the created cart. Similarly for Validate. Default value is true.
Impact - Performance gain for CreateCart API if Price and Validate is false. | | GUID (UseAssetReferenceIdForParentAndRoot) | Default is True starting Spring '21 release for new installations. Otherwise Default is False. Overview : If set to true, enables performance enhancements that save data manipulation language (DML) statements in Add-to-Cart and other transactions.
Impact : CPQ APIs have shown up good improvement with this mode on (the impact varies based on the complexity of use case). | | CachedQueryMode: True | Overview - Vlocity caching: If set to true, uses output from queries in the CacheQueryStore. If set to false, queries directly from the database. Default is false.
Impact : Performance improvement for most of the Cart API as queries get response from DB | | LevelBasedApproach: True | Overview - If set to true, APIs return root and first-level children in product hierarchy. Next level are returned when user clicks expand icon on product
Impact - Perform better for product bundle with Depth > 2 | | CacheAPI.SkinnyBasket: True | Overview - When CacheAPI.SkinnyBasket is set to true, `AssetToBasket` just returns key-value pairs.
Impact- Performance gain for Asset To Basket transaction(Quantify) | | CacheAPI.Trimmode: True | Overview -If set to true, the Basket APIs return a basket that has field and attribute metadata removed from the Basket API response, which reduces JSON processing and network I/O. This setting overrides the **CacheAPI.SkinnyBasket** configuration setting.
Impact- Performance gain for Anonymous and Loggedin Flow. | | CacheEnabled: True | Overview - Supports platform caching. To use context rules, including the Tightest Match service, CacheEnabled must be set to true.
Impact - Platform cache will not get updated | | DeltaPrice: True | Overview - If set to true, pricing is run only on new items added to the cart. If set to false, pricing is run on all items in the cart.
Impact - Better performance for larger cart (quantify)For large number of items in the cart, please refer to [Pricing and Validating Changed Items Only](https://help.salesforce.com/s/articleView?id=ind.comms_pricing_and_validating_changed_items_only.htm&type=5) | | DeltaValidate: True | Overview - This is used along with DeltaPrice. Similarly, if it is set to True - configuration rules are run against changed items in the CPQ Cart instead of all items
Impact - Better performance for large number (>50) of items in the cartFor large number of items in the cart, please refer to [Pricing and Validating Changed Items Only](https://help.salesforce.com/s/articleView?id=ind.comms_pricing_and_validating_changed_items_only.htm&type=5) | | Context and Context Key in the Request URL | For best performance, whether the user is known or anonymous, call the API with both the context parameter and the context key. This is a two-step process.
For example, first issue a request to the Get Offers by Catalog API. The contextKey is returned in the output of the API call, as shown here:
API Call:
`/services/apexrest/cacheableapis/v3/catalogs/Mobiles/offers?context={"accountId":"001f200001ci94Q"}&loggedin=true
`
API Response:
`{"contextKey":"9425c79cd5f3ec005ebcf4b72d57a378","offers":[{"
... (truncated for clarity)`
Subsequent requests are then made using the contextKey and the context.
For example, API Call:
`/services/apexrest/cacheableapis/v3/catalogs/Mobiles/offers?context={"accountId":"001f200001ci94Q"}&contextKey=9425c79cd5f3ec005ebcf4b72d57a378&loggedin=true`
If the context shape changes (changes are made to the account, an asset that belongs to the account, or to a contract), the context key must be regenerated. | ## EPC Performance Best Practices | Implementation | Performance
Impact
| | ----------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ProductAttributesBatchProcessorSize | Default is 500, if you are getting below error while running refresh platform cache please reduce the size, it restrict the number of attribute records being picked in a batch ` Too many DML rows: 10001``Apex heap size too large ` | | PriceBookRefreshBatchSize | Default is 200, reduce the size if you are getting any Salesforce goverance Limits while running refresh platform cache job. This configuration control the size of attributes and products processed in the Refresh Pricebook batch . | | ProductHierarchyBatchProcessorSize | Defaut is 20 , Reduce the size if you are getting any Salesforce goverance limit while running product hirarachy job. | # Order Standard object representing a customer's commitment, at a specific point in time, to buy products or services from your company. In Manufacturing Cloud, Automotive Cloud, and Consumer Goods Cloud orgs with the Advanced Orders feature, Order is extended with fields (such as OrderSpecId) that tie the order to an order-specification template and support field-sales/van-sales order-capture workflows. This object is available in API version 68.0 and later. ## Supported Calls `create()`, `delete()`, `describeLayout()`, `describeSObjects()`, `getDeleted()`, `getUpdated()`, `query()`, `retrieve()`, `search()`, `undelete()`, `update()`, `upsert()` ## Special Access Rules No additional setup or permissions beyond standard object- and field-level security are required to use the standard Order object. The Manufacturing/Automotive/Consumer Goods-specific extension fields on this object (for example OrderSpecId, and the van-sales/distribution fields such as DocumentType, DocumentTransactionType, IsDistributionRelevant, IsReleasedOnMobile) require the Advanced Orders or Retail Execution (Van Sales) features to be enabled and populated. ## Fields ### AccountId **Type:** reference **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The Account this order is for. **Relationship Name:** Account **Refers To:** Account ### ActivatedById **Type:** reference **Properties:** Filter, Group, Nillable, Sort, Update **Description:** The User who activated this order. **Relationship Name:** ActivatedBy **Refers To:** User ### ActivatedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort, Update **Description:** The date and time the order was activated. ### AppliedDiscount **Type:** percent **Properties:** Create, Filter, Nillable, Sort, Update **Description:** The overall discount percentage applied to the order. ### BillRecipientAccountId **Type:** reference **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The Account that receives the bill for this order, when different from the ordering Account. **Relationship Name:** BillRecipientAccount **Refers To:** Account ### BillingAddress **Type:** address **Properties:** Filter, Nillable **Description:** A compound field containing the billing address components (city, country, state, street, postal code, and geolocation) for the order. ### BillingCity **Type:** string **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The city component of the order's billing address. ### BillingCountry **Type:** string **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The country component of the order's billing address. ### BillingGeocodeAccuracy **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The accuracy level of the billing address geolocation. Possible values are Address, Block, City, County, ExtendedZip, NearAddress, Neighborhood, State, Street, Unknown, and Zip. ### BillingLatitude **Type:** double **Properties:** Create, Filter, Nillable, Sort, Update **Description:** The latitude of the order's billing address. ### BillingLongitude **Type:** double **Properties:** Create, Filter, Nillable, Sort, Update **Description:** The longitude of the order's billing address. ### BillingPostalCode **Type:** string **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The postal code component of the order's billing address. ### BillingState **Type:** string **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The state or province component of the order's billing address. ### BillingStreet **Type:** textarea **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The street component of the order's billing address. ### CnclReason **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The reason the order was canceled. ### CompanyAuthorizedById **Type:** reference **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The User who authorized the order on behalf of your company. **Relationship Name:** CompanyAuthorizedBy **Refers To:** User ### ContractId **Type:** reference **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The Contract associated with this order. **Relationship Name:** Contract **Refers To:** Contract ### CurrencyIsoCode **Type:** picklist **Properties:** Create, Defaulted on create, Filter, Group, Restricted picklist, Sort, Update **Description:** The ISO code for the currency of this record. Possible values are: AED (UAE Dirham), USD (U.S. Dollar), and every other active currency ISO code configured for the org. The default value is USD. ### CustomerAuthorizedById **Type:** reference **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The Contact who authorized the order on behalf of the customer. **Relationship Name:** CustomerAuthorizedBy **Refers To:** Contact ### DeliveryDate **Type:** date **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The date on which the order's products are expected to be delivered. ### DeliveryRecipientAccountId **Type:** reference **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The Account that receives the delivery for this order, when different from the ordering Account. **Relationship Name:** DeliveryRecipientAccount **Refers To:** Account ### Description **Type:** textarea **Properties:** Create, Nillable, Update **Description:** A text description of the order. ### DocReleaseTime **Type:** dateTime **Properties:** Create, Filter, Nillable, Sort, Update **Description:** The date and time the order document was released for processing or fulfillment. ### DocumentTransactionType **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The transaction type of the order document. Used by Van Sales / direct-store-delivery order-capture flows. Possible values are CashInvoice, CashOrder, CreditInvoice, CreditMemo, CreditOrder, InvoiceCashInvoice, InvoiceCreditInvoice, NoPayment, NoPaymentOrder, NonValuatedDeliveryNote, ValuatedDeliveryNote, VanSalesCashInvoice, and VanSalesNoPaymentInvoice. ### DocumentType **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The type of order document. Possible values are CashCheckIn, CashCheckOut, Delivery, Invoice, OrderEntry, ProductCheckIn, ProductCheckOut, and TruckAudit. ### EffectiveDate **Type:** date **Properties:** Create, Filter, Group, Sort, Update **Description:** The date on which the order goes into effect. ### EffectivePricingDate **Type:** date **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The date used to determine which pricing (price book, price adjustments, and Advanced Pricing conditions) is applicable to the order, when different from the order date. ### EndDate **Type:** date **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The date the order ends. ### ExternalNote **Type:** textarea **Properties:** Create, Filter, Nillable, Sort, Update **Description:** A note about the order that's visible to external parties, such as the customer or a partner system. ### FulfillmentAccountId **Type:** reference **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The Account responsible for fulfilling this order, when different from the ordering Account. **Relationship Name:** FulfillmentAccount **Refers To:** Account ### GrandTotalAmount **Type:** currency **Properties:** Filter, Nillable, Sort **Description:** The total amount of the order, including tax. This is a calculated, read-only field. ### InvoiceIdentifier **Type:** string **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** An external identifier for the invoice associated with this order. ### IsDistributionRelevant **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether this order is relevant to distribution/logistics processing. The default value is false. ### IsLargeDeal **Type:** boolean **Properties:** Defaulted on create, Filter, Group, Sort **Description:** Sets the transaction as a large deal; this action can't be reversed. The default value is false. ### IsReductionOrder **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort **Description:** Indicates whether this order reduces the quantity or amount of a prior order (for example, a return or credit). The default value is false. ### IsReleasedOnMobile **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether the order was released for capture or fulfillment on a mobile device. The default value is false. ### LastReferencedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** The timestamp when the current user last accessed this record, a related record, or a list view. ### LastViewedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** The timestamp when the current user last viewed this record. ### OrderManagementReferenceIdentifier **Type:** string **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** An external reference identifier linking this order to a record in an order-management system. ### OrderNumber **Type:** string **Properties:** Autonumber, Defaulted on create, Filter, idLookup, Sort **Description:** The auto-generated order number. ### OrderSpecId **Type:** reference **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The OrderSpec (order specification template) that this order was created from. Part of the Advanced Orders feature. **Relationship Name:** OrderSpec **Refers To:** OrderSpec ### OriginalOrderId **Type:** reference **Properties:** Create, Defaulted on create, Filter, Group, Nillable, Sort **Description:** The original Order that this order references, for example when this order is a change, return, or supplemental order. **Relationship Name:** OriginalOrder **Refers To:** Order ### OwnerId **Type:** reference **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** The User or Group that owns this order. **Relationship Name:** Owner **Refers To:** Group, User ### PayerAccountId **Type:** reference **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The Account responsible for paying for this order, when different from the ordering Account. **Relationship Name:** PayerAccount **Refers To:** Account ### PriceWaterfallIdentifier **Type:** string **Properties:** Filter, Group, Nillable, Sort **Description:** The waterfall execution identifier generated by the pricing procedure; used to display the price waterfall on the order header. ### Pricebook2Id **Type:** reference **Properties:** Create, Defaulted on create, Filter, Group, Nillable, Sort, Update **Description:** The Pricebook2 associated with this order. **Relationship Name:** Pricebook2 **Refers To:** Pricebook2 ### RelatedOrderId **Type:** reference **Properties:** Filter, Group, Nillable, Sort **Description:** A related Order, such as the order this one supersedes or supplements. **Relationship Name:** RelatedOrder **Refers To:** Order ### RelatedOrderType **Type:** picklist **Properties:** Filter, Group, Nillable, Restricted picklist, Sort **Description:** The relationship type to the related order. Possible values are ChangeOrder, SupplementalOrder, and TransferOrder. ### ReleaseLatitude **Type:** double **Properties:** Create, Filter, Nillable, Sort, Update **Description:** The latitude at which the order was released (for example, captured or submitted) in the field. ### ReleaseLongitude **Type:** double **Properties:** Create, Filter, Nillable, Sort, Update **Description:** The longitude at which the order was released in the field. ### ShippingAddress **Type:** address **Properties:** Filter, Nillable **Description:** A compound field containing the shipping address components (city, country, state, street, postal code, and geolocation) for the order. ### ShippingCity **Type:** string **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The city component of the order's shipping address. ### ShippingCountry **Type:** string **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The country component of the order's shipping address. ### ShippingGeocodeAccuracy **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The accuracy level of the shipping address geolocation. Possible values are Address, Block, City, County, ExtendedZip, NearAddress, Neighborhood, State, Street, Unknown, and Zip. ### ShippingLatitude **Type:** double **Properties:** Create, Filter, Nillable, Sort, Update **Description:** The latitude of the order's shipping address. ### ShippingLongitude **Type:** double **Properties:** Create, Filter, Nillable, Sort, Update **Description:** The longitude of the order's shipping address. ### ShippingPostalCode **Type:** string **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The postal code component of the order's shipping address. ### ShippingState **Type:** string **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The state or province component of the order's shipping address. ### ShippingStreet **Type:** textarea **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The street component of the order's shipping address. ### Status **Type:** picklist **Properties:** Create, Filter, Group, Restricted picklist, Sort, Update **Description:** The user-facing status of the order. Possible values are Activated and Draft. ### StatusCode **Type:** picklist **Properties:** Filter, Group, Restricted picklist, Sort, Update **Description:** The system status code of the order. Possible values are Activated, Canceled, Draft, Expired, and Superseded. ### TotalAmount **Type:** currency **Properties:** Create, Filter, Sort, Update **Description:** The total amount of all order items on the order, excluding tax. ### TotalRoundedLineAmount **Type:** currency **Properties:** Filter, Nillable, Sort **Description:** The sum of the rounded line amounts of the order's order items. This is a calculated, read-only field. ### TotalTaxAmount **Type:** currency **Properties:** Create, Filter, Nillable, Sort, Update **Description:** The total tax amount for the order. ### Type **Type:** picklist **Properties:** Create, Defaulted on create, Filter, Group, Nillable, Sort, Update **Description:** The type of order. Possible values are Indirect, Tele-Sales, and direct. The default value is direct. ## Associated Objects This object has the following associated objects. If the API version isn't specified, they're available in the same API versions as this object. Otherwise, they're available in the specified API version and later. - [OrderChangeEvent](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/change-event.md): Change events are available for the object. - [OrderFeed](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/feed.md): Feed tracking is available for the object. - [OrderHistory](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/history.md): History is available for tracked fields of the object. - [OrderOwnerSharingRule](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/owner-sharing-rule.md): Sharing rules are available for the object. - [OrderShare](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/share.md): Sharing is available for the object. # Order Delivery Date (POST) Get the valid delivery date range for an order based on the order specification's lead-time configuration. ## Resource ``` /connect/macz/order-delivery-date ``` ## Resource example ``` https://yourInstance.salesforce.com/services/data/v68.0/connect/macz/order-delivery-date ``` ## Available version 68.0 ## HTTP methods POST ## Request body for POST See [Advanced Order Delivery Date Input](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/requests/advanced-order-delivery-date-input.md). ```json { "orderSpecId": "0OSRM00000004Cx2AAE", "orderStartDate": "2026-09-08" } ``` | Name | Type | Description | Required or Optional | Available Version | | ---------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ----------------- | | `orderSpecId` | String | The ID of the order specification used to determine lead time and working day configuration. | Required | 68.0 | | `orderStartDate` | String | An optional start date for the delivery date calculation, in YYYY-MM-DD format. If no date is specified, the current date is used. | Optional | 68.0 | ## Response body for POST See [Advanced Order Delivery Date Output](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/responses/advanced-order-delivery-date-output.md). # Order Management Plus Integration Reference Documents Salesforce Industries provides a set of reference documents to help you understand how classes and objects work in Order Management Plus integration. You can download them to your computer to view them locally. 1. To visit the reference documents download page for your version of OM Plus, click the appropriate link: - [CME-234 (Winter '22) reference docs download page](https://volt.my.salesforce.com/sfc/p/o0000000IKm8/a/3m000000nYsG/ZMAhYbr_7YGQC7TPZNIyHVbeSshv9MxXMxond6HzU2A) - [CME-232 (Summer '21) reference docs download page](https://volt.my.salesforce.com/sfc/p/o0000000IKm8/a/3m000000nXwC/rR4LvXT3DhGluINvchJ3Y.9LlGlOoMxv4ixyMIcsZSY) - [CME-230 (Spring '21) reference docs download page](https://volt.my.salesforce.com/sfc/p/o0000000IKm8/a/3m000000nX61/OV3ZyKd3OHoy09o83HjnVzZMdt.eJwrzuFK8G6E_nY8) - [CME-109 (Winter ’21) reference docs download page](https://volt.my.salesforce.com/sfc/p/o0000000IKm8/a/3m000000MhHs/jbXlCy6Mf9EBt0dV3JRAthHavna5cTaAQvMF2YDP7sA) - [CME-107.1 reference docs download page](https://volt.my.salesforce.com/sfc/p/o0000000IKm8/a/3m000000Mh1u/2tRazrpXzJlTljseSrQrH39sYU0TFyfoVEdBnw5ZXq8) - [CMT-106 reference docs download page](https://volt.my.salesforce.com/sfc/p/o0000000IKm8/a/3m0000005uNG/e9Oec77SY..SUsKr.a82QKrS5BQNGLg8QivL9eOmYGM) 2. Click **Download** at the top of the page. 3. Unzip the downloaded file on your hard drive. 4. From the top level of the unzipped files, double-click `index.html`. **note:** If the files don't open, check your browser settings or use a different browser. **See Also** - [OM Plus: Database Structure](https://volt.my.salesforce.com/sfc/p/o0000000IKm8/a/3m000000nYTL/vF9Mjlb2LmhIYKQHYH7_cEw3GMoc4KJumIAB2_Cq8Zo) # Order Product Spec Listing Behaviour An order product specification (OrderItemSpec) with its ID, name, and listing behavior (Open or Closed). ## JSON example ```json { "id": "0OSRM00000004Cx2AAE", "name": "Standard Order Spec", "listingBehaviour": "Open" } ``` ## Properties | Property Name | Type | Description | Filter Group and Version | Available Version | | ------------------ | ------ | -------------------------------------------------------------------------------- | ------------------------ | ----------------- | | `id` | String | The ID of the order product specification (OrderItemSpec). | Small, 68.0 | 68.0 | | `listingBehaviour` | String | The listing behavior, either Open or Closed, based on IsClosedAuthorizationList. | Small, 68.0 | 68.0 | | `name` | String | The name of the order product specification. | Small, 68.0 | 68.0 | # OrderItem Standard object representing a single line item (product or charge) on an Order. In Manufacturing/Automotive/Consumer Goods Cloud orgs with Advanced Orders enabled, OrderItem is extended with fields linking each line to an OrderItemSpec template and carrying additional pricing/quantity metadata used during order capture and pricing calculation. This object is available in API version 68.0 and later. ## Supported Calls `create()`, `delete()`, `describeLayout()`, `describeSObjects()`, `getDeleted()`, `getUpdated()`, `query()`, `retrieve()`, `update()`, `upsert()` ## Special Access Rules No additional setup or permissions beyond standard object- and field-level security are required to use the standard OrderItem object. The Manufacturing/Automotive/Consumer Goods-specific extension field OrderItemSpecId, along with related quantity/pricing fields (RecommendedQuantity, TargetQuantity, IsPreviouslyOrderedItem, IsPromotedProduct, FreeItemParentType, FreeItemPricingStep), requires the Advanced Orders feature to be enabled and populated. ## Fields ### AvailableQuantity **Type:** double **Properties:** Filter, Nillable, Sort **Description:** The quantity of the ordered product currently available to fulfill this line item. This is a calculated, read-only field. ### CurrencyIsoCode **Type:** picklist **Properties:** Defaulted on create, Filter, Group, Restricted picklist, Sort **Description:** The ISO code for the currency of this record. Possible values are: AED (UAE Dirham), USD (U.S. Dollar), and every other active currency ISO code configured for the org. The default value is USD. ### Description **Type:** string **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** A text description of the order line item. ### Discount **Type:** percent **Properties:** Create, Filter, Nillable, Sort, Update **Description:** The discount percentage applied to this line item. ### EndDate **Type:** date **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The date this order line item's terms end. ### FreeItemParentType **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** Specifies the type of parent record associated with the free item. Possible values are Item, Order, and Reward. ### FreeItemPricingStep **Type:** string **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The calculation step or rule that generates the free item. ### IsAuthorizationListProduct **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether the product on this line item belongs to the account's product authorization list. The default value is false. ### IsOutOfStock **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether the ordered product was out of stock at the time of order capture. The default value is false. ### IsPreviouslyOrderedItem **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether this product was previously ordered by the account. The default value is false. ### IsPromotedProduct **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether this product was promoted (recommended or suggested) to the buyer during order capture. The default value is false. ### ListPrice **Type:** currency **Properties:** Create, Filter, Nillable, Sort **Description:** The list price of the product before any discounts or pricing adjustments. ### ManualOverridePrice **Type:** currency **Properties:** Create, Filter, Nillable, Sort, Update **Description:** A manually entered price that overrides the pricing engine's calculated price. ### NetTotalPrice **Type:** currency **Properties:** Create, Filter, Nillable, Sort, Update **Description:** The net total price for this line item (unit price × quantity) after all pricing adjustments. ### NetUnitPrice **Type:** currency **Properties:** Create, Filter, Nillable, Sort, Update **Description:** The net unit price for this line item after all pricing adjustments. ### OrderId **Type:** reference **Properties:** Create, Filter, Group, Sort **Description:** The parent Order this line item belongs to. **Relationship Name:** Order **Refers To:** Order ### OrderItemNumber **Type:** string **Properties:** Autonumber, Defaulted on create, Filter, idLookup, Sort **Description:** The auto-generated line item number. ### OrderItemSpecId **Type:** reference **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The OrderItemSpec (line-item specification template) that governs this line item's behavior. Part of the Advanced Orders feature. **Relationship Name:** OrderItemSpec **Refers To:** OrderItemSpec ### OriginalOrderItemId **Type:** reference **Properties:** Create, Filter, Group, Nillable, Sort **Description:** The original OrderItem this line item references, for example on a change or return order. **Relationship Name:** OriginalOrderItem **Refers To:** OrderItem ### PriceWaterfallIdentifier **Type:** string **Properties:** Filter, Group, Nillable, Sort **Description:** The waterfall execution identifier generated by the pricing procedure for this line item. ### PricebookEntryId **Type:** reference **Properties:** Create, Filter, Group, Nillable, Sort **Description:** The PricebookEntry that determines the pricing for this line item. **Relationship Name:** PricebookEntry **Refers To:** PricebookEntry ### Product2Id **Type:** reference **Properties:** Create, Filter, Group, Nillable, Sort **Description:** The Product2 ordered on this line item. **Relationship Name:** Product2 **Refers To:** Product2 ### QtyModificationReason **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The reason the ordered quantity was modified from its original or recommended value. ### Quantity **Type:** double **Properties:** Create, Filter, Sort, Update **Description:** The quantity of the product ordered on this line item. ### QuantityUnitOfMeasureId **Type:** reference **Properties:** Create, Filter, Group, Nillable, Sort **Description:** The UnitOfMeasure in which Quantity is expressed. **Relationship Name:** QuantityUnitOfMeasure **Refers To:** UnitOfMeasure ### RcvQuantityMismatchRsn **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The reason for a mismatch between the ordered and received quantity. ### RecommendedQuantity **Type:** double **Properties:** Create, Filter, Nillable, Sort, Update **Description:** The quantity recommended for this line item, for example by a replenishment or AI recommendation engine. ### RelatedOrderItemId **Type:** reference **Properties:** Filter, Group, Nillable, Sort **Description:** A related OrderItem, such as a corresponding line on a linked order. **Relationship Name:** RelatedOrderItem **Refers To:** OrderItem ### RemainingQuantity **Type:** double **Properties:** Create, Filter, Nillable, Sort, Update **Description:** The quantity of this line item still remaining to be fulfilled. ### RoundedLineAmount **Type:** currency **Properties:** Filter, Nillable, Sort **Description:** The line amount for this item after rounding rules are applied. This is a calculated, read-only field. ### ServiceDate **Type:** date **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The date the product or service on this line item is to be delivered or performed. ### TargetQuantity **Type:** double **Properties:** Create, Filter, Nillable, Sort, Update **Description:** The target quantity for this line item, used for goal-based or promotional order guidance. ### TotalAdjustmentAmount **Type:** currency **Properties:** Create, Filter, Sort, Update **Description:** The total amount of pricing adjustments applied to this line item. ### TotalAmtWithTax **Type:** currency **Properties:** Filter, Nillable, Sort **Description:** The total amount for this line item, including tax. This is a calculated, read-only field. ### TotalLineAmount **Type:** currency **Properties:** Create, Filter, Nillable, Sort, Update **Description:** The total amount for this line item, excluding tax. ### TotalPrice **Type:** currency **Properties:** Filter, Nillable, Sort **Description:** The total price for this line item (unit price × quantity), before adjustments. This is a calculated, read-only field. ### TotalTaxAmount **Type:** currency **Properties:** Create, Filter, Sort, Update **Description:** The total tax amount for this line item. ### Type **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The type of line item. Possible values are Delivery Charge, Fee, and Order Product. ### TypeCode **Type:** picklist **Properties:** Filter, Group, Nillable, Restricted picklist, Sort **Description:** The system type code of the line item. Possible values are Charge and Product. ### UnitPrice **Type:** currency **Properties:** Create, Filter, Nillable, Sort, Update **Description:** The unit price for this line item before pricing adjustments. ## Associated Objects This object has the following associated objects. If the API version isn't specified, they're available in the same API versions as this object. Otherwise, they're available in the specified API version and later. - [OrderItemChangeEvent](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/change-event.md): Change events are available for the object. - [OrderItemFeed](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/feed.md): Feed tracking is available for the object. - [OrderItemHistory](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/history.md): History is available for tracked fields of the object. - [OrderItemOwnerSharingRule](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/owner-sharing-rule.md): Sharing rules are available for the object. - [OrderItemShare](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/share.md): Sharing is available for the object. # OrderItemSpec Represents an Advanced Orders line-item specification template — a reusable set of rules (quantity limits, logistics units, pricing impact, inventory and merchandise-limit behavior) that governs how a specific product or product family can be ordered under an OrderSpec. This object is available in API version 68.0 and later. ## Supported Calls `create()`, `delete()`, `describeLayout()`, `describeSObjects()`, `getDeleted()`, `getUpdated()`, `query()`, `retrieve()`, `search()`, `undelete()`, `update()`, `upsert()` ## Special Access Rules Available only in orgs with the Manufacturing Cloud or Automotive Cloud Advanced Orders feature enabled. ## Fields ### AllowQuantityModification **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** Specifies whether the ordered quantity can be modified from its default or recommended value, and in which direction. Possible values are No, None, OnlyDecrease, OnlyIncrease, and Yes. ### CurrencyIsoCode **Type:** picklist **Properties:** Create, Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The ISO code for the currency of this record. Possible values are: AED (UAE Dirham), USD (U.S. Dollar), and every other active currency ISO code configured for the org. The default value is USD. ### DefaultLogisticUnit **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The default logistics unit used when ordering. Possible values are ConsumerUnit, OrderUnit, PriceUnit, and StockTakingUnit. ### DefaultScanUnit **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The default unit of measure assumed when a product is scanned during order capture. Possible values are ConsumerUnit, Layer, None, Pallet, and SalesUnit. ### Description **Type:** string **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** A text description of the order item specification. ### DisplaySequence **Type:** int **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The sequence number that determines this specification's display order relative to other item specifications. ### InternalOrganizationUnitId **Type:** reference **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The InternalOrganizationUnit this item specification is scoped to. **Relationship Name:** InternalOrganizationUnit **Refers To:** InternalOrganizationUnit ### InventoryOverrunBehavior **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The system behavior when an order would exceed available inventory. Possible values are Allow, Block, and Warn. ### IsActive **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether this order item specification is currently active. The default value is false. ### IsClosedAuthorizationList **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether the specification restricts orders to only products on a closed authorization list. The default value is false. ### IsInventoryApplicable **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether inventory-availability checks apply to this item specification. The default value is false. ### IsManualProdtAddAllowed **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether products can be manually added to the order outside the specification's default product list. The default value is false. ### IsMdseLimitApplicable **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether merchandise-limit checks apply to this item specification. The default value is false. ### IsOrderRoundingExcluded **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether this item specification is excluded from order-quantity rounding rules. The default value is false. ### IsPriceOverriden **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether the pricing engine price is overridden with a manually defined special price. The default value is false. ### IsProdtDeliveryStateConsidered **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether the product's delivery state is factored into order validation for this specification. The default value is false. ### ItemPricingGroup **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The classification of the order item specification for pricing calculations. Possible values are Delivery, FreeItem, Return, and ReturnResale. ### LastReferencedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** The timestamp when the current user last accessed this record, a related record, or a list view. ### LastViewedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** The timestamp when the current user last viewed this record. ### LogisticCategory **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The logistics category of the item specification. Possible values are None and Standard. ### MaximumQuantity **Type:** int **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The maximum quantity of the product that can be ordered under this specification. ### MaximumQuantityValidationType **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** Specifies whether exceeding MaximumQuantity is blocked, allowed with a warning, or allowed outright. Possible values are No, Warning, and Yes. ### MdseLimitOverrunBehavior **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The system behavior when an order would exceed a merchandise limit. Possible values are Allow, Block, and Warn. ### ModificationReasonBehavior **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** Specifies whether a reason is required when the ordered quantity is modified. Possible values are Mandatory, NotRequired, and Optional. ### MovementType **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The direction of inventory movement associated with this item specification. Possible values are In, None, and Out. ### Name **Type:** string **Properties:** Create, Filter, Group, idLookup, Sort, Update **Description:** The name of the order item specification. ### OwnerId **Type:** reference **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** The User or Group that owns this record. **Relationship Name:** Owner **Refers To:** Group, User ### PriceImpact **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The impact of the item specification on the total order value. Possible values are Additive, Neutral, and Subtractive. ### QuantitySuggestionMethod **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The method used to suggest an ordered quantity to the buyer. Possible values are DeliveredQuantity, No, None, and OrderedQuantity. ### ScanQuantityIncrement **Type:** int **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The quantity increment applied each time the product is scanned during order capture. ### ScanUnitBehavior **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The unit-of-measure behavior when scanning the product. Possible values are Barcode, Current, and Standard. ### ShortDescription **Type:** string **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** A short text description of the order item specification. ### ShouldAllowZeroQuantitySave **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether a line item with zero quantity can be saved under this specification. The default value is false. ### UsageType **Type:** picklist **Properties:** Create, Filter, Group, Restricted picklist, Sort **Description:** The usage context of the order item specification, for example Retail. ## Associated Objects This object has the following associated objects. If the API version isn't specified, they're available in the same API versions as this object. Otherwise, they're available in the specified API version and later. - [OrderItemSpecChangeEvent](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/change-event.md): Change events are available for the object. - [OrderItemSpecFeed](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/feed.md): Feed tracking is available for the object. - [OrderItemSpecHistory](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/history.md): History is available for tracked fields of the object. - [OrderItemSpecOwnerSharingRule](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/owner-sharing-rule.md): Sharing rules are available for the object. - [OrderItemSpecShare](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/share.md): Sharing is available for the object. # OrderItemSpecRule Represents a pricing/scope rule attached to an OrderItemSpec, defining the scope of order products the rule applies to and the pricing impact (additive, neutral, or subtractive) it has when matched. This object is available in API version 68.0 and later. ## Supported Calls `create()`, `delete()`, `describeLayout()`, `describeSObjects()`, `getDeleted()`, `getUpdated()`, `query()`, `retrieve()`, `undelete()`, `update()`, `upsert()` ## Special Access Rules Available only in orgs with the Manufacturing Cloud or Automotive Cloud Advanced Orders feature enabled. ## Fields ### CurrencyIsoCode **Type:** picklist **Properties:** Create, Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The ISO code for the currency of this record. Possible values are: AED (UAE Dirham), USD (U.S. Dollar), and every other active currency ISO code configured for the org. The default value is USD. ### LastReferencedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** The timestamp when the current user last accessed this record, a related record, or a list view. ### LastViewedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** The timestamp when the current user last viewed this record. ### Name **Type:** string **Properties:** Autonumber, Defaulted on create, Filter, idLookup, Sort **Description:** The auto-generated name of the order item specification rule. ### OrderItemSpecId **Type:** reference **Properties:** Create, Filter, Group, Sort **Description:** The parent OrderItemSpec this rule belongs to. This field is a relationship field. It's the master in a master-detail relationship. **Relationship Name:** OrderItemSpec **Refers To:** OrderItemSpec ### OrderProductRuleScope **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The scope of order products this rule applies to. Possible values are AccordingToPriceImpact, AllItems, DeliveryExclFreeItems, DeliveryInclFreeItems, and ReturnsOnly. ### PriceImpact **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The pricing impact this rule has on matched order products. Possible values are Add (Additive), Neutral, and Subtract (Subtractive). ## Associated Objects This object has the following associated objects. If the API version isn't specified, they're available in the same API versions as this object. Otherwise, they're available in the specified API version and later. - [OrderItemSpecRuleChangeEvent](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/change-event.md): Change events are available for the object. - [OrderItemSpecRuleFeed](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/feed.md): Feed tracking is available for the object. - [OrderItemSpecRuleHistory](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/history.md): History is available for tracked fields of the object. - [OrderItemSpecRuleOwnerSharingRule](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/owner-sharing-rule.md): Sharing rules are available for the object. - [OrderItemSpecRuleShare](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/share.md): Sharing is available for the object. # OrderSpec OrderSpec (Order Specification) is a top-level template used by the Advanced Orders feature to define the behavior and rules for a category of orders — such as which order types are allowed, how pricing is calculated and recalculated, how delivery dates and lead times are determined, and how inventory, promotions, and authorization lists are handled. Individual orders reference an OrderSpec (via the Order object's extension field) to inherit this configured behavior. This object is available in API version 68.0 and later. ## Supported Calls `create()`, `delete()`, `describeLayout()`, `describeSObjects()`, `getDeleted()`, `getUpdated()`, `query()`, `retrieve()`, `search()`, `undelete()`, `update()`, `upsert()` ## Special Access Rules Available only in orgs with the Manufacturing Cloud or Automotive Cloud Advanced Orders feature enabled. ## Fields ### AllowedOrdererTypes **Type:** multipicklist **Properties:** Create, Filter, Nillable, Update **Description:** The types of users or parties allowed to place orders under this order specification (for example, sales rep, customer self-service). ### AuthorizationListFinding **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** Determines how authorization list results are combined when validating whether a product can be ordered. Possible values are CombineAll—Combine All and FirstMatch—First Match. ### BarcodeScanBehavior **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** Determines what happens when a product barcode is scanned while building an order. Possible values are AddBatchNumber—Add Batch Number, OnlySelect—Only Select, SelectIncrease—Select and Increase, and UserExit—User Exit. ### CanUpdatePurchaseNumber **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether the purchase order number can be updated after the order is created. The default value is false. ### CnclReasons **Type:** multipicklist **Properties:** Create, Filter, Nillable, Update **Description:** The set of reasons that can be selected when an order under this order specification is canceled. ### CreationPlatform **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The platform on which orders using this order specification can be created. Possible values are Both, Laptop, and Mobility. ### CurrencyIsoCode **Type:** picklist **Properties:** Create, Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The ISO code for the currency of this order specification record. Possible values are: AED (UAE Dirham), USD (U.S. Dollar), and every other active currency ISO code configured for the org. The default value is USD. ### DeliveryDateCalculation **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** Determines whether and how a delivery date is calculated for orders using this order specification. Possible values are None and Standard. ### Description **Type:** string **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** A description of the order specification. ### DisplaySequence **Type:** int **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The display order of this order specification relative to other order specifications, for example in a picker UI. ### DisposalListProposal **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** Determines whether a disposal list proposal is generated for orders using this order specification. Possible values are None and Proposal. ### DocumentTransactionType **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The transaction type of the resulting document (invoice, delivery note, and so on) generated from orders using this order specification. Possible values are CashInvoice, CashOrder, CreditInvoice, CreditMemo, CreditOrder, InvoiceCashInvoice, InvoiceCreditInvoice, NoPayment, NoPaymentOrder, NonValuatedDeliveryNote, ValuatedDeliveryNote, VanSalesCashInvoice, and VanSalesNoPaymentInvoice. ### DocumentType **Type:** picklist **Properties:** Create, Filter, Group, Restricted picklist, Sort, Update **Description:** The type of document generated for orders using this order specification. Possible values are CashCheckIn, CashCheckOut, Delivery, Invoice, OrderEntry, ProductCheckIn, ProductCheckOut, and TruckAudit. ### DoesAllowDlvrDateAdj **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether the delivery date can be adjusted on orders using this order specification. The default value is false. ### DoesAllowHdrDiscount **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether a header-level discount can be applied to orders using this order specification. The default value is false. ### DoesIncludeFormerItem **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether previously ordered (former) items are included when building an order under this order specification. The default value is false. ### IncludeAuthorizationList **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** Determines whether an authorization list is applied when selecting products for orders using this order specification. Possible values are No, UserExit—User Exit, and Yes. ### IncludeOutOfStock **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** Determines whether out-of-stock products are included when building orders under this order specification. Possible values are Add, AddAndPresetQuantity—Add and Preset Quantity, No, and PresetQuantity—Preset Quantity. ### IncludePromotions **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** Determines whether promotions are considered for orders using this order specification. Possible values are No, UserExit—User Exit, and Yes. ### InternalOrganizationUnitId **Type:** reference **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The internal organization unit associated with this order specification. **Relationship Name:** InternalOrganizationUnit **Refers To:** InternalOrganizationUnit ### IsActive **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether this order specification is active and available for use on orders. The default value is false. ### IsCnclReasonRequired **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether a cancellation reason is required when canceling an order under this order specification. The default value is false. ### IsDeletionAllowed **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether orders using this order specification can be deleted. The default value is false. ### IsFulfillmentAcctRequired **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether a fulfillment account is required on orders using this order specification. The default value is false. ### IsInventoryFilterConsidered **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether inventory filters are applied when building orders under this order specification. The default value is false. ### IsLocationAuthListEnabled **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether a location-based authorization list is enabled for orders using this order specification. The default value is false. ### IsMobileRelevant **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether this order specification is relevant for mobile order-taking. The default value is false. ### IsOrderSpecAsrmtFltrCsdn **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether the order specification's assortment filter is considered when building orders. The default value is false. ### IsOrderSpecAsrmtIncluded **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether the order specification's assortment is included when determining orderable products. The default value is false. ### IsPricingInfoStored **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether the pricing information is stored on the order or order item. Used for printing and print previews. The default value is false. ### IsPricingLogGenerated **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether the pricing engine generates execution logs for this order type. The default value is false. ### IsProdtFldStatusConsidered **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether product field status settings are considered when building orders under this order specification. The default value is false. ### IsStockDisplayed **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether available stock is displayed to the user when building orders under this order specification. The default value is false. ### LastReferencedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** The timestamp when the current user last accessed this record or a related record. ### LastViewedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** The timestamp when the current user last viewed this record. ### LookbackPeriodInDays **Type:** int **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The number of days to look back at order history when applying rules (such as former-item inclusion) for this order specification. ### MaxLeadTime **Type:** int **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The maximum lead time, in days, allowed for orders using this order specification. ### MaxOrderValue **Type:** double **Properties:** Create, Filter, Nillable, Sort, Update **Description:** The maximum total value allowed for an order using this order specification. ### MinLeadTime **Type:** int **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The minimum lead time, in days, required for orders using this order specification. ### MinOrderValue **Type:** double **Properties:** Create, Filter, Nillable, Sort, Update **Description:** The minimum total value required for an order using this order specification. ### MobileProductLevelGrouping **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** Determines how products are grouped when displayed on a mobile order-taking screen for this order specification. ### Name **Type:** string **Properties:** Create, Filter, Group, idLookup, Sort, Update **Description:** The name of the order specification. ### OwnerId **Type:** reference **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** The user or queue that owns this order specification record. **Relationship Name:** Owner **Refers To:** Group, User ### PriceCalcDateSource **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The base date used for complex price calculation. Possible values are DeliveryDate—Delivery Date and OrderDate—Order Date. ### PricingRecalculationPolicy **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The recalculation behavior when the calculation date differs from the current date. Possible values are AlwaysCalculate—Always Calculate, No, Yes, and YesNotify—Yes Notify. ### PricingType **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The pricing category of the order specification. Possible values are Contract, Donate, FreeOfCharge—Free of Charge, Refusal, Return, Sample, and Standard. ### ReferencedApprovalStatus **Type:** multipicklist **Properties:** Create, Filter, Nillable, Update **Description:** The approval statuses referenced by this order specification when evaluating whether an order can proceed. ### ShouldAutoSelectPromotion **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether eligible promotions are automatically selected on orders using this order specification. The default value is false. ### ShouldCaptrReleaseTime **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether the release time is captured for orders using this order specification. The default value is false. ### ShouldChkDeliveryDate **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether the delivery date is validated when creating or updating orders under this order specification. The default value is false. ### ShouldConsiderLeadTime **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether lead time is considered when calculating delivery dates for orders using this order specification. The default value is false. ### ShouldConsiderSaturday **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether Saturday is treated as a working day when calculating dates for orders using this order specification. The default value is false. ### ShouldConsiderSunday **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether Sunday is treated as a working day when calculating dates for orders using this order specification. The default value is false. ### ShouldConsidrModReason **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether a modification reason must be considered when an order using this order specification is changed. The default value is false. ### ShouldCustSlsDocTrxnType **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether the customer's sales document transaction type is used for orders under this order specification. The default value is false. ### ShouldIncludeInventory **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether inventory availability is included when building orders under this order specification. The default value is false. ### SpecialOrderHandling **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** Determines how special (non-standard) orders are handled under this order specification. Possible values are ExclusiveSpecialOrder—Exclusive Special Order, InclusiveSpecialOrder—Inclusive Special Order, and No. ### SyncTriggerOption **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** Determines what triggers synchronization for orders using this order specification. Possible values are Cancel, No, Release, and ReleaseCancel—Release and Cancel. ### UsageType **Type:** picklist **Properties:** Create, Filter, Group, Restricted picklist, Sort **Description:** The usage category of this order specification. Possible values are Retail. ### ValidFrom **Type:** date **Properties:** Create, Filter, Group, Sort, Update **Description:** The date this order specification becomes valid and available for use. ### ValidTo **Type:** date **Properties:** Create, Filter, Group, Sort, Update **Description:** The date this order specification is no longer valid for use. ## Associated Objects This object has the following associated objects. If the API version isn't specified, they're available in the same API versions as this object. Otherwise, they're available in the specified API version and later. - [OrderSpecChangeEvent](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/change-event.md): Change events are available for the object. - [OrderSpecFeed](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/feed.md): Feed tracking is available for the object. - [OrderSpecHistory](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/history.md): History is available for tracked fields of the object. - [OrderSpecOwnerSharingRule](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/owner-sharing-rule.md): Sharing rules are available for the object. - [OrderSpecShare](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/share.md): Sharing is available for the object. # OrderSpecOrderItemSpec OrderSpecOrderItemSpec is a junction object that links an OrderSpec to the OrderItemSpec records that are valid for it, defining which item-level order specifications apply within a given order specification and over what date range, and which one is the default. This object is available in API version 68.0 and later. ## Supported Calls `create()`, `delete()`, `describeLayout()`, `describeSObjects()`, `getDeleted()`, `getUpdated()`, `query()`, `retrieve()`, `search()`, `undelete()`, `update()`, `upsert()` ## Special Access Rules Available only in orgs with the Manufacturing Cloud or Automotive Cloud Advanced Orders feature enabled. ## Fields ### CurrencyIsoCode **Type:** picklist **Properties:** Create, Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The ISO code for the currency of this record. Possible values are: AED (UAE Dirham), USD (U.S. Dollar), and every other active currency ISO code configured for the org. The default value is USD. ### IsDefaultOrderItemSpec **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether this OrderItemSpec is the default item specification for the parent OrderSpec. The default value is false. ### LastReferencedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** The timestamp when the current user last accessed this record or a related record. ### LastViewedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** The timestamp when the current user last viewed this record. ### Name **Type:** string **Properties:** Autonumber, Defaulted on create, Filter, idLookup, Sort **Description:** The auto-generated name of this junction record. ### OrderItemSpecId **Type:** reference **Properties:** Create, Filter, Group, Sort, Update **Description:** The order item specification linked to the parent order specification. **Relationship Name:** OrderItemSpec **Refers To:** OrderItemSpec ### OrderSpecId **Type:** reference **Properties:** Create, Filter, Group, Sort **Description:** The parent order specification for this junction record. This field is a relationship field. It's the master in a master-detail relationship. **Relationship Name:** OrderSpec **Refers To:** OrderSpec ### ValidFrom **Type:** date **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The date this order item specification becomes valid within the parent order specification. ### ValidTo **Type:** date **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The date this order item specification is no longer valid within the parent order specification. ## Associated Objects This object has the following associated objects. If the API version isn't specified, they're available in the same API versions as this object. Otherwise, they're available in the specified API version and later. - [OrderSpecOrderItemSpecChangeEvent](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/change-event.md): Change events are available for the object. - [OrderSpecOrderItemSpecFeed](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/feed.md): Feed tracking is available for the object. - [OrderSpecOrderItemSpecHistory](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/history.md): History is available for tracked fields of the object. - [OrderSpecOrderItemSpecOwnerSharingRule](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/owner-sharing-rule.md): Sharing rules are available for the object. - [OrderSpecOrderItemSpecShare](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/share.md): Sharing is available for the object. # Penny Perfect Pricing Penny Perfect Pricing provides accurate, real-time pricing for advanced order line items in Manufacturing, Automotive, and Consumer Goods. Use the Penny Perfect Pricing REST APIs to price a customer's order line items as an order is built. It also works with related APIs to set up pricing data, place orders, and flatten account hierarchies for reporting and analytics. With Penny Perfect Pricing and the APIs it works with, you can: - Get instant prices for a customer's order line items. - Calculate final prices for an order. - Set up the pricing data that price calculations rely on. - Place a complete order in a single request. - Flatten account hierarchies to speed up reporting and analytics. Manufacturing Cloud, Automotive Cloud, and Consumer Goods Cloud extend the standard Salesforce platform with a set of standard and custom objects that support advanced (SAP-style) pricing calculation, alongside the account hierarchy and product catalog objects that pricing relies on. This reference describes the objects that make up that "Pricing" object domain: the Penny Perfect Pricing engine (Pricing Calculation Schema, Pricing Specification, Pricing Search Strategy, Pricing Key Type/Attribute, External Pricing Key Value) plus the account and product objects shared with Advanced Orders. Each object's reference lists its description, supported API calls, any special access rules, and its fields (including, for each relationship field, its relationship name and the object(s) it refers to), plus its associated objects (such as feed, history, and sharing objects), where documented. Note on API version availability: All 19 objects covered in this guide are available in API version 68.0 and later. Note on shared objects: Account, AccountAccountRelation, InternalOrganizationUnit, PartyRoleRelation, and Product2 are foundational objects also documented in the Object Reference for the Salesforce Platform or a companion cloud developer guide (direct links are in the Data Model). AccountFlattenedHierarchy, AccountInternalOrgUnit, AccountRole, and InternalOrgUnitUser are additional shared objects with no single canonical external reference; their full documentation is in this guide, under Other Shared Objects. ## Standard Objects Penny Perfect Pricing uses standard Salesforce objects to store the pricing data used to calculate prices. For the list of standard objects and their key fields, see [Standard Objects](/docs/industries/penny-perfect-pricing/references/penny-perfect-pricing-objects). ## Business APIs Use the Penny Perfect Pricing Business API to get instant pricing for advanced order line items. For the APIs that Penny Perfect Pricing works with, see [Penny Perfect Pricing Business APIs](/docs/industries/penny-perfect-pricing/references/penny-perfect-pricing-rest). # Picklist APIs This topic lists all the REST APIs related to the picklists. You can use these APIs to create, read, update, or delete picklists. # Picklist Items APIs This topic lists all the REST APIs related to the picklist items. You can use these APIs to create, read, update, or delete picklist items. # Picklist Values For a fresh installation of CME, the following picklist values are added automatically. For an upgrade, you need to add these picklist values manually. | Release | Picklist Value | | -------------- | ------------------------------ | | CME Fall '20 | pleOfferMap basketPricing | | CME Winter '21 | bundleWrapper promotionWrapper | If any picklist values for an object are installed through the managed package and those picklist values are inactive, you must activate them. For instructions on how to add picklist values, see [Adding Picklist Values](https://help.salesforce.com/s/articleView?id=ind.comms_adding_picklist_values.htm&type=5). # Picklist Version APIs This topic lists all the picklist version APIs that you can use to manage the lifecycle of picklist objects. You can use these APIs to create and retrieve versions. # Place Advanced Order Input The input for the Place Advanced Order Transaction API. Wraps the standard Place Sales Transaction input with industry-specific context for Manufacturing, Automotive, and Consumer Goods. ## JSON example ```json { "placeSalesTransactionRequest": { "pricingPref": "System", "configurationPref": { "configurationMethod": "Skip" }, "graph": { "graphId": "freeItemDemo", "records": [ { "referenceId": "refOrder", "record": { "attributes": { "type": "Order", "method": "PATCH", "id": "801LT000018IrK5YAK" } } } ] } }, "enforceValidation": false } ``` ## Properties | Name | Type | Description | Required or Optional | Available Version | | ------------------------------ | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ----------------- | | `enforceValidation` | Boolean | Whether to enforce validation rules, such as minimum order quantity (MOQ), product availability, lead times, and agreement terms. | Required | 68.0 | | `placeSalesTransactionRequest` | Object | The Place Sales Transaction request containing the complete transaction graph, pricing preferences, and configuration options. For the complete request structure, see [Place Sales Transaction (POST)](https://developer.salesforce.com/docs/atlas.en-us.revenue_lifecycle_management_dev_guide.meta/revenue_lifecycle_management_dev_guide/connect_resources_place_sales_transaction.htm). | Required | 68.0 | # Place Advanced Order Output The output for the Place Advanced Order Transaction API. ## JSON example ```json { "placeSalesTransactionResponse": { "contextDetails": { "contextId": "0eARM00000004CxYAM", "isBuiltInTransaction": false }, "errorResponse": [], "isSuccess": true, "salesTransactionId": "801LT000018IrK5YAK" } } ``` ## Properties | Property Name | Type | Description | Filter Group and Version | Available Version | | ------------------------------- | ------ | --------------------------------------------------------------------------------------------------- | ------------------------ | ----------------- | | `placeSalesTransactionResponse` | Object | The Place Sales Transaction response containing the success status, created record IDs, and errors. | Small, 68.0 | 68.0 | # Place Order (POST) Place an order in one request by submitting its products, pricing, and configuration preferences together. ## Resource ``` /connect/macz/place-order ``` ## Resource example ``` https://yourInstance.salesforce.com/services/data/v68.0/connect/macz/place-order ``` ## Available version 68.0 ## HTTP methods POST ## Request body for POST See [Place Advanced Order Input](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/requests/place-advanced-order-input.md). ```json { "placeSalesTransactionRequest": { "pricingPref": "System", "configurationPref": { "configurationMethod": "Skip" }, "graph": { "graphId": "freeItemDemo", "records": [ { "referenceId": "refOrder", "record": { "attributes": { "type": "Order", "method": "PATCH", "id": "801LT000018IrK5YAK" } } } ] } }, "enforceValidation": false } ``` | Name | Type | Description | Required or Optional | Available Version | | ------------------------------ | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ----------------- | | `enforceValidation` | Boolean | Whether to enforce validation rules, such as minimum order quantity (MOQ), product availability, lead times, and agreement terms. | Required | 68.0 | | `placeSalesTransactionRequest` | Object | The Place Sales Transaction request containing the complete transaction graph, pricing preferences, and configuration options. For the complete request structure, see [Place Sales Transaction (POST)](https://developer.salesforce.com/docs/atlas.en-us.revenue_lifecycle_management_dev_guide.meta/revenue_lifecycle_management_dev_guide/connect_resources_place_sales_transaction.htm). | Required | 68.0 | ## Response body for POST See [Place Advanced Order Output](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/responses/place-advanced-order-output.md). # Populate Cache APIs A set of 13 REST APIs works together to populate the API response cache. Execute all populate cache APIs in the order presented below, with a few exceptions described in the next sections. The order listed in the table is the dependency order of the APIs. Unexpected results can occur if you do not run the APIs in the prescribed order. The delay between running two subsequent APIs is insignificant to the operation of these APIs as long as the data shape inside the org remains constant. | API Name | Description | | ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | [Catalog Profile API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-catalog-profile-api.md) | Uses the catalogCode to generate and cache the data profile. You define a catalogCode when you create a sales catalog. The offerId and rulesetId values in the output must be passed to subsequent APIs. | | [Rule Set Combinations API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-rule-set-combinations-api.md) | Generates a representation of entity filters in the passed ruleset. The rulesetId can be retrieved from the catalogCodeToRuleAssignments node in the Catalog Profile API response. Only required if your catalog uses rulesets. | | [Context Dimensions API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-context-dimensions-api.md) | Generates a list of cacheable and active context dimension codes and their values for caching. This API doesn’t require anything from the previous API response. | | [Context Combinations API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-context-combinations-api.md) | Generates a Cartesian product of all dimension combination value sets passed in the request body. The dimensions parameter is required in the request body. You can generate cached entries for specific context dimensions and values. Or you can leave dimensions blank to specify all context combinations in your catalog or to indicate that no context dimensions exist. | | [Context Eligibility API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-context-eligibility-api.md) | Identifies eligible products and promotions for each context combination. Its request body requires a cacheKey from the previous API's response. | | [Offers Item API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-offers-item-api.md) | Generates details for the offerIds passed in the request body. These offerIds are passed from the Product and Promotion nodes in the Catalog Profile API's response. | | [Offers List API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-offers-list-api.md) | Paginates the list of eligible offers and ensures the proper sequencing. The value of the eligibilityContextKey node in the Context Eligibility API's response must be passed to the ctxEligibilityCacheKey node of this API's request body. | | [Hierarchy API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-hierarchy-api.md) | Takes an individual product's offerId as input and populates its flat hierarchy in the cache. This API must be invoked for each Product offerId in the Catalog Profile API's response. | | [Prices API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-prices-api.md) | Takes an individual product's offerId as input and populates its prices in the cache. This API must be invoked for each Product offerId in the Catalog Profile API's response. | | [Offer Details API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-offer-details-api.md) | Takes an individual product's offerId as input and populates its details in the cache. This API must be invoked for each Product offerId in the Catalog Profile API's response. | | [Bundle Wrapper API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-bundle-wrapper-api.md) | Takes an individual product's offerId as input and populates its bundle wrapper in the cache. The bundle wrapper consists of the in-memory XLI objects used during basket operations. This API must be invoked for each Product offerId in the Catalog Profile API's response. | | [Promotion Wrapper API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-promotion-wrapper-api.md) | Takes an individual product's offerId as input and populates its promotion wrapper in the cache. This API must be invoked for each Product offerId in the Catalog Profile API's response. Only required if your catalog contains promotions. | | [Contains Offer API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-contains-offer-api.md) | Finds all the products and promotions that contain the given offer in their hierarchy and qualify under the given context combination. Also handles pagination and related action nodes. The value of the eligibilityContextKey node in the Context Eligibility API's response must be passed to the ctxEligibilityCacheKey node of this API's request body. | The diagram shows the invocation order and the data passed between APIs. ![invocation order and the data passed between APIs](https://developer.salesforce.com/docs/media/dc_populatecacheapi_flow.png) # Populate Cache Batch Process You can populate and initialize the cache by running batch jobs from the CMT Administration screen. For an overview of Digital Commerce caching, see [Digital Commerce API Caching](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-digital-commerce-api-caching.md). The following table describes the purpose of each of the jobs: | Batch Job | Description | Interface and Implementation | Custom Settings | | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ | | ContextEligibilityGenerator | Populates the cache with eligible offers for individual context combinations. This data is used in the GetOffers and GetContainOffers jobs. | [ContextEligibilityBatchJobRecord](https://help.salesforce.com/s/articleView?id=ind.v_dev_t_contexteligibilitybatchjobrecord_653197.htm) | CacheAPI.GetRelOffersCacheRecLimit CacheAPI.MaxGetRelOffersCacheRecLimit | | EcomDataProfileGenerator | Populates the cache with Products, Promotions, and PCIMap data for existing products related to each catalog. This data is used in the ContextEligibilityGenerator job. | [DataProfileBatchJobRecord](https://help.salesforce.com/s/articleView?id=ind.v_dev_t_dataprofilebatchjobrecord_653414.htm) | CacheAPI.CombinationLimit CacheAPI.MaxCombinationLimit | | RuleSetCombinationGenerator | Populates the cache with RuleSet context combinations. This data is used in the ContextEligibilityGenerator job. | [RuleSetCombinationBatchJobRecord](https://help.salesforce.com/s/articleView?id=ind.v_dev_t_rulesetcombinationbatchjobrecord_657153.htm) | CacheAPI.GetOffersCacheRecLimit CacheAPI.MaxGetOffersCacheRecLimit | | GetContainOffers | Populates the cache with the parent offers for individual offers. | [GetRelatedOffersBatchJobRecord](https://help.salesforce.com/s/articleView?id=ind.v_dev_t_getrelatedoffersbatchjobrecord_654433.htm) | None | | GetOfferDetails | Populates the cache with the details of individual offers (both products and promotions). | [GetOfferDetailsBatchJobRecord](https://help.salesforce.com/s/articleView?id=ind.v_dev_t_getofferdetailsbatchjobrecord_654149.htm) | None | | GetOffers | Populates the cache with the list of offers for individual context combinations. | [GetOffersBatchJobRecord](https://help.salesforce.com/s/articleView?id=ind.v_dev_t_getoffersbatchjobrecord_654204.htm) | None | | GetOffersHierarchyHelper | Populates the cache with the hierarchy of bundles. This data is used in the GetOfferDetails job. | [GetOffersHierarchyBatchJobRecord](https://help.salesforce.com/s/articleView?id=ind.v_dev_t_getoffershierarchybatchjobrecord_654258.htm) | None | | GetPrices | Populates the cache with the prices of products. | [GetPricesBatchJobRecord](https://help.salesforce.com/s/articleView?id=ind.v_dev_t_getpricesbatchjobrecord_654313.htm) | None | To run the Populate API Cache batch jobs: 1. Navigate to the **Vlocity CMT Administration** screen. 2. Click **Start** next to **Populate API Cache**. The Populate API Cache screen appears. The illustration below shows a sample of the Populate API Cache screen, ![Populate API cache](https://developer.salesforce.com/docs/media/populate_api_cache_3.png) 3. Make any of the following optional settings: - To specify a particular cache job to run, check the box next to the job name. - To specify that all of the cache jobs should run, check the box next to **Name**. - To specify that you want to populate the cache with information from one or more catalogs, select the checkbox next to each catalog. - To specify that you want to populate the cache with information from all active catalogs, select the **All** checkbox under Catalogs. - Use the **Effective Start Date** and **Expiration Date** fields to specify the length of time the cache is active. 4. Click **OK**. You receive a confirmation about whether the job or jobs have run successfully. The Populate API Cache page shows only those catalogs marked as Active **note:** You can also run the Digital Commerce API cache jobs remotely using APEX. See [Running Maintenance and Digital Commerce Cache Jobs Remotely](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-running-maintenance-and-digital-commerce-cache-jobs-remotely.md). # Populate Cache Job Since anonymous customers spend most of their time browsing, Digital Commerce provides the ability to populate the cache in advance to ensure their first visit is a highly productive visit. This is referred to as inorganically creating the cache. Digital Commerce does this by executing the Populate API Cache job. This job populates cache entries related to Get Offers and Get Offer Details APIs for anonymous users. ## Prerequisites Before you begin the populate cache job, prepare your org for [Digital Commerce API Caching](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-preparing-digital-commerce-api-caching.md). - You have [created product offerings within the product designer](https://help.salesforce.com/s/articleView?id=ind.comms_create_offerings_in_the_product_designer.htm) by specifying their name, structure, pricing, attributes, etc. - You have [created a sales catalog](https://help.salesforce.com/s/articleView?id=ind.comms_create_sales_catalogs.htm) for the product offerings. - Do not modify your catalog or product offerings until you have executed all of the populate cache APIs listed in the next section. For example, do not make a Catalog Profile API call, remove products from your sales catalog, and then use the Rule Set Combinations API. ## Administration There are two ways to execute the Populate Cache jobs. You can decide which method to choose based on the size of your catalog and the time it takes to execute each job. **important:** Avoid mixing or interrupting cache management APIs with cache management batch jobs and vice-versa. Choose a method for executing cache management and maintain a consistent execution pattern. - A [batch process](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-populate-cache-batch-process.md) named Populate API Cache, available through the CMT Administration UI. Each job works by executing several different APEX jobs. The APEX jobs are executed sequentially. - [Populate Cache API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-populate-cache-apis.md), available as REST APIs. These are Cache Management APIs that can make API calls in parallel, which can dramatically speed up the process of populating your cache. **important:** - The populate cache job always runs in Greenwich Mean Time (GMT) time zone. Ensure that the dates and times in your database are stored in GMT and not in your local time zone. - The behavior of the GetOfferDetails API depends on how the DC Populate Cache job is executed: - Separate Execution - Each catalog is processed independently with its own `snapshotId`. - Offers are only available in their respective catalogs. - Even with a shared `defaultPriceList`, OfferDetails are not shared. - This is because `CachedAPIResponse` entries are tied to individual catalog `snapshotIds`. - Bulk Execution - All catalogs share a single `snapshotId`. - Offers are available across all catalogs with the same `defaultPriceList`. - Ensures consistent OfferDetails availability across catalogs. # Post Cart Promotion Items Add applied promotion items to the cart. ```nolang POST /v2/cpq/carts/{cart_ID}/promotions ``` 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 ```nolang postCartsPromoItems ``` ## REST Handler ```nolang APIPromotionsCartsCpqV2 ``` ## Apex Remote Service ```nolang CpqAppHandler ``` ## Apex Remote Input Map ```nolang { "items": [{ "itemId": "a2ff4000000Li5eAAC" }], "promotionId": "a2ff4000000Li5eAAC", "cartId": "801f40000012NEIAA2", "methodName": "postCartsPromoItems" } ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | ------------------------------------------------------------------ | | Resource URL | `/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/promotions` | ## Example Request ```nolang POST /services/apexrest/vlocity_cmt/v2/cpq/carts/801f40000012NEIAA2/promotions BODY: { "items": [ { "itemId": "a2ff4000000Li5eAAC" } ], "promotionId": "a2ff4000000Li5eAAC", "cartId": "801f40000012NEIAA2", "methodName": "postCartsPromoItems" } ``` ## Example Response ```nolang { "totalSize": 0, "messages": [], "actions": { "itempricesupdated": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/801f40000012NEIAA2/price" }, "remote": { "params": { "cartId": "801f40000012NEIAA2", "methodName": "getCartLineItemPrices" } }, "client": { "params": {} } }, "itemadded": { "rest": { "params": {}, "method": null, "link": null }, "remote": { "params": {} }, "client": { "params": { "items": [{ "message": "TestProd-7 has been auto-added to the cart.", "Id": null }] } } }, "rootitemadded": { "rest": { "params": {}, "method": null, "link": null }, "remote": { "params": {} }, "client": { "params": {}, "records": [{ "messages": [], "actions": { "addtocart": { "rest": { "params": {}, "method": null, "link": null }, "remote": { "params": { "methodName": "postCartsItems", "items": [{ "quantity": 1, "parentId": "802f4000000CuauAAC", "itemId": "01uf4000000sXvTAAU" }], "cartId": "801f40000012NEIAA2", "price": true, "validate": true, "includeAttachment": false, "pagesize": 20, "lastRecordId": null, "query": null } }, "client": { "params": {} } }, "updateitems": { "rest": { "params": {}, "method": null, "link": null }, "remote": { "params": { "methodName": "putCartsItems", "items": [{ "itemId": "802f4000000CuauAAC" }], "filters": null, "fields": null, "cartId": "801f40000012NEIAA2", "price": true, "validate": true, "includeAttachment": false, "pagesize": 20, "lastRecordId": null, "query": null } }, "client": { "params": {} } }, "deleteitem": { "rest": { "params": {}, "method": null, "link": null }, "remote": { "params": { "methodName": "deleteCartsItems", "id": "802f4000000CuauAAC", "filters": null, "fields": null, "cartId": "801f40000012NEIAA2", "price": true, "validate": true, "includeAttachment": false, "pagesize": 20, "lastRecordId": null, "query": null } }, "client": { "params": {} } }, "configdelete": { "rest": { "params": {}, "method": null, "link": null }, "remote": { "params": { "methodName": "configDeleteItem", "id": "802f4000000CuauAAC", "cartId": "801f40000012NEIAA2" } }, "client": { "params": {} } }, "cloneitem": { "rest": { "params": {}, "method": null, "link": null }, "remote": { "params": { "methodName": "cloneItems", "items": [{ "itemId": "802f4000000CuauAAC" }], "id": "802f4000000CuauAAC", "cartId": "801f40000012NEIAA2" } }, "client": { "params": {} } }, "modifyattributes": { "rest": { "params": {}, "method": null, "link": null }, "remote": { "params": { "methodName": "putItemAttributes", "items": [{ "itemId": "802f4000000CuauAAC" }], "filters": null, "itemId": "802f4000000CuauAAC", "id": "802f4000000CuauAAC", "cartId": "801f40000012NEIAA2" } }, "client": { "params": {} } }, ... EXAMPLE TRUNCATED FOR BREVITY ``` # Post Offer Details for an Anonymous User This example demonstrates how to add promotions. ```nolang POST /v3/catalogs/{catalog_code}/offers/{offer_code} ``` Ensure you have: - Created a catalog that contains both products and promotions. - Set the CacheAPIPartialConfigure custom setting to true. Also, ensure you have set the CacheAPIFields custom setting to true. You set custom parameters in Vlocity CMT Administration -> CPQ Configuration Setup. - Run the appropriate Cacheable API batch jobs. From the Vlocity CMT Administration > Cacheable API Jobs screen, run the Load API Metadata job. Running this job populates metadata to the metadata classes and also some metadata settings. - Run the Populate API Cache job by clicking **Start**. From the Populate API Cache window, select GetOfferDetails and GetPrices. You can use the Configure Offer API with a two-step process to easily configure an offer. 1. Execute the API with a GET method to retrieve the offer details structure. For example: ```nolang GET /services/apexrest/vlocity_cmt/v3/catalogs/{catalog_code}/offers/{offer_code} ``` 2. After receiving a result from the API call, copy the result and use it as the body for the POST call. Before executing the POST call, remove the contextKey from the body, then edit any of the body parameters as appropriate to configure the offer. When finished, execute the call and verify that the result is as expected. ```nolang POST /services/apexrest/vlocity_cmt/v3/catalogs/{catalog_code}/offers/{offer_code} Request body (truncated): {"result":{"offerDetails":{"offer":{"offerType":"Promotion","childProducts":[{"priceResult":[{"adjustments"... ``` 3. The next step applies validation rules, pricing, and updates the response with the PromoDetails structure. In the response from the previous step, under the validateAndPriceAction, you will see the transactionKey REST parameter. Add the transactionKey in the request body to make the request. In the following example, the request body has been truncated for clarity. ```nolang POST /services/apexrest/vlocity_cmt/v3/catalogs/Mobiles/offers/iPhone8Offer?forceinvalidatecache=true Request body (truncated): {"transactionKey": "on08j8/KOpxKTOTzjndq8F3yoFA7FMYeLyhnYywJt2jok0JZr6Bq3StBYDnoTwYl","result":{"offerDetails":{... ``` **note:** The forceinvalidatecache parameter is used only for debugging purposes. When enabled by a server setting, forceinvalidatecache=true forces a cache refresh. # Post Offer Details with Configuration This API (also known as Validate API) requires the same input as Get Offer details - that is, **catalogcode** and **offercode**, plus a request body. First run Get Offer Details, copy the full response, paste it as a body for the Post Offer Details with Configuration, remove contextKey from the body, and click **Send**. Change Attribute values by modifying the **userValues** keys. For example, **"userValues": "500"**. This API will retrieve ABP prices (if configured) without the need to put item into the basket. ![Post Offer Details with Configuration](https://developer.salesforce.com/docs/media/postman_getofferdetailswithconfig.png) # Post Offer Details with Configuration API This API provides the ability to configure an offer (either a product or promotion) and view updated prices, quantities, and attributes. The API returns the configured product details. The configured product details are cached so that subsequent requests for the same configuration are retrieved with the data in the current cache layer. Validations, prices, adjustments, overrides, rules, context, and so on are resolved internally. The Salesforce ID is not used as part of the request or response parameters. If validation fails, the OfferDetails structure is returned with an appropriate error message. The CME Fall '20 release includes an Attribute Basket Cache feature. See [Attribute Basket Cache Exclusion](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-attribute-basket-cache-exclusion.md). Starting in CME Spring '22, Digital Commerce supports Usage Based Pricing. You can define usage-based price charges for each Product. If the usage-based price is not available, you can set it up using Attribute-Based Pricing. You can update usage quantity by either: - Updating the UsageQuantity Field. - Using Attribute Binding, which takes precedence over the field update if both values are passed. For more information, see [Create Attribute Bindings for Usage Pricing](https://help.salesforce.com/s/articleView?id=ind.comms_create_attribute_bindings_for_usage_pricing.htm). ## Rules Supported - [Context Eligibility Rules](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-context-eligibility-rules.md) for known users are supported. - Pricing Interface (see [Attribute-Based Pricing](https://help.salesforce.com/s/articleView?id=ind.comms_attribute_based_pricing.htm)) - Product Validation Interface (see [Context Rules Framework](https://help.salesforce.com/s/articleView?id=ind.comms_context_rules_framework.htm) and [Advanced Rules Framework](https://help.salesforce.com/s/articleView?id=ind.comms_advanced_rules_framework.htm)) - For anonymous users, [Advanced Rules](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-advanced-rules.md) are supported for [Defining Advanced Rules Using Configuration Type](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-defining-advanced-rules-using-configuration-type.md) and [Defining Advanced Rules Using Attribute Configuration Type](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-defining-advanced-rules-using-attribute-configuration-type.md) only. - For known users, [Advanced Rules](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-advanced-rules.md) are supported for [Defining Advanced Rules Using Configuration Type](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-defining-advanced-rules-using-configuration-type.md) and [Defining Advanced Rules Using Attribute Configuration Type](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-defining-advanced-rules-using-attribute-configuration-type.md) only. - [Product Relationships](https://help.salesforce.com/s/articleView?id=ind.comms_product_relationships_overview.htm) are supported with filters, for example, product A removes Product B. - [Pricing](https://help.salesforce.com/s/articleView?id=ind.comms_pricing_definition.htm) is supported. However, for pricing, do not use Pricing for Advance Rules. Always use the Custom Pricing Plan, which triggers [Attribute-Based Pricing](https://help.salesforce.com/s/articleView?id=ind.comms_attribute_based_pricing.htm). - Also, see [Using Context Rules with Digital Commerce APIs](https://help.salesforce.com/s/articleView?id=ind.comms_using_context_rules_with_digital_commerce_apis.htm) ## Prerequisites - The catalog should have CatalogCode**c populated. Spaces are not allowed in CatalogCode**c. - Products should have ProductCode populated. Spaces are not allowed in ProductCode. - Promotions should have Code**c populated. Spaces are not allowed in Code**c. - The catalog should be present with products and promotions attached to it as records under the CatalogProductRelationship\_\_c object. - The catalog should be attached to a default price list through DefaultPriceList**c field on Catalog**c object. - Price list entries should exist for all products attached to the catalog. - Create a custom setting called [CacheAPIFields](https://help.salesforce.com/s/articleView?id=ind.comms_t_cpq_configuration_settings_reference_148927.htm) with a value of true. CacheAPIFields is not required for CME 103.1.14 and later versions. ## Parameters For API parameter names and descriptions, see [Digital Commerce REST API](https://developer.salesforce.com/docs/industries/cme/references/dc-rest1?meta=Summary) ## Response For detailed API response descriptions, see [Digital Commerce REST API](https://developer.salesforce.com/docs/industries/cme/references/dc-rest1?meta=Summary). # Pre- and Post-Processing Logic for CPQ APIs Each of the CPQ APIs provide an option to write custom pre- and post-processing logic (hooks) to implement custom logic. Pre-hook logic is executed before the API is executed, while post-hook logic executes after the API executes. Follow these steps to implement pre- and post-hook logic for CPQ APIs: 1. Write the custom class to implement the pre and post hook. Below is a sample. ```nolang global with sharing class CPQCustomHookImplementation implements vlocity_cmt.VlocityOpenInterface{ global Boolean invokeMethod(String methodName, Map input, Map output, Map options) {     if( methodName.equalsIgnoreCase('getCartsItems.PreInvoke')) {          getCartsItems_PreInvoke(methodName, input, output,options);          return true;     }     if( methodName.equalsIgnoreCase('getCartsItems.PostInvoke')) {          getCartsItems_PostInvoke(methodName, input, output,options);          return true;     }     return false; } private void getCartsItems_PreInvoke(String methodName, Map input, Map output, Map options) {    //This method gets called before getCartsItems  } private void getCartsItems_PostInvoke(String methodName, Map input, Map output, Map options) {    //This method gets called after getCartsItems } ``` 2. Create the Interface Implementation. ```nolang Interface Name = CpqAppHandlerHookInterface, Implementation = CPQCustomHookImplementation ``` When invoking a CPQ API using a VIP, you must also create a custom setting with the same data as the interface implementation. The custom setting name should be the name of the interface implementation and the class should be the class name used in interface implementation. For information about creating an interface implementation, see: [Interface Packages, Types, and Default Implementations](https://help.salesforce.com/s/articleView?id=ind.v_dev_t_interface_packagestypesand_default_implementations_651871.htm) [Working with Implementations](https://help.salesforce.com/s/articleView?id=ind.v_dev_t_working_with_implementations_658020.htm) [Add a New Interface Implementation](https://help.salesforce.com/s/articleView?id=ind.v_dev_t_adding_a_new_interface_implementation_658122.htm) For information about custom settings, see [Vlocity Triggers](https://help.salesforce.com/s/articleView?id=ind.v_admin_vlocity_triggers_28627.htm). 3. Make the interface implementation active. For information, see [Working with Implementations](https://help.salesforce.com/s/articleView?id=ind.v_dev_t_working_with_implementations_658020.htm). # Preferred method: OAuth policy configuration for the Connected App This option is preferred as it works in every situation. The alternative method requires having access to an admin user for the organization. 1. Open the **connected application** menu, find the connected application for Digital Commerce and click **Manage** and select **Edit Policies**. 2. Under **Oauth2 Policies**, set **Permitted users** option to **Admin approved users are pre-authorized**. ![DCG Connected App Setup - Admin](https://developer.salesforce.com/docs/media/dcg_oauth1.png) ![](https://developer.salesforce.com/docs/media/dcg_oauth2.png) 3. Click **Save**. You now see a Profiles section in the **Edit Policies** page. 4. Add the profile of the DCG assigned user to the **Profiles** section of the connected application. ![DCG Connected App Setup - Profiles](https://developer.salesforce.com/docs/media/dcg_1.png) ![DCG Connected App Setup - Oauth Web server flow](https://developer.salesforce.com/docs/media/dcg_2.png) 5. Click **Manage Profiles** and select the profile you selected above (**System Administrator** is recommended) from the list. ![DCG Connected App Setup - Manage profiles](https://developer.salesforce.com/docs/media/dcg_3.png) 6. Save the selected profile. 7. In **Manage App > Connected Apps**, find the application you just created and ensure the settings are as below: ![DCG Connected App Setup - Settings](https://developer.salesforce.com/docs/media/dcg_validation.png) # Prepare to Use the Regenerate Cache APIs Before you can use the Regenerate Cache APIs, you must configure a trigger, a setting, and a picklist. Then you must run two CMT Administration jobs. 1. In Custom Settings, Trigger Setup, enable the CacheAPI.CacheManagement trigger. See [Enable the Cache Management Trigger](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-enable-the-cache-management-trigger.md). 2. In CPQ Configuration Custom Settings, set CacheAPI.RegenerateBatchCacheProcessor to true. See [Setting Up Your CPQ Configuration Settings](https://help.salesforce.com/s/articleView?id=ind.comms_setting_up_your_cpq_configuration_settings.htm). 3. Make sure the CachedAPIChange object has its `vlocity_cmt__ChangeType__c` and `vlocity_cmt__CodeType__c` picklists defined. See [Picklist Value Activation](https://help.salesforce.com/s/articleView?id=ind.comms_picklist_value_activation.htm). 4. In CMT Administration, run the [Product Hierarchy Maintenance](https://help.salesforce.com/s/articleView?id=ind.comms_product_hierarchy_maintenance.htm) and [Clear Managed Platform Cache Jobs](https://help.salesforce.com/s/articleView?id=ind.comms_clear_managed_platform_cache.htm). 5. Use the [Populate Cache APIs](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-populate-cache-apis.md). If you've been following this workflow, you've already done so. Don't use the Vlocity CMT Administration Cacheable API Jobs (batch APEX) while using the cache management APIs. Use either the batch APEX jobs or the cache management APIs, not both. [Run the RegenerateCacheOrchestratorApplication Class](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-run-the-regeneratecacheorchestratorapplication-class.md) # Preparing Digital Commerce API Caching This topic explains how to prepare to use Digital Commerce API Caching. Perform the following steps: 1. Navigate to the Vlocity Catalogs tab. 2. Verify that you have a default price list identified as part of your Vlocity Catalogs/Categories. If you do not have a catalog configured, see [Create Product Catalogs](https://help.salesforce.com/s/articleView?id=ind.comms_create_sales_catalogs.htm). The catalog allows you to identify a subset of products from your shared catalog and make them accessible to the Digital Commerce APIs. Ensure that the items in the catalog are active. 3. Navigate to the CMT Administration screen, then select **Cacheable API Jobs**. For more information about running the cacheable API jobs, see [Running Cacheable API Jobs](https://help.salesforce.com/s/articleView?id=ind.comms_running_cacheable_api_jobs.htm). 4. Run the [Load API Metadata](https://help.salesforce.com/s/articleView?id=ind.comms_load_api_metadata.htm) job, which should only be run once after a new installation or a release upgrade. The job uploads any new metadata that may have been added to the release. 5. Run the [Populate Cache Job](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-populate-cache-job.md), which initializes the CPQ API cache response. # Prerequisites for Digital Commerce APIs Before starting to use Digital Commerce features, ensure you meet the following prerequisites: - You have installed the latest version of CME. - You have the latest version of Postman installed on your computer. You can download the latest version here: [https://www.postman.com/downloads/](https://www.postman.com/downloads/). - You have added new picklist values to the CachedAPIResponse object (see [Picklist Value Activation](https://help.salesforce.com/s/articleView?id=ind.comms_picklist_value_activation.htm) for more information). - If you are using the Winter '20 version or later, create a new trigger named **CacheAPI.CacheManagement** from the **Trigger Setup** page and set it to **On**. - Check **Vlocity CMT Administration > CPQ Configuration Setup** for the following: - Multi-Transaction Service should be set to **true** by default (**MTSEnabled = true**) and is used to avoid exceeding Salesforce Governor limits. See [Multi-Transaction Service](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-multi-transaction-service.md). - The **CacheAPI.CreateCartFromContextKey** value is **false** by default, but it is recommended that the value be set to **true**. The difference in usage explained in Create Cart from Basket section below - Execute **Vlocity CMT Administration > Cacheable API Jobs > LOAD API METADATA**. See [Populate Cache Batch Process](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-populate-cache-batch-process.md) for more information. **note:** Run the **Load API Metadata** job only once. Subsequent executions reset the APIs to their default configuration and erase any changes to API metadata (such as extensions to parameters). - You have enabled Usage-Based Pricing. For details, see: - [Enable Usage Pricing](https://help.salesforce.com/s/articleView?id=ind.comms_enable_usage_pricing_for_industries_cpq.htm) - [Configure Usage Pricing](https://help.salesforce.com/s/articleView?id=ind.comms_configure_usage_pricing.htm) # Prerequisites to Regenerate Cache Before you begin the regenerate cache job, [prepare](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-preparing-digital-commerce-api-caching.md) and [initialize](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-populate-cache-job.md) the CPQ API cache. Follow these steps to use the incremental cache regeneration feature: 1. From **Setup**, in the Quick Find box, enter `Custom Settings`. 2. Click **Custom Settings**. 3. Go to **Trigger Setup**. 4. Next to **Trigger Setup**, click **Manage**. The Trigger Setup page appears. 5. Click Edit beside **CacheAPI.CacheManagement**, and turn on the trigger. If you do not see a trigger for **CacheAPI.CacheManagement**: 1. Click New. 2. Enter `CacheAPI.CacheManagement` in the **Name** field. 3. Click Trigger On. 4. Click Save. This ensures you can see catalog changes reflected in the cache after running the [Regenerate Cached API Records job](https://help.salesforce.com/s/articleView?id=ind.comms_regenerate_cached_api_records.htm&language=en_US&type=5). **important:** In the Winter '20 version of the software, there is a known issue with this trigger turned on that prevents you from importing large datapacks. To work around this issue, import datapacks with a batch size of one. Otherwise, the datapack import (deployment) fails due to excessive SOQL errors violating [Salesforce governor limits](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_gov_limits.htm). We recommend that you do not enable the Digital Commerce cache management trigger unless you are using Vlocity CME patch release Spring '20 107.1.1. If you do not use the incremental cache regeneration feature with Digital Commerce APIs, or if you want to import datapacks with a batch size larger than one, disable the cache management trigger. 6. Ensure the following picklist values are added to their appropriate object fields specified [here](https://help.salesforce.com/s/articleView?id=ind.comms_picklist_value_activation.htm&type=5): - CachedAPIChange: vlocity_cmt**ChangeType**c - CachedAPIChange: vlocity_cmt**CodeType**c 7. Run the following Maintenance Jobs from Vlocity CMT Administration each time changes are made to the product catalog.: - [Product Hierarchy Maintenance](https://help.salesforce.com/s/articleView?id=ind.comms_product_hierarchy_maintenance.htm&type=5) - [Clear Managed Platform Cache](https://help.salesforce.com/s/articleView?id=ind.comms_clear_managed_platform_cache.htm&type=5) **note:** To register only the changes for a new version of the calculation matrix: 1. Turn off the `CacheAPI.CacheManagement` trigger. 2. Update the calculation matrix-related data, which requires creating a new version of the calculation matrix. 3. Turn on the `CacheAPI.CacheManagement` trigger. 4. Go to **All Tabs** -> Vlocity Calculation Matrix. Select the currently active matrix from **Related list** -> Vlocity Calculation Matrix Versions. 5. Under **Vlocity Calculation Matrix Version** , search for Related Lis -> **Vlocity Calculation Matrix Row**, which should display all available matrix rows. 6. Search for the row on which the CRUD operation was performed to ensure only the changes get registered. 7. Click Edit and save the record. 8. Run the Clear Managed PlatformCache and Product Hierarchy Maintenance jobs from CMT Administration. 9. Run the Regenerate Batch job. # Price Items in Cart (Query) Retrieve current prices for the items in the cart. ```nolang GET /v2/cpq/carts/{cart_ID}/price?price={true|false}&priceDetailsFields={field_name}%2C{field_name} ``` This API provides a way of retrieving minimal pricing fields to refresh the UI. It is called by the UI after a `putCartsItems` call. When this API is called by the CPQ cart UI, it uses `price=false`, so the pricing interface implementation is not executed. This API can be called either through REST or through Apex remote calls. The default value for the `price` parameter is `true`. If `price=false` is not specified, pricing is executed by default. Specify `price=false` if you do not want to execute pricing. 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 ```nolang getCartLineItemPrices ``` ## REST Handlers ```nolang REST endpoint: APIPriceCartsCpqV2.cls Implementation: CpqGetCartLineItemPricesActionV2.cls ``` ## Apex Remote Service ```nolang CpqAppHandler ``` ## Apex Remote Input Map ```nolang { "methodName": "getCartLineItemPrices", "cartId": "801360000008eNU", "priceDetailsFields": "vlocity_cmt__OneTimeCharge__c, vlocity_cmt__RecurringCharge__c, vlocity_cmt__OneTimeTotal__c, vlocity_cmt__RecurringTotal__c" } ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | ------------------------------------------------------------- | | Resource URL | `/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/price` | ## Example Request ```nolang GET /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000iwCx/price?price=true ``` **note:** Setting `price=true` will run the pricing engine, which can negatively impact performance. To enhance performance, set `price=false` to return pricing information without repricing. ## Example Response ```nolang { "totalSize": 1, "messages": [], "records": [ { "messages": [], "displaySequence": -1, "vlocity_cmt__EffectiveQuantity__c": { "value": 1 }, "vlocity_cmt__OneTimeCharge__c": { "value": 100 }, "vlocity_cmt__OneTimeManualDiscount__c": { "value": 0 }, "vlocity_cmt__OneTimeCalculatedPrice__c": { "value": 100 }, "vlocity_cmt__OneTimeTotal__c": { "value": 100 }, "vlocity_cmt__RecurringCharge__c": { "value": 20 }, "vlocity_cmt__RecurringManualDiscount__c": { "value": 0 }, "vlocity_cmt__RecurringCalculatedPrice__c": { "value": 20 }, "vlocity_cmt__RecurringTotal__c": { "value": 20 }, "vlocity_cmt__EffectiveOneTimeTotal__c": { "value": 100 }, "vlocity_cmt__EffectiveRecurringTotal__c": { "value": 20 }, "Quantity": { "value": 1 }, "Id": { "value": "80246000000dwt8AAA" }, "PricebookEntryId": { "value": "01u46000001YhBOAA0" }, "vlocity_cmt__LineNumber__c": { "value": "0001" }, "PricebookEntry": { "attributes": { "type": "PricebookEntry", "url": "/services/data/v41.0/sobjects/PricebookEntry/01u46000001YhBOAA0" }, "Id": "01u46000001YhBOAA0", "Product2Id": "01t46000000LFXRAA4", "Pricebook2Id": "01s46000003EDDHAA4", "Product2": { "attributes": { "type": "Product2", "url": "/services/data/v41.0/sobjects/Product2/01t46000000LFXRAA4" }, "Id": "01t46000000LFXRAA4", "Name": "Product A", "ProductCode": "PROD_A", "vlocity_cmt__Type__c": "None", "vlocity_cmt__IsConfigurable__c": false } }, "Name": "Product A" } ] } ``` # priceCart Method Runs Industries CPQ pricing API on sub quotes. ## Class ## Input Parameters | Parameter | Required | Description | | --------- | -------- | ----------- | | Id | Required | Cart ID. | ## Output Parameters | Parameter | Description | | ------------- | ----------------------------------------------------------- | | pricingResult | Returns Map\ object (cartId and boolean value) | | message | In case of any error. | ## Example Input Data ``` {"Id":"0063t00000tPCmM"} ``` ## Example Output Data ``` {"pricingResult": {"0063t00000tPCmM": true}} ``` # priceLineItems Method Responsible for pricing the line items. ## Class ## Input Parameters | Parameter | Required | Description | | ------------------------ | -------- | ----------------- | | cartId | Required | Quote or Order ID | | itemsToProcessSubsetList | Required | List of root IDs | | pricingPlan | Optional | Pricing plan code | ## Output Parameters | Parameter | Description | | ------------- | --------------------------------------------------------------- | | statusMessage | Status message | | pricingOutput | Map of error, error code, or errorResult (in case of any error) | | errorCode | Error code | | error | Error | ## Example Input Data ``` {"cartId":"801Hr000001t1s1IAA", "itemsToProcessSubsetList":["a4o0b000000VN99AAG"]} ``` ## Example Output Data ``` {"statusMessage":"Completed Successfully.","Failed":false,"pricingOutput":{"errorCode":"INVOKE-200","error":"OK"},"errorCode":"INVOKE-200","error":"OK"} ``` **important:** If no pricing plan code is provided, the system defaults to using `LINE_ITEM_PRICING_PLAN`, not the `DEFAULT_PRICING_PLAN`. # Prices API The Prices API takes an offer's ID as input and populates its prices in the cache. The prices entry contains information about applicable pricing variables, for example, one-time, recurring, override, etc. You must execute this API for each product offerId that you received in the response from the Catalog Profile API. You can obtain the offerId required in the URI of this API from the combined result of apiResponse.data.catalogProductRelationDetails.Product and apiResponse.data.catalogProductRelationDetails.Promotion nodes in the response body of the [Catalog Profile API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-catalog-profile-api.md). ## Precondition You must first run the [Catalog Profile API](/docs/commerce/commerce/guide/comms-t-catalog-profile-api.html) to obtain the offerId required in the request body of this API. ## URI /services/apexrest/{namespace}/v3/admin/catalogs/{catalogCode}/offers/{offerId}/prices ## HTTP Method POST ## URI Parameters If you specify just one of these two parameters, it follows the behavior described in the table below and accepts your defined time for the parameter you specified. If you are using one or both parameters, you must specify them with the same values for all of the Populate Cache APIs in this sequence. | Parameter | Example | Default | Optional/Required | Notes | | ------------------ | ------------------- | ------------------------------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | effectiveStartTime | 2001-07-04T12:08:56 | Current date and time | Optional | effectiveStartTime is the time that you want your cached catalog entries to be effective. It should be in the UTC date-time format. Your effectiveStartTime must occur after the current time for which you are executing the Populate Cache APIs or you will receive an error message. | | expirationTime | 2001-07-04T12:08:56 | effectiveStartTime + TimeToLive | Optional | expirationTime is the time that you want your cached catalog entries to expire. It should also be in the UTC date-time format. Your expirationTime must occur after your effectiveStartTime or you receive an error message. TimeToLive is a custom setting created in CPQ Configuration Setup. It has a default value of 30 days. | Here is an example of how to pass the URI parameters: ```nolang GET /services/apexrest/vlocity_cmt/v3/admin/catalogs/AS-Test-Catalog/prices?effectiveStartTime=2021-07-04T12:08:56&expirationTime=2021-08-04T12:08:56 ``` ## Remote API This is an example of how you invoke the API using Apex: ```nolang String methodName; String requestBodyJSON; Map input = new Map(); Map output = new Map(); Map options = new Map(); // Setting remote parameters methodName = 'getPrices'; input.put('apiName', 'CMPrices'); // required input.put('methodName', methodName); // required input.put('catalogCode', 'TestCatalog'); // required input.put('offerId', '01t4x000000x269AAA'); // required input.put('effectiveStartTime', null); // optional input.put('expirationTime', null); // optional input.put('requestURL', '/v3/admin/catalogs/{catalogCode}/offers/{offerId}/prices'); //required //remote action invocation vlocity_cmt.CpqAppHandler appHandler = new vlocity_cmt.CpqAppHandler(); appHandler.invokeMethod(methodName, input, output, options); ``` ## Parallel Invocation You can run this API in parallel for multiple offers. For example, if there are 10 catalogs (Catalog1, Catalog2..Catalog 10) and each catalog has 100 offers, then you can run the API for all 1,000 offers in parallel threads. ```nolang THREAD1 - POST /services/apexrest/{namespace}/v3/admin/catalogs/catalog1/offers/offer1/prices THREAD2 - POST /services/apexrest/{namespace}/v3/admin/catalogs/catalog1/offers/offer2/prices ...... THREAD100 - POST /services/apexrest/{namespace}/v3/admin/catalogs/catalog1/offers/offer100/prices THREAD101 - POST /services/apexrest/{namespace}/v3/admin/catalogs/catalog2/offers/offer101/prices ...... THREAD1000 - POST /services/apexrest/{namespace}/v3/admin/catalogs/catalog10/offers/offer1000/prices ``` ## HTTP Headers | Header | Description | | ------------ | ---------------- | | Content-Type | application/json | ## Response Body This example shows an offer's pricing details. ``` [ { "UnitPrice": 150, "DisplayText__c": "150_OTB_T3_p_21", "ChargeType__c": "One-time", "RecurringFrequency__c": null, "Type__c": "Price", "SubType__c": "Standard", "effectivefromdatespec": null, "effectiveuntildatespec": null, "IsBasePrice__c": true, "IsVirtualPrice__c": false, "Amount__c": 150, "baseamount": 150, "chargeamount": 143, "overrides": [], "adjustments": [ { "DisplayText__c": "7_OT_ABS_T3_p_21_T3_promo21", "ChargeType__c": "Adjustment", "RecurringFrequency__c": null, "Type__c": "Price", "SubType__c": "Standard", "effectivefromdatespec": null, "effectiveuntildatespec": null, "Id": "a3C5g000000PsXQEA0", "Source__c": "promotion", "AdjustmentMethod__c": "Absolute", "AdjustmentValue__c": -7 } ] }, { "DisplayText__c": "15_RB_T3_p_21", "ChargeType__c": "Recurring", "RecurringFrequency__c": "Monthly", "Type__c": "Price", "SubType__c": "Standard", "effectivefromdatespec": null, "effectiveuntildatespec": null, "IsBasePrice__c": true, "IsVirtualPrice__c": false, "Amount__c": 15, "baseamount": 15, "chargeamount": 12.45, "overrides": [], "adjustments": [ { "DisplayText__c": "17_REC_PER_T3_p_21_T3_promo21", "ChargeType__c": "Adjustment", "RecurringFrequency__c": "Monthly", "Type__c": "Price", "SubType__c": "Standard", "effectivefromdatespec": null, "effectiveuntildatespec": null, "Id": "a3C5g000000PsXPEA0", "Source__c": "promotion", "AdjustmentMethod__c": "Percent", "AdjustmentValue__c": -17 } ] } ] ``` ## HTTP Response Codes | Code | Description | | ---- | --------------------- | | 200 | OK | | 500 | Internal Server Error | # Product API Configuration Options Configuration options for product API behavior and feature flags, such as list and search. ## JSON example ```json { "filterByAssortment": true, "includeCategoryHierarchies": true } ``` ## Properties | Name | Type | Description | Required or Optional | Available Version | | ---------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ----------------- | | `filterByAssortment` | Boolean | When true, resolves assortment IDs and filters products by assortments. When false or not set, calls the Configure, Price, Quote (CPQ) API directly without assortment filtering. | Optional | 68.0 | | `includeCategoryHierarchies` | Boolean | When true, enriches the response with category hierarchies for all product categories. Each hierarchy contains the complete path from root to leaf with breadcrumb and depth. Currently supported only in the product list API. | Optional | 68.0 | # Product APIs This topic lists all the REST APIs related to the Product object. You can use these APIs to create, read, update, or delete Product objects. # Product Child Item APIs This topic lists all the REST APIs related to the Product Child Items (PCI). You can use these APIs to create, read, update, or delete PCIs. # Product Search (POST) Search the product catalog for a customer account and order specification, optionally filtered by assortment. ## Resource ``` /connect/macz/products/search ``` ## Resource example ``` https://yourInstance.salesforce.com/services/data/v68.0/connect/macz/products/search ``` ## Available version 68.0 ## HTTP methods POST ## Request body for POST See [Advanced Order Product Search Input](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/requests/advanced-order-product-search-input.md). ```json { "searchInput": { "searchTerm": "widget", "catalogId": "0ZSRM0000000Abc4AA", "limit": 25, "offset": 0, "enablePricing": true, "correlationId": "req-0001" }, "customerAccountId": "001RM000004Wk8xYAC", "orderSpecId": "0OSRM00000004Cx2AAE", "configurationOptions": { "filterByAssortment": true } } ``` | Name | Type | Description | Required or Optional | Available Version | | ---------------------- | ------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ----------------- | | `configurationOptions` | [Product API Configuration Options](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/requests/product-api-configuration-options.md) | Optional configuration settings that control API behavior, such as assortment filtering. | Optional | 68.0 | | `customerAccountId` | String | The ID of the customer account. | Required | 68.0 | | `orderSpecId` | String | The ID of the order specification. | Required | 68.0 | | `searchInput` | Object | The Configure, Price, Quote (CPQ) product search input that contains the search term, filters, and pagination. For the complete request structure, see [Global Search (POST)](https://developer.salesforce.com/docs/atlas.en-us.revenue_lifecycle_management_dev_guide.meta/revenue_lifecycle_management_dev_guide/connect_resources_global_search.htm). | Required | 68.0 | ## Response body for POST See [Advanced Order Product Search Output](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/responses/advanced-order-product-search-output.md). # Product Version APIs This topic lists all the Product Version APIs that you can use to manage the lifecycle of Product objects. You can use these APIs to create and retrieve versions. **note:** To enable the Product Versioning feature, customers must contact their Account Executives (AEs). Starting with the Winter'26 release, any new customer attempting to enable this feature will receive an error message instructing them to contact their AE. # ProductCatalog Represents a top-level catalog that groups related product categories and products for a specific sales channel or process, such as a sales catalog or a service-process catalog. This object is available in API version 68.0 and later. ## Supported Calls `create()`, `delete()`, `describeLayout()`, `describeSObjects()`, `getDeleted()`, `getUpdated()`, `query()`, `retrieve()`, `search()`, `undelete()`, `update()`, `upsert()` ## Special Access Rules No additional setup or permissions beyond standard object- and field-level security are required. ## Fields ### CatalogType **Type:** picklist **Properties:** Create, Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** Indicates the type of catalog, such as a sales catalog or a service-process catalog. Possible values are Sales and ServiceProcess—Service Process. The default value is Sales. ### Code **Type:** string **Properties:** Create, Filter, Group, idLookup, Nillable, Sort, Update **Description:** A unique code that identifies the catalog. This field is unique within your organization. ### CurrencyIsoCode **Type:** picklist **Properties:** Create, Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The ISO code for the currency used for amount fields on this record, in orgs with multicurrency enabled. Possible values are: AED (UAE Dirham), USD (U.S. Dollar), and every other active currency ISO code configured for the org. The default value is USD. ### Description **Type:** textarea **Properties:** Create, Nillable, Update **Description:** A description of the catalog. ### EffectiveEndDate **Type:** dateTime **Properties:** Create, Filter, Nillable, Sort, Update **Description:** The date and time on which the catalog stops being effective and available for use. ### EffectiveStartDate **Type:** dateTime **Properties:** Create, Filter, Nillable, Sort, Update **Description:** The date and time on which the catalog becomes effective and available for use. ### LastReferencedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** The timestamp when the current user last accessed a record related to this record. ### LastViewedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** The timestamp when the current user last viewed this record. ### Name **Type:** string **Properties:** Create, Filter, Group, idLookup, Sort, Update **Description:** The name of the catalog. ### NumberOfCategories **Type:** int **Properties:** Filter, Group, Nillable, Sort **Description:** The number of product categories associated with this catalog. This is a calculated, read-only field. ### OwnerId **Type:** reference **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** The user or queue that owns this catalog. This field is a polymorphic relationship field. **Relationship Name:** Owner **Refers To:** Group, User ## Associated Objects This object has the following associated objects. If the API version isn't specified, they're available in the same API versions as this object. Otherwise, they're available in the specified API version and later. - [ProductCatalogChangeEvent](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/change-event.md): Change events are available for the object. - [ProductCatalogFeed](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/feed.md): Feed tracking is available for the object. - [ProductCatalogHistory](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/history.md): History is available for tracked fields of the object. - [ProductCatalogOwnerSharingRule](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/owner-sharing-rule.md): Sharing rules are available for the object. - [ProductCatalogShare](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/share.md): Sharing is available for the object. # ProductCatalogQual Represents a qualification rule that determines whether a specific product catalog applies to a given internal organization unit during a defined effective date range, used to scope catalog visibility by business unit or location. This object is available in API version 68.0 and later. ## Supported Calls `create()`, `delete()`, `describeLayout()`, `describeSObjects()`, `getDeleted()`, `getUpdated()`, `query()`, `retrieve()`, `search()`, `undelete()`, `update()`, `upsert()` ## Special Access Rules No additional setup or permissions beyond standard object- and field-level security are required. ## Fields ### CurrencyIsoCode **Type:** picklist **Properties:** Create, Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The ISO code for the currency used for amount fields on this record, in orgs with multicurrency enabled. Possible values are: AED (UAE Dirham), USD (U.S. Dollar), and every other active currency ISO code configured for the org. The default value is USD. ### EffectiveFromDate **Type:** date **Properties:** Create, Filter, Group, Sort, Update **Description:** The date on which this catalog qualification becomes effective. ### EffectiveToDate **Type:** date **Properties:** Create, Filter, Group, Sort, Update **Description:** The date on which this catalog qualification stops being effective. ### InternalOrganizationUnitId **Type:** reference **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The internal organization unit that this catalog qualification applies to. This field is a relationship field. **Relationship Name:** InternalOrganizationUnit **Refers To:** InternalOrganizationUnit ### IsQualified **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether the associated catalog is qualified (that is, applicable) for the related internal organization unit. The default value is false. ### LastReferencedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** The timestamp when the current user last accessed a record related to this record. ### LastViewedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** The timestamp when the current user last viewed this record. ### Name **Type:** string **Properties:** Autonumber, Defaulted on create, Filter, idLookup, Sort **Description:** An auto-generated name that identifies this catalog qualification record. ### OwnerId **Type:** reference **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** The user or queue that owns this catalog qualification record. This field is a polymorphic relationship field. **Relationship Name:** Owner **Refers To:** Group, User ### ProductCatalogId **Type:** reference **Properties:** Create, Filter, Group, Sort, Update **Description:** The product catalog that this qualification rule applies to. This field is a relationship field. **Relationship Name:** ProductCatalog **Refers To:** ProductCatalog ## Associated Objects This object has the following associated objects. If the API version isn't specified, they're available in the same API versions as this object. Otherwise, they're available in the specified API version and later. - [ProductCatalogQualChangeEvent](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/change-event.md): Change events are available for the object. - [ProductCatalogQualFeed](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/feed.md): Feed tracking is available for the object. - [ProductCatalogQualHistory](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/history.md): History is available for tracked fields of the object. - [ProductCatalogQualOwnerSharingRule](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/owner-sharing-rule.md): Sharing rules are available for the object. - [ProductCatalogQualShare](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/share.md): Sharing is available for the object. # ProductCategory Represents a category used to organize products within a product catalog, such as a brand or flavor grouping. Categories can be nested under a parent category to form a hierarchy. This object is available in API version 68.0 and later. ## Supported Calls `create()`, `delete()`, `describeLayout()`, `describeSObjects()`, `getDeleted()`, `getUpdated()`, `query()`, `retrieve()`, `search()`, `undelete()`, `update()`, `upsert()` ## Special Access Rules No additional setup or permissions beyond standard object- and field-level security are required. ## Fields ### CatalogId **Type:** reference **Properties:** Create, Filter, Group, Sort **Description:** The product catalog that this category belongs to. This field is a relationship field. It's the master in a master-detail relationship (ProductCatalog is the master object). **Relationship Name:** Catalog **Refers To:** ProductCatalog ### Code **Type:** string **Properties:** Create, Filter, Group, idLookup, Nillable, Sort, Update **Description:** A unique code that identifies the category. This field is unique within your organization. ### CurrencyIsoCode **Type:** picklist **Properties:** Create, Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The ISO code for the currency used for amount fields on this record, in orgs with multicurrency enabled. Possible values are: AED (UAE Dirham), USD (U.S. Dollar), and every other active currency ISO code configured for the org. The default value is USD. ### Description **Type:** textarea **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** A description of the category. ### IsNavigational **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether the category is used for navigation purposes, such as in a storefront's category menu. The default value is false. ### LastReferencedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** The timestamp when the current user last accessed a record related to this record. ### LastViewedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** The timestamp when the current user last viewed this record. ### Name **Type:** string **Properties:** Create, Filter, Group, idLookup, Sort, Update **Description:** The name of the category. ### NumberOfProducts **Type:** int **Properties:** Filter, Group, Nillable, Sort **Description:** The number of products directly associated with this category. This is a calculated, read-only field. ### ParentCategoryId **Type:** reference **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The parent category of this category, used to build a category hierarchy. This field is a relationship field. **Relationship Name:** ParentCategory **Refers To:** ProductCategory ### SortOrder **Type:** int **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The order in which this category is displayed relative to its sibling categories. ### Type **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The type of category, such as a brand or a flavor grouping. Possible values are Brand and Flavour. ## Associated Objects This object has the following associated objects. If the API version isn't specified, they're available in the same API versions as this object. Otherwise, they're available in the specified API version and later. - [ProductCategoryChangeEvent](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/change-event.md): Change events are available for the object. - [ProductCategoryFeed](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/feed.md): Feed tracking is available for the object. - [ProductCategoryHistory](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/history.md): History is available for tracked fields of the object. - [ProductCategoryOwnerSharingRule](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/owner-sharing-rule.md): Sharing rules are available for the object. - [ProductCategoryShare](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/share.md): Sharing is available for the object. # ProductCategoryProduct Represents the association (junction) between a Product2 record and a ProductCategory record, indicating which categories a product belongs to and which one is its primary category. This object is available in API version 68.0 and later. ## Supported Calls `create()`, `delete()`, `describeLayout()`, `describeSObjects()`, `getDeleted()`, `getUpdated()`, `query()`, `retrieve()`, `undelete()`, `update()`, `upsert()` ## Special Access Rules No additional setup or permissions beyond standard object- and field-level security are required. ## Fields ### CatalogId **Type:** reference **Properties:** Filter, Group, Sort **Description:** The product catalog associated with this product-category association, derived from the related category. This field is a relationship field. **Relationship Name:** Catalog **Refers To:** ProductCatalog ### CurrencyIsoCode **Type:** picklist **Properties:** Create, Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The ISO code for the currency used for amount fields on this record, in orgs with multicurrency enabled. Possible values are: AED (UAE Dirham), USD (U.S. Dollar), and every other active currency ISO code configured for the org. The default value is USD. ### IsPrimaryCategory **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether this category is the product's primary category. The default value is false. ### Name **Type:** string **Properties:** Autonumber, Defaulted on create, Filter, idLookup, Sort **Description:** An auto-generated name that identifies this product-category association record. ### ProductCategoryId **Type:** reference **Properties:** Create, Filter, Group, Sort **Description:** The product category in this association. This field is a relationship field. It's the master in a master-detail relationship (ProductCategory is the master object). **Relationship Name:** ProductCategory **Refers To:** ProductCategory ### ProductId **Type:** reference **Properties:** Create, Filter, Group, Sort, Update **Description:** The product in this association. This field is a relationship field. **Relationship Name:** Product **Refers To:** Product2 ### ProductToCategory **Type:** string **Properties:** Filter, Group, Sort **Description:** A concatenated, filterable representation of the product-to-category association used for search and reporting. ## Associated Objects This object has the following associated objects. If the API version isn't specified, they're available in the same API versions as this object. Otherwise, they're available in the specified API version and later. - [ProductCategoryProductChangeEvent](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/change-event.md): Change events are available for the object. - [ProductCategoryProductFeed](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/feed.md): Feed tracking is available for the object. - [ProductCategoryProductHistory](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/history.md): History is available for tracked fields of the object. - [ProductCategoryProductOwnerSharingRule](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/owner-sharing-rule.md): Sharing rules are available for the object. - [ProductCategoryProductShare](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/share.md): Sharing is available for the object. # ProductInternalOrgUnit Represents the assignment of a product to an internal organization unit (such as a store, warehouse, or distribution center), tracking the product's lifecycle phase and key planning/sales dates within that organizational unit. Used by Manufacturing, Automotive, and Consumer Goods Cloud to manage per-location product lifecycle and merchandising planning. This object is available in API version 68.0 and later. ## Supported Calls `create()`, `delete()`, `describeLayout()`, `describeSObjects()`, `getDeleted()`, `getUpdated()`, `query()`, `retrieve()`, `search()`, `undelete()`, `update()`, `upsert()` ## Special Access Rules Available only in orgs with Manufacturing Cloud, Automotive Cloud, or Consumer Goods Cloud features (including Inventory Management and Location/Assortment management) enabled. ## Fields ### CurrencyIsoCode **Type:** picklist **Properties:** Create, Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The ISO code for the currency used in any currency amount fields on this record. Possible values are: AED (UAE Dirham), USD (U.S. Dollar), and every other active currency ISO code configured for the org. The default value is USD. ### DeliveryPhaseEndDate **Type:** date **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The date the delivery lifecycle phase ends for this product at this internal organization unit. ### DeliveryPhaseStartDate **Type:** date **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The date the delivery lifecycle phase starts for this product at this internal organization unit. ### FieldSalesEndDate **Type:** date **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The date field sales activity for this product ends at this internal organization unit. ### FieldSalesStartDate **Type:** date **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The date field sales activity for this product starts at this internal organization unit. ### InternalOrganizationUnitId **Type:** reference **Properties:** Create, Filter, Group, Sort, Update **Description:** The internal organization unit (such as a store, warehouse, or distribution center) that this product assignment belongs to. This field is a relationship field. **Relationship Name:** InternalOrganizationUnit **Refers To:** InternalOrganizationUnit ### IsQualified **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether the product is qualified for use or sale at this internal organization unit. The default value is false. ### LastReferencedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** The timestamp when the current user last accessed this record or a related record. ### LastViewedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** The timestamp when the current user last viewed this record. ### LaunchPhaseEndDate **Type:** date **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The date the launch lifecycle phase ends for this product at this internal organization unit. ### LaunchPhaseStartDate **Type:** date **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The date the launch lifecycle phase starts for this product at this internal organization unit. ### LifecyclePhase **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The current lifecycle phase of the product at this internal organization unit. Possible values are Active, Check, Deleted, Passive, Paused, PhaseOut, Plan, Preparation, Remainders, and Startup. ### Name **Type:** string **Properties:** Autonumber, Defaulted on create, Filter, idLookup, Sort **Description:** The auto-generated name (record identifier) of this product-to-internal-organization-unit assignment. ### OwnerId **Type:** reference **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** The user or queue that owns this record. This field is a polymorphic relationship field. **Relationship Name:** Owner **Refers To:** Group, User ### PlanningEndDate **Type:** date **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The date the planning lifecycle phase ends for this product at this internal organization unit. ### PlanningStartDate **Type:** date **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The date the planning lifecycle phase starts for this product at this internal organization unit. ### ProductId **Type:** reference **Properties:** Create, Filter, Group, Sort, Update **Description:** The product (Product2) that this assignment applies to. This field is a relationship field. **Relationship Name:** Product **Refers To:** Product2 ### TaxClassification **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** Specifies the tax rate category applicable to the product during pricing calculations at this internal organization unit. For example, Standard or Reduced. ## Associated Objects This object has the following associated objects. If the API version isn't specified, they're available in the same API versions as this object. Otherwise, they're available in the specified API version and later. - [ProductInternalOrgUnitChangeEvent](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/change-event.md): Change events are available for the object. - [ProductInternalOrgUnitFeed](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/feed.md): Feed tracking is available for the object. - [ProductInternalOrgUnitHistory](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/history.md): History is available for tracked fields of the object. - [ProductInternalOrgUnitOwnerSharingRule](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/owner-sharing-rule.md): Sharing rules are available for the object. - [ProductInternalOrgUnitShare](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/share.md): Sharing is available for the object. # Products (POST) Get a filtered product list for a customer account and order specification, with optional assortment-based filtering and category hierarchy enrichment. ## Resource ``` /connect/macz/products ``` ## Resource example ``` https://yourInstance.salesforce.com/services/data/v68.0/connect/macz/products ``` ## Available version 68.0 ## HTTP methods POST ## Request body for POST See [Advanced Order Product List Input](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/requests/advanced-order-product-list-input.md). ```json { "productListInput": { "catalogId": "0ZSRM0000000Abc4AA", "categoryId": "0ZGRM0000000Xyz1AA", "limit": 25, "offset": 0, "enableQualification": true, "enablePricing": true, "correlationId": "req-0001" }, "customerAccountId": "001RM000004Wk8xYAC", "orderSpecId": "0OSRM00000004Cx2AAE", "configurationOptions": { "filterByAssortment": true, "includeCategoryHierarchies": true } } ``` | Name | Type | Description | Required or Optional | Available Version | | ---------------------- | ------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ----------------- | | `configurationOptions` | [Product API Configuration Options](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/requests/product-api-configuration-options.md) | Optional configuration flags that control API behavior, such as assortment filtering and category hierarchies. | Optional | 68.0 | | `customerAccountId` | String | The ID of the customer account. | Required | 68.0 | | `orderSpecId` | String | The ID of the order specification. | Required | 68.0 | | `productListInput` | Object | The Configure, Price, Quote (CPQ) product list input containing catalog, category, filters, and pricing preferences. For the complete request structure, see [Products List (POST)](https://developer.salesforce.com/docs/atlas.en-us.revenue_lifecycle_management_dev_guide.meta/revenue_lifecycle_management_dev_guide/connect_resources_products_list.htm). | Required | 68.0 | ## Response body for POST See [Advanced Order Product List Output](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/responses/advanced-order-product-list-output.md). # ProductUnitOfMeasure Represents a unit of measure available for a specific product, including whether it is the product's base unit, its default order unit, and its physical dimensions (volume, weight) for that unit. Used to support multi-UOM ordering and inventory calculations for products in Manufacturing, Automotive, and Consumer Goods Cloud. This object is available in API version 68.0 and later. ## Supported Calls `create()`, `delete()`, `describeLayout()`, `describeSObjects()`, `getDeleted()`, `getUpdated()`, `query()`, `retrieve()`, `search()`, `undelete()`, `update()`, `upsert()` ## Special Access Rules No additional setup or permissions beyond standard object- and field-level security are required. ## Fields ### CurrencyIsoCode **Type:** picklist **Properties:** Create, Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** The ISO code for the currency used in any currency amount fields on this record. Possible values are: AED (UAE Dirham), USD (U.S. Dollar), and every other active currency ISO code configured for the org. The default value is USD. ### GlobalTradeItemNumber **Type:** string **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The Global Trade Item Number (GTIN) that identifies the product at this unit of measure. ### InternalOrganizationUnitId **Type:** reference **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The internal organization unit this product-unit-of-measure record applies to. This field is a relationship field. **Relationship Name:** InternalOrganizationUnit **Refers To:** InternalOrganizationUnit ### IsBaseUnit **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether this unit of measure is the product's base (smallest, indivisible) unit of measure. The default value is false. ### IsDefaultOrderUnit **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether this unit of measure is the default unit used when ordering this product. The default value is false. ### IsOrderable **Type:** boolean **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** Indicates whether the product can be ordered using this unit of measure. The default value is false. ### LastReferencedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** The timestamp when the current user last accessed this record or a related record. ### LastViewedDate **Type:** dateTime **Properties:** Filter, Nillable, Sort **Description:** The timestamp when the current user last viewed this record. ### Name **Type:** string **Properties:** Autonumber, Defaulted on create, Filter, idLookup, Sort **Description:** The auto-generated name (record identifier) of this product-unit-of-measure record. ### OwnerId **Type:** reference **Properties:** Create, Defaulted on create, Filter, Group, Sort, Update **Description:** The user or queue that owns this record. This field is a polymorphic relationship field. **Relationship Name:** Owner **Refers To:** Group, User ### ProductId **Type:** reference **Properties:** Create, Filter, Group, Sort, Update **Description:** The product (Product2) that this unit of measure applies to. This field is a relationship field. **Relationship Name:** Product **Refers To:** Product2 ### Sequence **Type:** int **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The display or processing order of this unit of measure relative to other units of measure defined for the same product. ### UnitOfMeasureId **Type:** reference **Properties:** Create, Filter, Group, Sort, Update **Description:** The unit of measure (UnitOfMeasure) that this record represents for the product. This field is a relationship field. **Relationship Name:** UnitOfMeasure **Refers To:** UnitOfMeasure ### UnitVolume **Type:** double **Properties:** Create, Filter, Nillable, Sort, Update **Description:** The volume of one unit of the product at this unit of measure. ### UnitWeight **Type:** double **Properties:** Create, Filter, Nillable, Sort, Update **Description:** The weight of one unit of the product at this unit of measure. ### UsageType **Type:** picklist **Properties:** Create, Filter, Group, Nillable, Restricted picklist, Sort, Update **Description:** Indicates the usage context for this unit of measure, such as retail sale. Possible values include Retail. ### VolumeUnitOfMeasureId **Type:** reference **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The unit of measure used to express this record's UnitVolume. This field is a relationship field. **Relationship Name:** VolumeUnitOfMeasure **Refers To:** UnitOfMeasure ### WeightUnitOfMeasureId **Type:** reference **Properties:** Create, Filter, Group, Nillable, Sort, Update **Description:** The unit of measure used to express this record's UnitWeight. This field is a relationship field. **Relationship Name:** WeightUnitOfMeasure **Refers To:** UnitOfMeasure ## Associated Objects This object has the following associated objects. If the API version isn't specified, they're available in the same API versions as this object. Otherwise, they're available in the specified API version and later. - [ProductUnitOfMeasureChangeEvent](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/change-event.md): Change events are available for the object. - [ProductUnitOfMeasureFeed](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/feed.md): Feed tracking is available for the object. - [ProductUnitOfMeasureHistory](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/history.md): History is available for tracked fields of the object. - [ProductUnitOfMeasureOwnerSharingRule](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/owner-sharing-rule.md): Sharing rules are available for the object. - [ProductUnitOfMeasureShare](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/associated-objects/share.md): Sharing is available for the object. # Promotion APIs This topic lists all the REST APIs related to promotions. You can use these APIs to create, read, update, or delete promotions. # Promotion Items APIs This topic lists all the REST APIs related to the promotion items. You can use these APIs to create, read, update, or delete promotion items. # Promotion Wrapper API The Promotion Wrapper API takes the promotion Id (offerId) as input in the URI and populates the promotion wrapper in the cache. You must execute this API for each Promotion offerId that you received in the response of the Catalog Profile API. The promotion Wrapper API is required if you have promotions. If you are not using any promotions in your catalog, you do not need to perform this API call. You can obtain the offerId required in the URI of this API from the apiResponse.data.catalogProductRelationDetails.Promotion node in the response body of the [Catalog Profile API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-catalog-profile-api.md). ## Precondition You must first run the the [Catalog Profile API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-catalog-profile-api.md) to obtain the offerId required in the request body of this API. ## URI /services/apexrest/{namespace}/v3/admin/offers/{offerId}/promotionWrapper ## HTTP Method GET ## URI Parameters If you specify just one of these two parameters, it follows the behavior described in the table below and accepts your defined time for the parameter you specified. If you are using one or both parameters, you must specify them with the same values for all of the Populate Cache APIs in this sequence. | Parameter | Example | Default | Optional/Required | Notes | | ------------------ | ------------------- | ------------------------------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | effectiveStartTime | 2001-07-04T12:08:56 | Current date and time | Optional | effectiveStartTime is the time that you want your cached catalog entries to be effective. It should be in the UTC date-time format. Your effectiveStartTime must occur after the current time for which you are executing the Populate Cache APIs or you will receive an error message. | | expirationTime | 2001-07-04T12:08:56 | effectiveStartTime + TimeToLive | Optional | expirationTime is the time that you want your cached catalog entries to expire. It should also be in the UTC date-time format. Your expirationTime must occur after your effectiveStartTime or you receive an error message. TimeToLive is a custom setting created in CPQ Configuration Setup. It has a default value of 30 days. | Here is an example of how to pass the URI parameters: ```nolang GET /services/apexrest/vlocity_cmt/v3/admin/catalogs/AS-Test-Catalog/promotionWrapper?effectiveStartTime=2021-07-04T12:08:56&expirationTime=2021-08-04T12:08:56 ``` ## Remote API This is an example of how you invoke the API using Apex: ```nolang String methodName; Map input = new Map(); Map output = new Map(); Map options = new Map(); // Setting remote parameters methodName = 'getPromotionWrapper'; input.put('methodName', methodName); // required input.put('apiName', 'CMPromotionWrapper'); // required input.put('offers', 'a3S4W000002aAUhUAM'); // required input.put('effectiveStartTime', null); // optional input.put('expirationTime', null); // optional input.put('requestURL', '/v3/admin/offers/01t4W00000BgaKvQAJ/promotionWrapper'); // required //remote action invocation vlocity_cmt.CpqAppHandler appHandler = new vlocity_cmt.CpqAppHandler(); appHandler.invokeMethod(methodName, input, output, options); ``` ## Parallel Invocation You can run this API in parallel for multiple offers. For example, if there are 10 catalogs (Catalog1, Catalog2..Catalog 10) and each catalog has 100 offers, you can run this API for all 1,000 offers in parallel threads. ```nolang THREAD1 - GET /services/apexrest/{namespace}/v3/admin/offers/offer1/promotionwrapper THREAD2 - GET /services/apexrest/{namespace}/v3/admin/offers/offer2/promotionwrapper ...... THREAD10 - GET /services/apexrest/{namespace}/v3/admin/offers/offer10/promotionwrapper THREAD11 - GET /services/apexrest/{namespace}/v3/admin/offers/offer11/promotionwrapper ...... THREAD100 - GET /services/apexrest/{namespace}/v3/admin/offers/offer/promotionwrapper ``` ## HTTP Headers | Header | Description | | ------------ | ---------------- | | Content-Type | application/json | ## Response Body This example contains promotion offer IDs. ``` { "cacheKey": "demopromo", "apiResponse": { "promotion": { "attributes": { "type": "vlocity_cmt__Promotion__c", "url": "/services/data/v52.0/sobjects/vlocity_cmt__Promotion__c/a3S4W000002aAUhUAM" }, "Id": "a3S4W000002aAUhUAM", "Name": "demopromo", "vlocity_cmt__Code__c": "demopromo", "vlocity_cmt__IsActive__c": true, "vlocity_cmt__IsOrderable__c": true, "vlocity_cmt__PriceListId__c": "a3C4W00000P3RfDUAV" }, "promoItemWrappers": [ { "promoItem": { "attributes": { "type": "vlocity_cmt__PromotionItem__c", "url": "/services/data/v52.0/sobjects/vlocity_cmt__PromotionItem__c/a3R4W000005M6E1UAK" }, "Id": "a3R4W000005M6E1UAK", "Name": "PromotionItem__ca3F6g0000001ugP", "vlocity_cmt__ActionType__c": "Add/Update", "vlocity_cmt__IsActive__c": true, "vlocity_cmt__IsUndoable__c": false, "vlocity_cmt__MaxQuantity__c": 4, "vlocity_cmt__MinQuantity__c": 1, "vlocity_cmt__ProductHierarchyPath__c": "01t4W00000BgKvFQAV", "vlocity_cmt__ProductId__c": "01t4W00000BgKvFQAV", "vlocity_cmt__PromotionId__c": "a3S4W000002aAUhUAM", "vlocity_cmt__Quantity__c": 1, "vlocity_cmt__UpdateScope__c": "Update Item Only" }, "lastRealParentHierarchyPath": null, "appliedPromoItemWrappers": [ { "productHierarchyPath": "01t4W00000BgKvFQAV", "lineItem": { "attributes": { "type": "OrderItem" }, "vlocity_cmt__Product2Id__c": "01t4W00000BgKvFQAV", "PricebookEntryId": "01u4W000009zh0VQAQ", "vlocity_cmt__ProvisioningStatus__c": "New", "vlocity_cmt__Action__c": "Add", "vlocity_cmt__LineNumber__c": "0001", "vlocity_cmt__CurrencyPaymentMode__c": "Currency", "vlocity_cmt__InCartQuantityMap__c": null, "vlocity_cmt__SequenceNumber__c": 1, "UnitPrice": 0, "Quantity": 1, "vlocity_cmt__ProductHierarchyPath__c": "01t4W00000BgKvFQAV", "vlocity_cmt__JSONAttribute__c": null }, "compiledAttributeOverride": null, "appliedPromoItem": { "attributes": { "type": "vlocity_cmt__OrderAppliedPromotionItem__c" }, "vlocity_cmt__AppliedAction__c": "Add", "vlocity_cmt__MaxQuantity__c": 4, "vlocity_cmt__MinQuantity__c": 1 }, "adjustments": [ { "attributes": { "type": "vlocity_cmt__OrderPriceAdjustment__c" }, "vlocity_cmt__PromotionId__c": "a3S4W000002aAUhUAM", "vlocity_cmt__Action__c": "Add", "vlocity_cmt__PriceListEntryId__c": "a3B4W00000MsXI7UAN", "vlocity_cmt__AdjustmentValue__c": -11, "vlocity_cmt__Amount__c": null, "vlocity_cmt__AddedByUserId__c": "0054W00000BUE7wQAH", "vlocity_cmt__PricingElementGlobalKey__c": "40ebefe6-d244-15fa-9f3a-0a0f10a42aec", "vlocity_cmt__PricingElementVersionId__c": "a3E4W00000KmbYxUAJ", "vlocity_cmt__PricingVariableId__c": "a3I4W000003Bj1OUAS", "vlocity_cmt__Source__c": "Promotion", "vlocity_cmt__TimePlanId__c": null, "vlocity_cmt__TimePolicyId__c": null } ] } ] } ], "id": "a3S4W000002aAUhUAM", "code": "demopromo", "appliedPromo": { "attributes": { "type": "vlocity_cmt__OrderAppliedPromotion__c" }, "vlocity_cmt__Action__c": "Add", "vlocity_cmt__PromotionId__c": "a3S4W000002aAUhUAM", "vlocity_cmt__PromotionId__r": { "attributes": { "type": "vlocity_cmt__Promotion__c", "url": "/services/data/v52.0/sobjects/vlocity_cmt__Promotion__c/a3S4W000002aAUhUAM" }, "Id": "a3S4W000002aAUhUAM", "Name": "demopromo", "vlocity_cmt__Code__c": "demopromo", "vlocity_cmt__IsActive__c": true, "vlocity_cmt__IsOrderable__c": true, "vlocity_cmt__PriceListId__c": "a3C4W00000P3RfDUAV" } } }, "errorCode": "INVOKE-200", "error": "OK" } ``` ## HTTP Response Codes | Code | Description | | ---- | --------------------- | | 200 | OK | | 500 | Internal Server Error | # Promotions and Digital Commerce You can apply a promotion to a product or service using the Digital Commerce APIs. To learn more about promotions, see [Promotion-Based Adjustments and Overrides for Product Designer](https://help.salesforce.com/s/articleView?id=ind.comms_create_promotions_and_offers_for_product_bundles_in_the_product_designer.htm&type=5). The browse operation returns a list of products and promotions. You can then take a promotion and add it to an existing basket or a new basket. # Redirect Authentication Reference Application The _redirect-authentication-reference-app_ is an example Node.js application that provides authentication using a redirection mechanism. The reference demonstration app is created for use cases where both authentication logic and the UI are present on the server-side rather than the client-side. The redirection strategy provides the following features: - Authentication logic is abstracted from the client application. - A custom authentication UI is provided The following figure illustrates the redirection architecture. ![Redirection architecture](https://developer.salesforce.com/docs/media/sdk_redirect_arch.png) The redirect-authentication-reference-app consists os two layers: - The Authentication Logic Layer - The UI Layer (Views) ## Authentication Logic Layer The authentication layer is responsible for validating the identity of a user. Currently, the reference implementation uses Firebase authorization libraries for authentication logic; however, any third-party authentication library may be used by simply replacing the Firebase library. ## UI Layer (Views) The UI layer is responsible for providing a UI for authentication. The default UI provided by firebase is used for the reference implementation but it could be easily swapped for any custom authorization UI. ## Authorization Flow When a request is made to the login endpoint of the server, the server redirects the user to the custom authorization UI screen. The user then enters the authorization credentials and clicks **Submit**. If the credentials provided by the user are correct the user is logged in and the user details are sent to the client using a WebSocket. For this reference application, web sockets are used to communicate between the client and the server upon successful login. However, callbacks or any other mechanism could also be used. Note that both the Digital Commerce Web Components and the Digital Commerce Lightning Web Components have components that could be used in conjunction with this reference implementation. VlocityDCFirebaseRedirectStrategy and DCCustomAuthentication are the custom components respectively for Web Components and Lightning Web Components that are created as a reference implementation and could be used to interact with the server hosting the redirect-authentication-reference-app. # refreshCartMSMessage Method Regenerates all the messages of a group cart. ## Class ## Input Parameters | Parameter | Required | Description | | --------- | -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | cartId | Required | Any cart, usually a group cart. | | validate | Optional: Defaults to true | True: It executes validation for a given cart ID and updates the multi service messages. False: It updates the multi service messages. | ## Output Parameters JSON that contains action refreshGroupMSMessage. For more details, see the sample output. ## Input Data ``` {"cartId":"0Q05g000000x5f3CAA"} ``` ## Output Data ``` {"totalSize":0,"actions":{"refreshgroupmsmessage":{"rest":{"params":{},"method":null,"link":null},"remote":{"params":{"methodName":"refreshGroupMSMessage","groupId":"a3W5g000000LNyxEAG"}},"client":{"params":{}}}}} ``` # refreshGroupMSMessage Method Regenerates all the messages of a group. ## Class ## Input Parameters | Parameter | Required | Description | | --------- | -------- | ---------------------------------------------------- | | groupId | Required | Group ID for the message that needs to be populated. | ## Output Parameters This method has no return data other than error messages. ## Example Input Data ``` {"groupId": "a3W5g000000LNyxEAG"} ``` ## Example Output Data ``` {"errorCode":"INVOKE-200", "error": "OK"} ``` # Regenerate Affected Response API As part of the regeneration of records, a cachedAPIChangeEntryId query parameter regenerates the cache data for the change entry Id passed in the input. **important:** Ensure you run generateAction before you run regenerateAction. The Regenerate Affected Response API: - Checks if the Id is valid and the corresponding cachedAPIChangeEntryId record is unprocessed. - Gets the cachedAPIchange Id and checks if the dependent change entry is processed. If not, then the API throws an error to indicate that the dependent records are not processed. - If regeneration is successful, the API marks the cachedAPIChangeEntryId record as processed. This is the predefined sequence for specific types of records to regenerate: | Sequence for the itemType | Priority | | ----------------------------- | -------- | | dataProfileResultItem | 1 | | ruleSetCombinationResultItem | 2 | | contextDimensionsResultItem | 3 | | contextCombinationsResultItem | 4 | | catalogCtxEligibilityResult | 5 | | offerItem | 6 | | hierarchyResult | 8 | | priceResult | 9 | | itemDetails | 10 | | bundleWrapper | 11 | | promotionWrapper | 11 | | item | 12 | | orderConfiguration | 13 | For example, if you execute changeEntryId for bundle wrapper with sequence 11, but there is an unprocessed ChangeEntryId in the cachedAPIChange entry table for itemDetails with sequence 10 for the same offer, then an error occurs for violating the dependency check. You can obtain the ChangeEntryId required as a query parameter in the API from the Affected Cache API records.regenerateAction.bundleWrapper.params.ChangeEntryId node. RegenerateAction nodes with the same sequence can be executed in parallel. ## URI Parameters for regenerateAction Node For example: `POST /v3/admin/catalogs/{value}/offers/{value}/{APIname}?ChangeEntryId={value}` | Parameter | Example | Optional/Required | Description | | ------------- | ------------------ | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ChangeEntryId | a525g000000CjVbAAK | Required | CachedAPIChangeEntry Id that verifies the dependency check and tracks the generation or regeneration of the API. Contains the Id of the CachedAPIChange Entry object to process. | ## Action Nodes An action node contains the request format in the REST Node. These are the action node fields: | Action Node Fields | Description | | ------------------ | ----------------------------------------------------------------------------- | | requestBody | Indicates if there are any request bodies to provide in the respective API. | | params | Indicates if there are any query parameters to provide in the respective API. | | link | Specifies the API URI to invoke the service. | | method | Indicates if the respective API is a GET or POST request. | ## Sample Input for bundleWrapper Regeneration To invoke this action node, see [Bundle Wrapper APIBundle Wrapper API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-bundle-wrapper-api.md). ```nolang { "regenerateAction": { "bundleWrapper": { "rest": { "requestBody": { }, "params": { "forceinvalidatecache": true, "ChangeEntryId": "a525g000000CjVbAAK" }, "link": "/v3/admin/catalogs/mobiles/offers/01t4W00000BgarjQAB/bundlewrapper", "method": "POST" } } } } ``` ## Sample Input for offersItem Regeneration To invoke this action node, see [Offers Item APIOffers Item API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-offers-item-api.md). ```nolang { "Sequence": 6, "regenerateAction": { "offersItem": { "rest": { "requestBody": { "offerIds": [ "01t5g000001q3wWAAQ" ] }, "params": { "ChangeEntryId": "a525g000000CjbQAAS", "forceinvalidatecache": true, }, "link": "/v3/admin/catalogs/CM_CAT_B/offersitem", "method": "POST" } } } } ``` ## Sample Input for hierarchy Regeneration To invoke this action node, see [Hierarchy APIHierarchy API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-hierarchy-api.md). ```nolang { "Sequence": 8, "regenerateAction": { "hierarchy": { "rest": { "requestBody": {}, "params": { "forceinvalidatecache": true, "ChangeEntryId": "a4P5g000000xDljEAE" }, "link": "/v3/admin/catalogs/CM_CAT/offer/01t5g0000008VjRAAU/hierarchy", "method": "POST" } } } } ``` ## Sample Input for prices Regeneration To invoke this action node, see [Prices APIPrices API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-prices-api.md). ```nolang { "Sequence": 8, "regenerateAction": { "prices": { "rest": { "requestBody": {}, "params": { "forceinvalidatecache": true, "ChangeEntryId": "a4P5g000000xDloEAE" }, "link": "v3/admin/catalogs/CM_CAT/offers/01t5g0000008VjRAAU/prices", "method": "POST" } } } } ``` ## Sample Input for getOffers Regeneration To invoke this action node, see [getOffers APIGet Offers by Catalog API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-get-offers-by-catalog-api.md). ```nolang { "Sequence": 7, "regenerateAction": { "getOffers": { "rest": { "requestBody": null, "params": { "pagesize": "20", "offset": "0", "context": "{\"AF\":\"false\",\"AT\":\"false\"}", "ChangeEntryId": "a525g000000CjaBAAS", "forceinvalidatecache": true }, "link": "/v3/catalogs/CM_CAT_B/offers", "method": "GET" } } } } } ``` ## Sample Input for getOffersDetails Regeneration To invoke this action node, see [getOffersDetails APIGet Offer Details API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-get-offer-details-api.md). ```nolang { "Sequence": 9, "regenerateAction": { "getOfferDetails": { "rest": { "requestBody": null, "params": { "forceinvalidatecache": true, "ChangeEntryId": "a525g000000CjVaAAK", "context": "{\"AF\":\"true\",\"AT\":\"true\"}" }, "link": "/v3/catalogs/CM_CAT/offers/POPA", "method": "GET" } } } } } ``` ## Sample Input for invalidateAction Node To invoke this action node, see [Invalidate Affected Response APIInvalidate Affected Response API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-invalidate-affected-response-api.md). ```nolang { "invalidateAction": { "invalidateCachedResponse": { "rest": { "requestBody": { "cachedAPIResponseIds": [ "a0a5g0000005JbKAAU", "a0a5g0000005JaGAAU", "a0a5g0000005JbTAAU", "a0a5g0000005JbUAAU", "a0a5g0000005JbVAAU", "a0a5g0000005JbWAAU" ] }, "params": { }, "link": "/v3/admin/catalogs/regenerate/invalidate", "method": "POST" } } } } ``` ## Sample Input for generateAction Node To invoke this action node and execute the APIs listed in apiNames in the generateAction node for the list of catalogCodes, see the list of [Populate Cache APIsPopulate Cache APIs](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-populate-cache-apis.md). ```nolang { "generateAction": { "catalogCodes": [ "CM_CAT_B", "CM_CAT" ], "apiNames": [ "catalogprofile", "rulesetcombinations", "contextdimensions", "contextcombinations", "contexteligibility" ] } } ``` ## Parallel Invocation Each regenerateActionNode retrieved from the GET Affected Cache API contains a cachedAPIChangeEntryId that can pass and execute in parallel if the dependent entry is processed. For example, if there are 100 Regenerate Action nodes from the Get Affected Cache API (REGEN_ACTION1, REGEN_ACTION 2.....REGEN_ACTION100) and each action node contains a cachedAPIChangeEntryId, such as REGEN_ACTION1.CACE1, then you can run parallel threads of regenerateAction nodes and execute corresponding APIs. ```nolang THREAD1 - regenerateCacheObject(REGEN_ACTION1.CACE1) THREAD2 - regenerateCacheObject(REGEN_ACTION2.CACE2) THREAD3 - regenerateCacheObject(REGEN_ACTION3.CACE3) . . . . THREAD100 - regenerateCacheObject(REGEN_ACTION100.CACE100) ``` ## HTTP Headers | Header | Description | | ------------ | ---------------- | | Content-Type | application/json | ## HTTP Response Codes | Code | Description | | ---- | --------------------- | | 200 | OK | | 500 | Internal Server Error | # Regenerate Cache APIs A set of three REST APIs is available to regenerate the API cache. This section describes each of the regenerate cache APIs. **important:** Before you begin the regenerate cache job, [prepare](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-preparing-digital-commerce-api-caching.md) and [initialize](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-populate-cache-job.md) the CPQ API cache. You must invoke all of them in the correct order, with one conditional exception.

API Name

Description

Get Catalog Change API

Defines all offer and availability changes applicable to your catalogs, including changes that impact eligibility or effectivity. Examples include offer or bundle modifications such as changes in description, attachments, and cardinality.

Derive Change Entities API

Derives the scope of the impacted cache records from the CachedAPIChangeIds passed from the previous API to this API's request body.

Affected Cache API

Gets the cached records affected by the cachedAPIChange objects derived from the CachedAPIChangeIds passed from the previous API to this API's request body as a post method.

There are up to 3 different API calls provided by the action nodes of this API's response. They are invalidateAction, generateAction, and regenerateAction.

They must be executed with the invalidateAction calls first, followed by the generateAction calls, and finally the regenerateAction calls. In some cases, you will not need to perform generateAction calls, and you will not receive a corresponding node.

The cachedAPIChangeIds received from the previous API should be provided in the request body for this API. This API gets the cached records that will be affected by the derived cachedAPIChange objects.

  • Invalidate Affected Response API: Invalidates inaccurate cache entries based on the cachedAPIResponseIds passed from the invalidateAction node in the Get Affected Cache API's response.

  • Generate Affected Response API: Generates cache entries based on the cachedAPIResponseIds passed from the generateAction node in the Get Affected Cache API's response, if this node exists.

    Any apiNames values under the Get Affected Cache API's generateAction node indicate which Populate Cache APIs you must invoke again, in order. For example, the apiNames value catalogprofile indicates that you must invoke the Catalog Profile API.

  • Regenerate Affected Response API: You must invoke this API for each regenerateAction node in the Get Affected Cache API's response in the chronological Sequence listed. For example, invoke it for the node with Sequence: 8, then the node with Sequence: 9, and so on. You must append the ChangeEntryId parameter and its value to this API's URI.

The diagram shows the invocation order and the data passed between APIs. ![invocation order and the data passed between APIs](https://developer.salesforce.com/docs/media/dc_regeneratecacheapi_flow.png) Before you begin using these APIs, complete the following steps, and complete steps 1 to 3 before you make any catalog changes. 1. Enable Cache Management in your Custom Settings: 1. From **Setup**, in the **Quick Find** box, enter `Custom Settings`. 2. Click Custom Settings. 3. Go to Trigger Setup. 4. Next to **Trigger Setup**, click Manage. The Trigger Setup page appears. 5. Click Edit beside **CacheAPI.CacheManagement**, and turn on the trigger. If you do not see a trigger for CacheAPI.CacheManagement: - Click New. - Enter `CacheAPI.CacheManagement` in the **Name** field. - Click Trigger On. - Click Save. 2. Set the following CPQ Configuration Custom Settings: 1. Click the App Launcher. 2. Click Vlocity CMT Administration. 3. Under **Custom Settings**, click CPQ Configuration Setup. 4. Create the `CacheAPI.RegenerateBatchCacheProcessor` setting and set its value to `True`: 3. Ensure the following picklist values are added to their appropriate object fields specified [here](https://help.salesforce.com/s/articleView?id=ind.comms_picklist_value_activation.htm): - CachedAPIChange: vlocity_cmt**ChangeType**c - CachedAPIChange: vlocity_cmt**CodeType**c 4. Run the following Maintenance Jobs from Vlocity CMT Administration: - [Product Hierarchy Maintenance](https://help.salesforce.com/s/articleView?id=ind.comms_product_hierarchy_maintenance.htm) - [Clear Managed Platform Cache](https://help.salesforce.com/s/articleView?id=ind.comms_clear_managed_platform_cache.htm) 5. Perform these additional requirements for using the Regenerate Cache APIs: - Run the maintenance jobs listed in step 4 anytime you must execute the Regenerate Cache APIs. - Populate the API cache using the populate cache APIs. Do not use the Vlocity CMT Administration Cacheable API Jobs (batch APEX) while using the cache management APIs. Use either the batch APEX jobs or the cache management APIs, not both. - Execute all of the regenerate cache APIs in the chronological order presented. - Ensure you do not modify your catalog or product offerings until you have executed all of the regenerate cache APIs. # Regenerate Cache Batch Process You can update the existing cache when changes to your product catalog are made by running the Regenerate Cached API Records job from the CMT Administration screen. For an overview of Digital Commerce caching, see [Digital Commerce API Caching](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-digital-commerce-api-caching.md). To run the Regenerate Cached API Records job: 1. Navigate to the **Vlocity CMT Administration** screen. 2. Click **Start** next to **Regenerate Cached API Records**. If the catalog has been modified, this job regenerates the cached API response objects based on the modified sales catalog and product models. 3. Click **OK**. You receive a confirmation about whether the job has run successfully. # Regenerate Cache Batch Process Examples and Best Practices The scenario in this topic illustrates the most common implementation and results of using the Regenerate Cached API Records job to specify a cache effectivity date. ## Example of Recommended Best Practice On December 12th, (after setting CacheAPI.RegenerateFutureDatedCache=True) the Product Admin makes changes to the product catalog. The Product Admin then executes the Regenerate Cached API Records batch job and specifies December 13th at 12:00 a.m. as the cache effectivity date. As a result, the API CacheRespond object will contain the original cache effectivity date and will contain the updated cache entries with the future effective date. On December 13th at 12:00 a.m., all Digital Commerce API Cache requests will respond with the product model changes that were made on December 12th. On December 13th, the Product Admin again makes changes to the Product Catalog. The Product Admin executes the Regenerate Cached API Records batch job and specifies December 14th at 12:00 a.m. as the cache effectivity date. As a result, the API CacheRespond object will contain the original cache effectivity date and will contain the update cache entries with the future effective date. On December 14th at 12:00 a.m., all Digital Commerce API Cache requests will respond with the product model changes that were made on December 13th. **note:** Only one version of the future-date cache is honored. The current regenerate future-dated cache feature is intended for customers who make frequent changes to their product model. ## Product Model Change Before Cache Effective Date If you have already run the Regenerate Cached API Records batch job and specified an effectivity date, but would like to make product model changes prior to the specified effective date, see the following scenario. On December 12th, the Product Admin makes changes to the product catalog. The Product Admin executes the Regenerate Cached API Records batch job and specifies January 1st at 12:00 a.m. as the cache effectivity date. As a result, the API CacheResponse object will contain the original cache effectivity date and will contain the updated cache entries with the future effective date. On December 13, the Product Admin again makes changes to the product catalog. The Product Admin executes the Regenerate Cached API Records batch job and specifies January 1st at 12:00 a.m. as the cache effectivity date. As a result, no changes will be made since only one future-date version is supported. If the Product Admin wants to commit changes made on December 12 and December 13, then the administrator must first do the following: - Query the CacheChangeObject and set the IsProcess Flag to F for all records created on December 12th and December 13th. - Delete Cache Records in the API CacheResponse where EffectiveStartDate = January 1st 12:00 a.m. - Run the Regenerate Cached API Records job. After completing the previous steps, on January 1st at 12:00 a.m., all Digital Commerce API cache requests will respond with the product model changes that were made on December 12th and 13th. Generally speaking, it is recommended that you run the Regenerate Cached API Records batch job only after the specified future-dated cache has passed. **important:** Do not modify the CacheAPI.RegenerateFutureDatedCache if you have existing future-dated cache entries. # Regenerate Cache Job As users make their way down the commerce funnel towards purchasing the product, you organically create the cached based on the request made to the CPQ Engine. As time goes by, you end up with a robust set of cached records within your cached response object. However, when a product administrator makes changes to an existing product catalog, for example, modifying an associated attribute or price, we then update the existing cache that corresponds to the change. This brings us to the second way to manage the cache, which is by executing the Regenerate Cache job. This job concentrates on making updates to the existing cache based on changes made to the product catalog. ## Administration There are two ways to execute the Regenerate Cache jobs. You can decide which method to choose based on the size of your catalog and the time it takes to execute each job. **important:** Avoid mixing or interrupting cache management APIs with cache management batch jobs and vice-versa. Choose a method for executing cache management and maintain a consistent execution pattern. - A [batch process](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-regenerate-cache-batch-process.md) named Regenerate API Cache, available through the CMT Administration UI. Each job works by executing several different APEX jobs. - [Regenerate Cache APIs](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-regenerate-cache-apis.md), available as REST APIs. These are Cache Management APIs that can make API calls in parallel, which can dramatically speed up the process of populating your cache. # Regenerate Catalog-Level Cache Data These batch jobs populate the catalog-level data in the cache. In the cached API change table, the system queries any unprocessed change object of code type as catalog present or not. For the unprocessed catalog change entries, the catalog level batch jobs dataProfile, eligibility, and getOffers run. With versioning enabled, additional catalog version information included, and derivations that include timeSlice as the affected entity, the batch job gets the catalog grouped by the affected time slices that were populated during the Derive Entity batch job. For those time slices, the effective time slice date of the first time slice and the effective time slice end date of the last time slice for that catalog become the boundary effectivity time. For example, the boundary effectivity time can consist of the cache effective start and end times for which the version info generator batch job ran and created new time slices, versionInfo, and time slice info cache data. The subsequent batch jobs, dataProfile, eligibility, and getOffers, use the same cache effective start and end times as its boundary. Those batch jobs also use the new time slice information generated by the version info generator as the time slices on which to operate and cache the corresponding data. # Regenerate Offer Level Cache Data The offer level batch jobs get the type of changes for a given offer, sequence those change types in a defined manner, initialize a batch job for an offer, and process the input. For a derived offer change entry and the types of changes, the system determines if there is cache data present in the cached API response table. If the data is not present, the system operates in generate mode where it generates the cache data and caches it in the cached API response table. If cache data is present, the system operates in regenerate mode where it regenerates the cache entry and caches it in the cached API response table. In regenerate mode, the system also checks for the cached baskets that were impacted by the change and need to be regenerated. The system forms a chain of baskets and starts regenerating them. The system forms the same sequence of operations on the baskets to reach the same basket state. With versioning enabled, the offer level regenerates batch job caters to the regeneration of specific versions of the offer according to the derived entries present in the cached API response. If the change in the hierarchy of the offer results in an inconsistent cached time-sliced hierarchy and offer details effectivity, for example, if the version effective start and end date for a child product have been changed, then a grandchild product becomes effective. This change object for that root product now consists of the time slices that are affected. The start time of the earliest time slice and end time of the last time slice becomes the boundary cache effectivity times and hierarchy. The offer details are regenerated according to these time slices. # Register Changes Change registration happens whenever there is any change made on the SObject(s) to which cache management listens. There are triggers on the objects that capture the ID of the objects that were changed and register those changes in the cached API change table. A bulk insertion occurs if there are changes from a data upload, data migration, etc. The registration step only captures the changed object ID. False change captures are prevented with a pre-hook to the cachedAPIChange implementation class and custom logic that acts on the old data and on the new data. With versioning enabled, the change capture mechanism remains as it is with the change object ID getting populated in the cached API change table with the change type as data. This data is then used by the Regenerate batch jobs. ![Cache Regeneration - Register Changes](https://developer.salesforce.com/docs/media/dc_registerchanges.png) # Relies On Product Relationships in Industries CPQ This section provides information about _Relies On_ relationship capability within Industries Configure, Price, Quote (CPQ). Linear Relationship (“Relies On”) is an alternative product modeling approach to avoid the complexity of hierarchical product modeling. In hierarchical product design, related products are grouped using a parent-child relationship, where child products are implicitly dependent on other products within the hierarchy. In contrast, the Linear Design approach doesn't tightly couple products within a hierarchy. Instead, products are defined simply, with linear relationships indicating dependencies (also known as "Relies On") on other products. **note:** - When a Relies On product relationship is configured between two products, adding the source product will not automatically add the related product. - Attribute propagation for Relies On or linear relationships works only with Standard Cart APIs in Industries CPQ. When a Relies On relationship is set, the system creates an OrderProductRelationship during `postCartsItems.PostInvoke`. As a result, attribute propagation doesn't occur during the initial CPQ API call. However, any follow-up CPQ API call with `price=true` —such as `getCartsItems`—will propagate the attribute values. Customers can trigger this by adding a pricing call at the end of `postCartsItems.PostInvoke` or through a separate API call. ## Configure Relies On Relationship APIs - Use Relies On Relationship APIs from the CPQ Cart for establishing the relationship between two related products defined using the Relies On type advanced rule. - Relationships are then stored in the Order Product Relationship or Quote Product Relationship depending upon the type of Cart. - To achieve this, perform the following. 1. From the Developer Console, click **File > New > Apex Class**. 2. Create a new class with the name `CPQAppHandlerHookImplementation`. 3. Copy the following code and add it to newly created `CPQAppHandlerHookImplementation` class. ``` /** * @description : * This Hook is written to add support for ESM's ReliesOn Relationships APIs on CPQ Cart * In this class we are writing hook on postCartsItems.PostInvoke and deleteCartsItems.PreInvoke * postCartsItems.PostInvoke => it covers services like, finding relationships that are eligible to be added based on XLI added to the cart * it also links the qualified relationhips and discards the relationships which are already added * it also does the verification if the Relationship's max cardinality is violated, only links when its not violated * * deleteCartsItems.PreInvoke => this hook is used to delete the linked relationship if the corresponding XLI's relationship exits and is deleted * * @author : chandel.gupta@salesforce.com */ global with sharing class CPQAppHandlerHookImplementation implements vlocity_cmt.VlocityOpenInterface { private vlocity_cmt.VOIInvoker invoker = vlocity_cmt.VOIInvoker.getInstance(); private vlocity_cmt.VlocityOpenInterface appHandler = (vlocity_cmt.VlocityOpenInterface)invoker.invoke('B2BCmexAppHandler', 'debugCreate', null, null, null); global Boolean invokeMethod(String methodName, Map input, Map output, Map options) { try { System.debug('CPQAppHandlerHook method ' + methodName); if(methodName == 'postCartsItems.PostInvoke') { postCartsItemsPostInvoke(input,output,options); } else if(methodName == 'deleteCartsItems.PreInvoke') { deleteCartsItemsPreInvoke(input,output,options); } return true; } catch (Exception ex) { System.debug('--- Exception: ' + ex.getMessage()); System.debug('--- Stack Trace: ' + ex.getStackTraceString()); throw ex; } } public void deleteCartsItemsPreInvoke(Map input, Map output, Map options) { System.debug('deleteCartsItemsPreInvoke method '); Map inputDelRel = new Map(); Map outputDelRel = new Map(); Map optionsDelRel = new Map(); String cartId = (String)input.get('cartId'); String lineItemToDel = (String)input.get('id'); String methodName = 'deleteOrderItemRelationships'; inputDelRel.put('cartId', cartId); inputDelRel.put('lineItemId', lineItemToDel); //remote action invocation //vlocity_cmt.B2BCmexAppHandler appHandler = new vlocity_cmt.B2BCmexAppHandler(); appHandler.invokeMethod(methodName, inputDelRel, outputDelRel, optionsDelRel); System.debug(JSON.serialize(outputDelRel)); } public void postCartsItemsPostInvoke(Map input, Map output, Map options) { System.debug('postCartsItemsPostInvoke method '); Map inputRel = new Map(); Map outputRel = new Map(); Map optionsRel = new Map(); String cartId = (String)input.get('cartId'); String methodName = 'getCartProductRelationship'; inputRel.put('cartId', cartId); //inputRel.put('source', 'ENTERPRISE_CART'); //inputRel.put('rootItemId', null); //inputRel.put('getOnlyRootItems', 'true/false'); //remote action invocation //vlocity_cmt.B2BCmexAppHandler appHandler = new vlocity_cmt.B2BCmexAppHandler(); appHandler.invokeMethod(methodName, inputRel, outputRel, optionsRel); System.debug(JSON.serialize(outputRel)); Map xlisMap = new Map([SELECT Id, vlocity_cmt__AssetReferenceId__c, vlocity_cmt__Product2Id__c, vlocity_cmt__Product2Id__r.Name FROM OrderItem WHERE Order.Id = :cartId]); List prodRelRules = (List) outputRel.get('ProductRelationship'); // map to hold record of existing quantity of the relationships that are already linked Map existingOPRelQtyMap = new Map(); Map orderProdRelsMap = new Map(); //converting List of XLI Relationships to Map, and forming Map that holds quantity of relationships that are already added for(vlocity_cmt__OrderItemRelationship__c opr : (List)outputRel.get('OrderProductRelationship')) { orderProdRelsMap.put(opr.vlocity_cmt__OrderItemId__c + ';' + opr.vlocity_cmt__RelatedOrderItemId__c, opr); existingOPRelQtyMap.put(opr.vlocity_cmt__OrderItemId__c + ';' + opr.vlocity_cmt__RelatedOrderItemId__r.Product2Id + ';' + opr.vlocity_cmt__ProductRelationshipIdentifier__c, (opr.vlocity_cmt__RelatedOrderItemId__r.Quantity).intValue()); } System.debug(JSON.serialize(orderProdRelsMap)); System.debug(JSON.serialize(existingOPRelQtyMap)); Map> xliToRelProdListMap = new Map>(); Map relProdIdToProdRelMap = new Map(); // map to hold record of the quantity of the relationships that are to be linked Map toBeLinkedOPRelQtyMap = new Map(); Map orderItemRelProdToRuleIdMap = new Map(); for(Id xliId : xlisMap.keySet()) { OrderItem xli = (OrderItem) xlisMap.get(xliId); for(vlocity_cmt__ProductRelationship__c prodRelRule : prodRelRules) { // forming "One to Many" relationship between XLI and Related Products if(xli.vlocity_cmt__Product2Id__c == prodRelRule.vlocity_cmt__Product2Id__c) { if(xliToRelProdListMap.get(xli.Id) != null) { List prodRelRuleList = (List) xliToRelProdListMap.get(xli.Id); prodRelRuleList.add(prodRelRule); } else { List prodRelRuleList = new List(); prodRelRuleList.add(prodRelRule); xliToRelProdListMap.put(xli.Id, prodRelRuleList); } // map to hold record of the quantity of the relationships that are to be linked => will be used to validate cardinality violation toBeLinkedOPRelQtyMap.put(xliId + ';' + prodRelRule.vlocity_cmt__RelatedProductId__c + ';' + prodRelRule.Id, 1); orderItemRelProdToRuleIdMap.put(xliId + ';' + prodRelRule.vlocity_cmt__RelatedProductId__c, prodRelRule.Id); } // forming relationship between RelatedProduct and Related XLI to be used for Linking XLIs if(xli.vlocity_cmt__Product2Id__c == prodRelRule.vlocity_cmt__RelatedProductId__c ) { relProdIdToProdRelMap.put(prodRelRule.vlocity_cmt__RelatedProductId__c, new Map { prodRelRule.Id => new List>{ new Map{ 'id' => xli.Id, 'assetReferenceId' => xli.vlocity_cmt__AssetReferenceId__c, 'relatedProductId' => prodRelRule.vlocity_cmt__RelatedProductId__c } }}); } } } // return if no related lineitem to link to in the cart if(relProdIdToProdRelMap.size() <= 0) return; // forming map "maxCardinalityMap" with key and value as => "orderItemId;relatedProdId;ruleId => max_qty", to know the max cardinality the rule supports // e.g 802xx000001ncoeAAA;01txx0000006i8wAAA;a3Sxx0000004C92EAE => 6 Map maxCardinalityMap = new Map(); Map> lineItemListOfLinkagesMap = new Map>(); for(Id xliId : xliToRelProdListMap.keySet()) { List xliRelProdList = (List) xliToRelProdListMap.get(xliId); for(vlocity_cmt__ProductRelationship__c xliRelProd : xliRelProdList) { if(relProdIdToProdRelMap.get(xliRelProd.vlocity_cmt__RelatedProductId__c) != null) { if(lineItemListOfLinkagesMap.get(xliId) != null) { List xliLinkagesList = (List) lineItemListOfLinkagesMap.get(xliId); xliLinkagesList.add(relProdIdToProdRelMap.get(xliRelProd.vlocity_cmt__RelatedProductId__c)); } else { List xliLinkagesList = new List(); xliLinkagesList.add(relProdIdToProdRelMap.get(xliRelProd.vlocity_cmt__RelatedProductId__c)); lineItemListOfLinkagesMap.put(xliId, xliLinkagesList); } } //Map relationshipMap = (Map) relationship; String orderItemId = xliId; String relatedProdId = (String) xliRelProd.vlocity_cmt__RelatedProductId__c; String ruleId = (String) xliRelProd.Id; Decimal maxQuantity = (Decimal) xliRelProd.vlocity_cmt__MaxQuantity__c; maxCardinalityMap.put(orderItemId + ';' + relatedProdId + ';' + ruleId, maxQuantity.intValue()); } } System.debug(JSON.serialize(xliToRelProdListMap)); System.debug(JSON.serialize(relProdIdToProdRelMap)); System.debug(JSON.serialize(lineItemListOfLinkagesMap)); System.debug(JSON.serialize(maxCardinalityMap)); System.debug(JSON.serialize(existingOPRelQtyMap)); System.debug(JSON.serialize(toBeLinkedOPRelQtyMap)); System.debug(JSON.serialize(orderItemRelProdToRuleIdMap)); // linking LineItems based on defined "ReliesOn" relationships for(Id xliId : lineItemListOfLinkagesMap.keySet()) { Map linkItemInput = new Map(); Map linkItemOutput = new Map(); for(Object xliLinkages : lineItemListOfLinkagesMap.get(xliId)) { Id linkedRelXliId = (Id) ((Map)((List) JSON.deserializeUntyped((String)JSON.serialize(((Object) ((Map) JSON.deserializeUntyped((String)JSON.serialize(xliLinkages))).values().get(0))))).get(0)).get('id'); Id linkedRelProdId = (Id) ((Map)((List) JSON.deserializeUntyped((String)JSON.serialize(((Object) ((Map) JSON.deserializeUntyped((String)JSON.serialize(xliLinkages))).values().get(0))))).get(0)).get('relatedProductId'); Id ruleId = orderItemRelProdToRuleIdMap.get(xliId + ';' + linkedRelProdId); // Add relationship only when relationship is not already linked also check if the Rule's max cardinality is violated or not, // link only when it's not violated, else throw soft warning message in the response if(!(orderProdRelsMap.get(xliId + ';' + linkedRelXliId) != null)) { String key = xliId + ';' + linkedRelProdId + ';' + ruleId; Integer maxCardinality = maxCardinalityMap.get(key) == null ? 0 : maxCardinalityMap.get(key); Integer existingCardinality = existingOPRelQtyMap.get(key) == null ? 0 : existingOPRelQtyMap.get(key); Integer toBeAddedCardinality = toBeLinkedOPRelQtyMap.get(key) == null ? 0 : toBeLinkedOPRelQtyMap.get(key); System.debug('maxCardinality => ' + maxCardinality + ' existingCardinality => '+ existingCardinality + 'toBeAddedCardinality => ' + toBeAddedCardinality); if(existingCardinality + toBeAddedCardinality > maxCardinality) { System.debug('Max cardinality limit for the rule : ' + ruleId + ' is violated for OrderItem : ' + xliId + ' and Related OrderItem' + linkedRelXliId); vlocity_cmt.JSONResult result = (vlocity_cmt.JSONResult) output.get('result'); String message = 'Max cardinality limit for the rule : ' + ruleId + ' is violated for OrderItem : ' + xliId + ' and Related OrderItem : ' + linkedRelXliId; //vlocity_cmt.JSONMessage jsonMessage = new vlocity_cmt.JSONMessage('422', vlocity_cmt.JSONMessage.Severity.WARN, message); //result.messages.add(jsonMessage); } else { System.debug('Qualified to be added : ' + xliId + ';' + linkedRelXliId ); Map lineItemLinkageMap = new Map{xliId => xliLinkages}; // Setting remote parameters linkItemInput.put('cartId', cartId); linkItemInput.put('LineItemLinkage', lineItemLinkageMap); //remote action invocation appHandler.invokeMethod('linkProductsForOrder', linkItemInput, linkItemOutput, new Map()); } } else { System.debug('Disqualified to be added, as relationship already exists : ' + xliId + ';' + linkedRelXliId ); } } } } } ``` 1. Create a new interface with the name `CpqAppHandlerHookInterface` and with the following configuration. ![CPQ Handler](https://developer.salesforce.com/docs/media/CPQAppHandlerHookInterface.png "CPQ Handler") The `CPQAppHandlerHookImplementation` class invokes the following methods. - **`postCartsItems.PostInvoke`** This method is invoked whenever a new offer is added to the cart. Based on the newly added product and already existing products in the cart, following variables are important. - orderProdRelsMap: Contains existing OrderProductRelationship that are already linked and ProductRelationship list that can be linked. - xliToRelProdListMap: Contains against each lineitem, which all "Related Product(s)" exist in the Cart. - lineItemListOfLinkagesMap: Contains the relationships that are eligible to be added if not already added. - **`deleteCartsItems.PreInvoke`** This method is invoked whenever the LineItem is deleted, and if that LineItem contains any added Relies On Relationship in the cart already, then respective relationship is deleted. - lineItemToDel: Contains the LineItem on which delete operation is invoked and for which existing relationship(s) needs to be deleted. ### Remote Methods Following remote methods are used. #### GetCartProductRelationship This method fetches relationships based on XLIs present in the Order/Quote. This response contains the following. - OrderProductRelationship: Linked Order Product Relationships - QuoteProductRelationship: Linked Quote Item Relationships - ProductRelationship: List of eligible Relies On Relationships that can be linked ``` Map input = new Map(); Map output = new Map(); Map options = new Map(); // Setting remote parameters String methodName = 'getCartProductRelationship'; input.put('cartId','801xx000003GssBAAS'); //input.put('getOnlyRootItems', 'true/false'); => optional //remote action invocation vlocity_cmt.B2BCmexAppHandler appHandler = new vlocity_cmt.B2BCmexAppHandler(); // output map will contains the response appHandler.invokeMethod(methodName, input, output, options); ``` #### LinkProducts This method inks relationships between XLIs and related XLIs present in the Order/Quote. This response contains the linked relationship, based on the type of Cart (Order/Quote). - Method Name for Order type Cart: `linkProductsForOrder` - Method Name for Quote type Cart: `linkProducts` **Sample Request** ``` { "LineItemLinkage": { "802SG0000030Ctt": { // LineItem => order product with rule "a4FSG00000IPkII": [ // Product Relationship Rule Id { "id": "802SG0000030Ctv", // LineItem => order product with rule => aplies to "assetReferenceId": "d30901b4-08eb-46c2-87be-4c51338b9156" } ] } }, "cartId": "801SG00000Dq4w5" } ``` **Sample Response** ``` { "Response": { "error": "OK", "errorCode": "INVOKE-200", "relationsDeleted": {}, "relationsAdded": [ { "devopsimpkg19__RelatedOrderItemId__r": { "Product2": { "RecordTypeId": "012SG000001MSuGYAW", "Id": "01tSG000000NCtLYAW", "Name": "PRODUCT-ABP-CHILD2", "attributes": { "url": "/services/data/v61.0/sobjects/Product2/01tSG000000NCtLYAW", "type": "Product2" } }, "Id": "802SG0000030CtvYAE", "Product2Id": "01tSG000000NCtLYAW", "attributes": { "url": "/services/data/v61.0/sobjects/OrderItem/802SG0000030CtvYAE", "type": "OrderItem" } }, "Id": "a3cSG0000007bNpYAI", "devopsimpkg19__RelatedAssetReferenceId__c": "d30901b4-08eb-46c2-87be-4c51338b9156", "devopsimpkg19__RelationshipType__c": "ReliesOn", "devopsimpkg19__RelatedOrderItemId__c": "802SG0000030CtvYAE", "devopsimpkg19__OrderItemId__c": "802SG0000030CttYAE", "devopsimpkg19__OrderId__c": "801SG00000Dq4w5YAB", "devopsimpkg19__ProductRelationshipIdentifier__c": "a4FSG00000IPkII", "Name": "a3cSG0000007bNp", "attributes": { "url": "/services/data/v61.0/sobjects/devopsimpkg19__OrderItemRelationship__c/a3cSG0000007bNpYAI", "type": "devopsimpkg19__OrderItemRelationship__c" } } ] } } ``` #### GetAddedRelatedLineItemQuantity This method fetches already linked rules quantity for a given XLI present in the Order/Quote. This response contains the following. - Method Name for Order type Cart: `getAddedRelatedLineItemQuantityForOrder` - Method Name for Quote type Cart: `getAddedRelatedLineItemQuantity` ``` Map input = new Map(); Map output = new Map(); Map options = new Map(); // Setting remote parameters String methodName = 'getAddedRelatedLineItemQuantityForOrder'; input.put('cartId','801xx000003GssBAAS'); input.put('orderItemId', 'xliId'); //802SG0000030CsHYAU //remote action invocation vlocity_cmt.B2BCmexAppHandler appHandler = new vlocity_cmt.B2BCmexAppHandler(); appHandler.invokeMethod(methodName, input, output, options); ``` Response contains the information same as what is inserted in sObjects `OrderProductRelationship` / `QuoteProductRelationship`. ``` {"ruleIdToQuantityMap":{"a3Sxx0000004EHIEA2":1.0}} ``` #### DeleteOrderItemRelationship This method deletes the already linked relationships when XLI is deleted from the Order/Quote. This response contains the following. - Method Name for Order type Cart: `deleteOrderItemRelationships` - Method Name for Quote type Cart: `deleteQuoteLineItemRelationships` ``` Map input = new Map(); Map output = new Map(); Map options = new Map(); // Setting remote parameters String methodName = 'deleteOrderItemRelationships'; input.put('cartId','801xx000003GssBAAS'); input.put('lineItemId', 'xliId'); //802SG0000030CsHYAU //remote action invocation vlocity_cmt.B2BCmexAppHandler appHandler = new vlocity_cmt.B2BCmexAppHandler(); appHandler.invokeMethod(methodName, input, output, options); ``` # Remove a Promotion from a Basket The [DeleteServices](https://help.salesforce.com/s/articleView?id=ind.comms_t_cpq_configuration_settings_reference_148927.htm&type=5) configuration setting determines whether line items are deleted. Setting DeleteServices to No prevents line items from being deleted while setting DeleteServices to Yes allows line items to be deleted. If there is an asset on which a promotion is already applied and you convert that asset into a basket using assetToBasket operation, and if you want to remove the existing promotion (whose Action is Change) from this basket, then in the request payload you must make the following changes for the promotion cancellation to take effect: `Rest End Point :: POST /v3/catalogs/{CATALOGCODE}/basket/{CartContextKey}?context={"accountId":"02i4P000009ion5QAA”}&isloggedin=true` In addition, when deleting a promotion from a basket, the following parameters are available: - basketAction = The action to perform, such as DeleteFromBasket. - offer = promotion code to delete. - appliedAction: The action of the applied promotion (Apply, Add, or Existing). - bundleContextKey: The bundle context key from which a child product needs to be deleted. If a basket includes multiple promotions of the same type applied to a similar product object, include the bundleContextKey parameter in the delete promotion call. This parameter is supported by CME Winter '20 and later releases. - cancellationDate: The cancellation date for a promotion in the case of a MACD order. - cancellationReason: The reason for the cancellation of the promotion in the case of MACD order. The following is an example of removing a promotion from a basket: ```nolang POST /services/apexrest/{namespace}/catalogs/{catalog_code}/basket/{basket_key}?context={"accountId":"account_ID"}&isloggedin=true Request body: { "basketAction":"deleteFromBasket", "offer":"promotion_code", "appliedAction":"Add", "bundleContextKey":"bundle_context_key", "cancellationDate": "2021-08-19T16:33:21.080Z", "cancellationReason": "No longer needed" } ``` # Remove Items from a Cart ## Overview The Delete Cart Items API (deleteCartsItems) removes one or more line items, stand-alone products, bundle members, auto-added promotions, or legacy asset rows, from a Cart (Quote/Order/Opportunity). Beyond the physical removal of rows, the call automatically: - Cascades through bundle hierarchies (removing empty parents). - Preserves or deletes promotions, depending on org policy. - Re-evaluates bundle cardinality and, optionally, full pricing and validation rules so totals remain consistent. - Returns deterministic success/error codes in a structured messages[] array. ## Typical Use Cases - CSR Dashboards / CPQ Console – Agents undo mis‑clicks in real time; pricing/validation flags are set to true to keep the UI totals trustworthy. - Self‑Service Portals – Shoppers remove add‑ons with price = false for latency; a later batch re‑prices the cart. - Guided Selling Swaps – OmniScript deletes an obsolete SKU, then immediately adds the successor product in the same transaction. - Nightly ETL Pruning – A middleware script processes 50 Ids at a time to guarantee all‑or‑nothing deletes. ## Key Benefits ### 1. Atomic Consistency UOWMode shield prevents half‑processed batches, either every Id is removed or none. ### 2. Promotion Awareness Built‑in guard rails ensure promotions remain fulfilled; or, when configured (DELETE_APPLIED_PROMO, DELETE_PROMO_ADDED_ITEMS), they’re cascaded out automatically. ### 3. Rule Enforcement Internal logic reruns min/max logic and aborts if bundle limits would be breached (returns code 302 on failure). ### 4. Pluggable Engines Flags let callers pay the CPU cost of Pricing/Validation only when needed. ### 5. Asset‑Aware Identifiers Optional UseAssetReferenceIdForParentAndRoot switch allows "amend" journeys to address Assets even when the original Salesforce Ids have changed. ## Limitations & Caveats - Hard Delete Only – The API performs disconnects which can’t be undone without an explicit add call. - Promotion Guard is Opinionated – If a delete would leave a promotion under‑fulfilled and DELETE_APPLIED_PROMO = false, the whole call fails with error 406. - Row Ownership – Items locked by an in‑flight pricing job (row‑level lock) will cause a retryable database exception; clients should implement exponential back‑off. - Partial Bundles – Deleting a parent without children Ids when collapse empty parents is disabled will result in orphan rows; ensure hierarchy handling settings ( hierarchy=-1) are correct. ## Performance & Scalability | Scenario | Median Latency | Notes | | -------------------------------- | -------------- | --------------------------------------- | | 1 Line, price=false | < 300 ms | Avoids engine invocation. | | 10 Lines, price=true | ~1 s | Includes full Reprice + Advanced Rules. | | 50 Lines, batch + validate=false | ~1.2 s | Document layer bulk‑optimises DML. | ## Security & Compliance - Enforced by standard Salesforce CRUD/FLS on LineItem and Cart objects. - All writes run inside Queueable Apex context, inheriting the integration user’s profile and OWD. - The REST endpoint is covered by API Only User permission—lock down via named credentials for off‑platform integrations. ``` DELETE /v2/cpq/carts/{cart_Id}/items?id={line_item_id} ``` **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. Delete Items replaces the OmniCPQServiceWrapper `deleteItem` method. 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. ## Rest Handler ``` APIItemsCartsCpqV2 ``` ## Rest Method ``` deleteCartsItems ``` ## Remote Service ``` CpqAppHandler ``` ## Remote Method ``` deleteCartsItems ``` ## Apex Remote Input Map ``` Map inputMap = new Map{ 'cartId' => '{CART_ID}', 'id' => '{LINE_ITEM_ID}', 'validate' => true, 'price' => true }; Map outputMap = new Map(); Map optionsMap = new Map(); CpqAppHandler handler = new CpqAppHandler(); handler.invokeMethod('deleteCartsItems', inputMap, outputMap, optionsMap); ``` **note:** In releases prior to CME Spring '20, the deleteCartsItems method supports the deletion of one item at a time. If you must delete multiple items, make multiple deleteCartsItems calls. With CME Spring '20 and later releases, the itemId parameter supports multiple comma-separated values when deleting root and child items via deleteCartsItems method calls if UOWMode is set to true. ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | ------------------------------------------------------------------------- | | Resource URL | `/services/apexrest/{namespace}/v2/cpq/carts/{cart_Id}/items?id={itemId}` | ## Example Request ``` DELETE /services/apexrest/vlocity_cmt/v2/cpq/carts/80141000000Cg8H/items?id=802xx000001nsbfAAA,802xx000001nsbgAAA ``` ## Example Response ``` { "totalSize": 0, "messages": [{ "code": "152", "severity": "INFO", "message": "Successfully deleted." }], "actions": { "itempricesupdated": { "remote": { "methodName": "getCartLineItemPrices", "params": {"cartId":"801xx000003H0D1AAK","price":false} } } } } ``` # Remove Items from Cart Delete the specified items from the cart. When products are bundled, the API deletes the child items. Returns error in case of cardinality failures or any other failures. ```nolang DELETE /v2/cpq/carts/{cart_ID}/items ``` **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. Delete Items replaces the OmniCPQServiceWrapper `deleteItem` method. 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 ```nolang deleteCartsItems ``` **note:** In releases prior to CME Spring '20, the deleteCartsItems method supports the deletion of one item at a time. If you must delete multiple items, make multiple deleteCartsItems calls. With CME Spring '20 and later releases, the itemId parameter supports multiple comma-separated values when deleting root and child items via deleteCartsItems method calls if UOWMode is set to true. ## REST Handler ```nolang APIItemsCartsCpqV2 ``` ## Apex Remote Service ```nolang CpqAppHandler ``` ## Apex Remote Input Map ```nolang { methodName:deleteCartsItems, cartId:801360000008eNU, id:01t36000000pfcKAAQ } id = orderLineItem.Id, quoteLineItem.Id, opportunityLineItem.Id ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | ---------------------------------------------------------------------- | | Resource URI | `/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/items/{itemId}` | ## Example Request ```nolang DELETE /services/apexrest/vlocity_cmt/v2/cpq/carts/80141000000Cg8H/items/80241000000Ha4a ``` ## Example Response ```nolang { "totalSize": 0, "messages": [{ "severity": "INFO", "messageId": null, "message": "Successfully deleted.", "code": "152", "actions": {} }], "actions": { "deletecart": { "rest": { "params": {}, "method": null, "link": null }, "remote": { "params": {} }, "client": { "params": { "items": [{ "message": "Root 1 has been deleted from the cart. ", "Id": "80241000000Ha4aAAC" }], "mode": "DELETE" } } } } } ``` # removeGroups Method Deletes a list of groups and their members. ## Class ## Input Parameters | Parameter | Required | Description | | --------- | --------------------------- | -------------------------------------------------------- | | contextId | Required | Parent cart ID (Master or Enterprise quote or order ID). | | groupIds | Required | List of group IDs to be deleted. | | cartType | Optional, defaults to Quote | Quote or order. | ## Output Parameters | Parameter | Description | | --------- | --------------------- | | message | In case of any error. | ## Example Input Data ``` {"contextId":"0Q00b000000znTYCAY","groupIds":["a4M0b000002CWMGEA4"],"cartType":"Quote"} ``` ## Example Output Data ``` {"error":"OK"} ``` # Replace OffersAdd commentMore actions The `replaceOffers` API enables the replacement of an assetized product (source product) with another product from the same product family (target product) within an order or quote. This process preserves attributes, child products, and specific fields from the original order line item (OLI) during the replacement. **Key Features:** - **Source and Target Product Replacement:** - The target product must belong to the same product family as the source product. - Attributes from the source product are copied to the target product if they match. - **Child Product Handling:** - Common child products between source and target are copied, including their quantity and attribute configuration. - Optional child products present in the source are added to the target during replacement. - Optional child products can be nested within the product bundle hierarchy. - **Line Item Field Copying:** - Both standard and custom fields can be copied from the source to the target line item. - Field settings must be configured under the feature name `COPFieldsToCopyDuringReplace`. - **Copying Line Item Properties:** - Transfers relevant attributes and fields from the source item to the target item. - Mandatory fields are always copied, including those defined under `COPFieldsToCopyDuringReplace`. - **Addition of Optional Line Items:** - Optional line items in source and target bundles are automatically added under the target bundle if present in the source. 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 ```nolang replaceOffers ``` ## REST Handler ```nolang APIReplaceOffersCartsCpqV2 ``` ## REST Method ```nolang replaceOffers ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see [Cart-Based API Swagger Reference](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information - **Resource URL:** `/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/offermigration/replacement` - **HTTP Method:** POST - **Content-Type:** application/json - **Response Format:** JSON ## Example REST Request ```http POST /v2/cpq/carts/{cart_ID}/offermigration/replacement Content-Type: application/json { "attributeCodesToCopyDuringReplace": [ "CMT-9413-4", "CMT-9413" ], "price": true, "targetOfferIdToItemIds": "01uf40000039ps9AAA:802f400000Pxl2mAAB_802f400000Pul2mAAB" } ``` ## Example REST Response ```nolang { "actions": { "itempricesupdated": { "client": { "params": {} }, "remote": { "params": {} }, "rest": { "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/801xx000003H57rAAC/price?price=false&cartId=801xx000003H57rAAC", "params": {} } } }, "messages": [ { "message": "Replacement applied successfully", "code": "830", "severity": "INFO" } ], "totalSize": 0 } ``` # Request Bodies Use these request representations with the Advanced Order Business APIs. - [Advanced Order — Assortment Input](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-rest/requests/advanced-order-assortment-input.md) - [Advanced Order Product List Input](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-rest/requests/advanced-order-product-list-input.md) - [Product API Configuration Options](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-rest/requests/product-api-configuration-options.md) - [Advanced Order Product Search Input](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-rest/requests/advanced-order-product-search-input.md) - [Advanced Order Product Recommendation Input](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-rest/requests/advanced-order-product-recommendation-input.md) - [Advanced Order Delivery Date Input](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-rest/requests/advanced-order-delivery-date-input.md) - [Get Instant Pricing Input](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-rest/requests/get-instant-pricing-input.md) - [Place Advanced Order Input](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-rest/requests/place-advanced-order-input.md) # Request Bodies Use these request representations with the Penny Perfect Pricing Business APIs. - [Flatten Account Internal Organization Unit Hierarchy Input](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/penny-perfect-pricing-rest/requests/flatten-account-iou-hierarchy-input.md) # Resources The Advanced Order Business APIs provide these resources. - [Assortments (POST)](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-rest/resources/assortments.md) - [Products (POST)](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-rest/resources/products.md) - [Product Search (POST)](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-rest/resources/product-search.md) - [Historical Products (POST)](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-rest/resources/historical-products.md) - [Order Delivery Date (POST)](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-rest/resources/order-delivery-date.md) - [Get Instant Price (POST)](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-rest/resources/get-instant-price.md) - [Place Order (POST)](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-rest/resources/place-order.md) # Resources The Penny Perfect Pricing Business APIs provide these resources. - [Flatten Account Internal Organization Unit Hierarchy (POST)](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/penny-perfect-pricing-rest/resources/flatten-account-iou-hierarchy.md) # Response Bodies Use these response representations with the Advanced Order Business APIs. - [Assortment Output](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-rest/responses/assortment-output.md) - [Assortment Item](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-rest/responses/assortment-item.md) - [Assortment Product](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-rest/responses/assortment-product.md) - [Advanced Order Product List Output](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-rest/responses/advanced-order-product-list-output.md) - [Category Hierarchy Output](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-rest/responses/category-hierarchy-output.md) - [Category Path Node Output](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-rest/responses/category-path-node-output.md) - [Advanced Order Product Search Output](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-rest/responses/advanced-order-product-search-output.md) - [Advanced Order Product Recommendation Output](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-rest/responses/advanced-order-product-recommendation-output.md) - [Advanced Order Product Recommendation Item](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-rest/responses/advanced-order-product-recommendation-item.md) - [Advanced Order Recommended Quantity](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-rest/responses/advanced-order-recommended-quantity.md) - [Advanced Order Delivery Date Output](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-rest/responses/advanced-order-delivery-date-output.md) - [Delivery Date Range](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-rest/responses/delivery-date-range.md) - [Nonworking Days Configuration](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-rest/responses/nonworking-days-configuration.md) - [Get Instant Pricing Output](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-rest/responses/get-instant-pricing-output.md) - [Place Advanced Order Output](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-rest/responses/place-advanced-order-output.md) - [Assortment Error](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-rest/responses/assortment-error.md) - [Order Product Spec Listing Behaviour](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-rest/responses/order-product-spec-listing-behaviour.md) # Response Bodies Use these response representations with the Penny Perfect Pricing Business APIs. - [Flatten Account Internal Organization Unit Hierarchy Output](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/penny-perfect-pricing-rest/responses/flatten-account-iou-hierarchy-output.md) - [Flatten Account Internal Organization Unit Hierarchy Failed Record](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/penny-perfect-pricing-rest/responses/flatten-account-iou-failed-record.md) # Response Format for Cart-Based APIs API responses for the Cart-based APIs permit a structured interaction between the requesting entities and back-end operations and are composed of objects wrapped in a result object. The wrapper object used is represented by a JSONResult class while most result records are represented by the JSONRecord base class. Based on every specific API, the records construct or JSONRecord can represent a different physical database record or a unit of information. The JSONRecord construct supports a hierarchical representation of the data when required, which is accomplished through the use of the nameResult property of the JSONRecord class. The following table lists the wrapper classes. Note that not all listed properties are used by each vertical. | Apex Class Name | Parent Class | Description | Properties | | --------------- | ------------ | -------------------------------------------------------- | ---------- | | JSONAttribute | JSONRecord | Represents a single product attribute and its properties |
    |
  • dataType: The data type of the attribute to indicate which native type this attribute accept: Integer, Boolean, String, Date, Datetime and so on.
  • inputType: The UI display of the attribute. This indicates whether an attribute should be rendered as a radio, checkbox or input box and so on.
  • multiselect: Flag to indicate if this is a multiselection.
  • values: List of possible values.
  • required: Specifies the required flag.
  • readonly: Specifies the read-only flag.
  • placeholder: Specifies the placeholder.
  • maxlength: Specifies the maxlength.
  • minlength: Specifies the minlength.
  • min: Specifies the min.
  • max: Specifies the max.
  • pattern: Specifies the pattern.
  • autocomplete: Specifies the autocomplete flag.
  • step: Specifies the step.
  • attributeId: Specifies the attributeId.
  • label: Specifies the label.
  • formatMask: Specifies the formatMask.
  • hasRules: Specifies the hasRules flag.
  • customTemplate: For custom rendering of the Attribute (such as Buttons)
  • disabled: Same as readonly.
  • hidden: Specifies the hidden flag.
  • filterable: Specifies the filterable flag.
  • cloneable: Specifies the cloneable flag.
  • description: Specifies the value description.
  • userValues: Specifies selected values.
  • isRatingAttribute: Specifies the isRatingAttribute flag.
  • code: Specifies the code.
  • rules: Specifies the list rules.
  • isNotTranslatable: Specifies the isNotTranslatable flag.
| |JSONCategory|JSONRecord|Represents a single product attribute category and its properties.|
  • id: The ID of the record.
  • name: The name of the record.
  • childCategories: The list of the child categories.
| |JSONRecord|N/A|A value object that represents a record. A record can be an attribute, product, order, quote, opportunity or line item.|
  • messages: Informational, warning, or error message associated with this result.
  • actions: Remote action or API that are associated with this result. For example, the action for attributes filtering will be search product.
  • fields: A map of name and value for fields. For example: CategoryCode__c:"Installation", CategoryCodeId:"801360000000oQ9"
  • nameResult: A map that contains the child JSONResult. For example, the root product JSONResult will contain a list of product records. Each record will contain a nameResult of child product result.
  • promotion: Promotion child products results
  • displaySequence: The display sequence of that record.
| |JSONAttribute.JSONValue|N/A|Represents a single Product Attribute Value.|
  • name: Unique name of the value.
  • label: Display label of the value that could be used in dropdown, checkbox or radio button.
  • value: The value that will be stored.
  • defaultValue: Default value.
  • selected: Flag to indicate if this is selected or not.
  • defaultSelected: Default selection of the value.
  • readonly: Specifies the read only flag.
  • disabled: Specifies the disabled flag.
  • displaySequence: Specifies the displaySequence.
| |JSONResult|N/A|The main value object that encapsulates API responses.|
  • totalSize: The size of the records. This is the total number, not necessary the same of records.size(). For example, if there are 200 attributes and the number of records being return is 20. The totalSize will be 200. It serves as an indicator to fetch more records.
  • messages: Informational, warning, or error message associated with this result.
  • actions: Remote action or API that are associated with this result. For example, the action for attributes filtering will be search product.
  • records: List of records.
| # Retrieve Details of Items in a Picklist Retrieve the details of items in a picklist by specifying its ID in the resource URI. ```nolang GET v2/epc/picklists/{picklist_ID}/items ``` ## Remote Method ```nolang readPicklistValue ``` ## REST Handler ```nolang APIPicklistItemRestHandler ``` ## Apex Remote Service ```nolang PCAppHandler ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see the [Swagger (OpenAPI) reference documentation for Industries EPC REST APIs](https://developer.salesforce.com/docs/industries/cme/references/epc?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | --------------------------------------------------------------------- | | Resource URL | `/services/apexrest/{namespace}/v2/epc/picklists/{picklist_ID}/items` | ## Example Request ```nolang GET v2/epc/picklists/01t3h000001gyCFAAY/items ``` ## Example Result ``` { "epcResponse": { "entities": [ { "entity": { "attributes": { "type": "Product2", "url": "/services/data/v52.0/sobjects/Product2/01t3h000001gyCFAAY" }, "vlocity_cmt__VersionLabel__c": "Version-1", "Name": "Product-0004", "ProductCode": "Product-0004", "vlocity_cmt__SpecificationType__c": "Offer", "vlocity_cmt__SpecificationSubType__c": "Bundle", "vlocity_cmt__LifecycleStatus__c": "Draft", "vlocity_cmt__GlobalGroupKey__c": "a4096cc5-8bbb-cfd5-7b93-869a7c2b4caf", "RecordTypeId": "0123h000000slEnAAI", "Id": "01t3h000001gyCFAAY", "RecordType": { "attributes": { "type": "RecordType", "url": "/services/data/v52.0/sobjects/RecordType/0123h000000slEnAAI" }, "Id": "0123h000000slEnAAI", "Name": "Product" } } } ], "overallResult": "success" } } ``` # Retrieve Details of Items in a Promotion Retrieve the details of items in a promotion by specifying its ID in the resource URI. ```nolang GET v2/epc/promotions/{promotion_ID}/items/{item_ID} ``` ## Remote Method ```nolang readPromotionItem ``` ## REST Handler ```nolang APIPromotionItemRestHandler ``` ## Apex Remote Input Map ```nolang PCAppHandler ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see the [Swagger (OpenAPI) reference documentation for Industries EPC REST APIs](https://developer.salesforce.com/docs/industries/cme/references/epc?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | --------------------------------------------------------------------------------- | | Resource URL | `/services/apexrest/{namespace}/v2/epc/promotions/{promotion_ID}/items/{item_ID}` | ## Example Request ```nolang GET /v2/epc/promotions/a3K3h0000006Aj3EAE/items/a3J3h000000I4KKEA0 ``` ## Example Result ``` { "epcResponse": { "entities": [ { "entity": { "attributes": { "type": "vlocity_cmt__PromotionItem__c", "url": "/services/data/v52.0/sobjects/vlocity_cmt__PromotionItem__c/a3J3h000000I4KKEA0" }, "Id": "a3J3h000000I4KKEA0", "IsDeleted": false, "Name": "a3J3h000000I4KK", "CurrencyIsoCode": "USD", "CreatedDate": "2021-09-07T06:36:09.000+0000", "CreatedById": "0053h000002UGCUAA4", "LastModifiedDate": "2021-09-07T06:36:09.000+0000", "LastModifiedById": "0053h000002UGCUAA4", "SystemModstamp": "2021-09-07T06:36:09.000+0000", "vlocity_cmt__PromotionId__c": "a3K3h0000006Aj3EAE", "vlocity_cmt__ActionType__c": "Add", "vlocity_cmt__IsActive__c": true, "vlocity_cmt__IsUndoable__c": false, "vlocity_cmt__MaxQuantity__c": 10.00, "vlocity_cmt__MinQuantity__c": 1.00, "vlocity_cmt__ProductHierarchyGlobalKeyPath__c": "20b3380d-5c42-f7db-4508-beff916feee1", "vlocity_cmt__ProductHierarchyGroupKeyPath__c": "f4a0d9e2-d6cd-59f8-8c20-c14298a2f4f2", "vlocity_cmt__ProductHierarchyPath__c": "01t3h000002TMciAAG", "vlocity_cmt__ProductId__c": "01t3h000002TMciAAG", "vlocity_cmt__Quantity__c": 1.00, "vlocity_cmt__UpdateScope__c": "Update Item Only", "vlocity_cmt__GlobalGroupKey__c": "4c1abba7-2ab2-872a-26dc-93bfba985894", "vlocity_cmt__ProductId__r": { "attributes": { "type": "Product2", "url": "/services/data/v52.0/sobjects/Product2/01t3h000002TMciAAG" }, "Id": "01t3h000002TMciAAG", "Name": "India V1.1", "ProductCode": "India V1.1", "vlocity_cmt__VersionLabel__c": "Version - V1.1" }, "vlocity_cmt__PromotionId__r": { "attributes": { "type": "vlocity_cmt__Promotion__c", "url": "/services/data/v52.0/sobjects/vlocity_cmt__Promotion__c/a3K3h0000006Aj3EAE" }, "Id": "a3K3h0000006Aj3EAE", "Name": "Promotion-Example", "vlocity_cmt__PriceListId__c": "a343h000001ACXFAA4", "vlocity_cmt__PriceListId__r": { "attributes": { "type": "vlocity_cmt__PriceList__c", "url": "/services/data/v52.0/sobjects/vlocity_cmt__PriceList__c/a343h000001ACXFAA4" }, "Id": "a343h000001ACXFAA4", "Name": "ShamPriceList" } } } } ], "overallResult": "success" } } ``` # Retrieve OAuth Authorization When the preceding steps are complete, run the **SFDC OAuth Username Password API** from the API collection. This step must be performed every time you start a new session or when the token expires. The API executes a script that auto-populates a unique session token `{{InitAccessToken}}` in the environment variable. After executing, each call uses the token. If the token expires, simply rerun the API call. To run the SFDC OAuth Username Password API: 1. If necessary, start Postman on your computer. 2. If necessary, load the Digital Commerce APIs collection. 3. Select **SFDC OAuth Username Password** and click **Send**. # Retrieve Picklist Details Retrieve the details of an individual picklist by specifying its ID in the resource URI. - ```nolang GET v2/epc/picklists?ids={picklist_ID} ``` ```` - ```nolang GET v2/epc/picklists/{picklist_ID} ```` ::include{src="../../shared/section_c4a9c7bac1b1c3461cd6321e0d9b45d5.md"} ::include{src="../../shared/section_f4aae7597a305f61eb26e222eb094412.md"} ::include{src="../../shared/section_e19c74036499bf2a717d7fc5a0852bcd.md"} ::include{src="../../shared/section_0fcf481610065fd34ff442609bf2bba9.md"} ::include{src="../../shared/section_8dbb11b5b7cb6e771157050052d6eeed.md"} ## Resource Information | Response Format | JSON | | --------------- | -------------------------------------------------------------------- | | Resource URL | `/services/apexrest/{namespace}/v2/epc/picklists?ids={picklist_ID} ` | ## Example Request ```nolang GET v2/epc/picklists?ids=01t3h000001gyCFAAY ``` ::include{src="../../shared/section_355474279fdce246da142f04768178c9.md"} # Retrieve Product Child Item Details Retrieve the details of an individual product child item by specifying its ID. - ```nolang GET v2/epc/productchilditems/{product_child_item_ID} ``` ```` - ```nolang GET v2/epc/productchilditems?ids={product_child_item_ID} ```` ## Remote Method ```nolang readPCI ``` ::include{src="../../shared/section_4123cb1a26ff504194c817523bc07586.md"} ::include{src="../../shared/section_e19c74036499bf2a717d7fc5a0852bcd.md"} ::include{src="../../shared/section_0fcf481610065fd34ff442609bf2bba9.md"} ::include{src="../../shared/section_8dbb11b5b7cb6e771157050052d6eeed.md"} ## Resource Information | Response Format | JSON | | --------------- | ---------------------------------------------------------------------------------- | | Resource URL | `/services/apexrest/{namespace}/v2/epc/productchilditems/{product_child_item_ID} ` | ## Example Requests ```nolang GET v2/epc/productchilditems?ids=a3C3h000000Je8oEAC ``` ```nolang GET v2/epc/productchilditems/a3C3h000000Je8oEAC ``` ::include{src="../../shared/section_b206ddf41eed4b4bc9f8848c73321190.md"} # Retrieve Product Details Retrieve the details of an individual product by specifying its ID in the resource URI. - ```nolang GET v2/epc/products?ids={product_ID} ``` ```` - ```nolang GET v2/epc/products/product_ID ```` ## Remote Method ```nolang readEntity ``` ::include{src="../../shared/section_a928218bc856553066f3327382143bf4.md"} ::include{src="../../shared/section_e19c74036499bf2a717d7fc5a0852bcd.md"} ::include{src="../../shared/section_0fcf481610065fd34ff442609bf2bba9.md"} ::include{src="../../shared/section_8dbb11b5b7cb6e771157050052d6eeed.md"} ## Resource Information | Response Format | JSON | | --------------- | ------------------------------------------------------------------ | | Resource URL | `/services/apexrest/{namespace}/v2/epc/products?ids={product_ID} ` | ## Example Requests ```nolang GET v2/epc/products?ids=0123h000000slEnAAI ``` ```nolang GET v2/epc/products/0123h000000slEnAAI ``` ::include{src="../../shared/section_355474279fdce246da142f04768178c9.md"} # Retrieve Promotion Details Retrieve the details of an individual promotion by specifying its ID in the resource URI. ```nolang GET v2/epc/promotions/{promotions_ID} ``` ## Remote Method ```nolang readPromotion ``` ## REST Handler ```nolang APIPromotionRestHandler ``` ## Apex Remote Service ```nolang PCAppHandler ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see the [Swagger (OpenAPI) reference documentation for Industries EPC REST APIs](https://developer.salesforce.com/docs/industries/cme/references/epc?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | ------------------------------------------------------------------- | | Resource URL | `/services/apexrest/{namespace}/v2/epc/promotions/{promotions-id} ` | ## Example Request - ```nolang GET v2/epc/promotions/a3K3h0000006Aj3EAE ``` ```` - ```nolang GET v2/epc/promotions?id=a3K3h0000006Aj3EAE ```` ## Example Result ``` { "epcResponse": { "entities": [ { "numberOfProduct": 0, "entity": { "attributes": { "type": "vlocity_cmt__Promotion__c", "url": "/services/data/v52.0/sobjects/vlocity_cmt__Promotion__c/a3K3h0000006AiyEAE" }, "Id": "a3K3h0000006AiyEAE", "OwnerId": "0053h000002UGCUAA4", "IsDeleted": false, "Name": "Promotion-Example", "CurrencyIsoCode": "USD", "RecordTypeId": "0123h000000slErAAI", "CreatedDate": "2021-09-07T05:50:02.000+0000", "CreatedById": "0053h000002UGCUAA4", "LastModifiedDate": "2021-09-07T05:50:02.000+0000", "LastModifiedById": "0053h000002UGCUAA4", "SystemModstamp": "2021-09-07T05:50:02.000+0000", "LastViewedDate": "2021-09-07T05:50:02.000+0000", "LastReferencedDate": "2021-09-07T05:50:02.000+0000", "vlocity_cmt__AppliesToAllItems__c": false, "vlocity_cmt__CannotBeCombined__c": false, "vlocity_cmt__Code__c": "Promotion-Example", "vlocity_cmt__Description__c": "Promotion-Example", "vlocity_cmt__DurationUnitOfMeasure__c": "Month", "vlocity_cmt__EnableAutoAddProducts__c": false, "vlocity_cmt__EnableAutoApplyPromotion__c": true, "vlocity_cmt__GlobalKey__c": "a74dff32-15da-f94a-9769-d58c6685d0cb", "vlocity_cmt__IsActive__c": true, "vlocity_cmt__IsLimitedQuantity__c": true, "vlocity_cmt__IsOrderable__c": true, "vlocity_cmt__PriceListId__c": "a343h000001ACXFAA4", "vlocity_cmt__ServiceContinuation__c": "Not Applicable", "vlocity_cmt__PriceListId__r": { "attributes": { "type": "vlocity_cmt__PriceList__c", "url": "/services/data/v52.0/sobjects/vlocity_cmt__PriceList__c/a343h000001ACXFAA4" }, "Id": "a343h000001ACXFAA4", "Name": "ShamPriceList" } } } ], "overallResult": "success" } } ``` # Retrieve the Versions of Picklists Retrieve the versions of picklists using REST APIs by specifying the ID of the picklist in the resource URI. ```nolang GET /v2/epc/picklists/{picklist-ID}/versions ``` ## Remote Method ```nolang readPicklist ``` ## REST Handler ```nolang APIPicklistVersionRestHandler ``` ## Apex Remote Service ```nolang PCAppHandler ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see the [Swagger (OpenAPI) reference documentation for Industries EPC REST APIs](https://developer.salesforce.com/docs/industries/cme/references/epc?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | ---------------------------------------------------------------------- | | Resource URL | /services/apexrest/{namespace}/v2/epc/picklists/{picklist-id}/versions | ## Example Request ```nolang GET /v2/epc/picklists/01t3h000001gyCFAAY/versions ``` ## Example Result ``` { "epcResponse": { "entities": [ { "supplimentryEntity": [ { "attributes": { "type": "Picklist2", "url": "/services/data/v52.0/sobjects/Picklist2/01t3h000001gyCFAAY" }, "vlocity_cmt__VersionLabel__c": "Version-1", "Name": "Picklist-Ashish", "PicklistCode": "Picklist-Ashish", "vlocity_cmt__SpecificationType__c": "Offer", "vlocity_cmt__SpecificationSubType__c": "Bundle", "vlocity_cmt__LifecycleStatus__c": "Draft", "vlocity_cmt__GlobalGroupKey__c": "a4096cc5-8bbb-cfd5-7b93-869a7c2b4caf", "RecordTypeId": "0123h000000slEnAAI", "Id": "01t3h000001gyCFAAY", "RecordType": { "attributes": { "type": "RecordType", "url": "/services/data/v52.0/sobjects/RecordType/0123h000000slEnAAI" }, "Id": "0123h000000slEnAAI", "Name": "Picklist" } }, { "attributes": { "type": "Picklist2", "url": "/services/data/v52.0/sobjects/Picklist2/01t3h000001h1uxAAA" }, "vlocity_cmt__VersionLabel__c": "Version-2", "Name": "Picklist-Ashish", "PicklistCode": "Picklist-Ashish", "vlocity_cmt__SpecificationType__c": "Offer", "vlocity_cmt__SpecificationSubType__c": "Bundle", "vlocity_cmt__LifecycleStatus__c": "Draft", "vlocity_cmt__GlobalGroupKey__c": "a4096cc5-8bbb-cfd5-7b93-869a7c2b4caf", "RecordTypeId": "0123h000000slEnAAI", "Id": "01t3h000001h1uxAAA", "RecordType": { "attributes": { "type": "RecordType", "url": "/services/data/v52.0/sobjects/RecordType/0123h000000slEnAAI" }, "Id": "0123h000000slEnAAI", "Name": "Picklist" } } ], "entity": { "attributes": { "type": "Picklist2", "url": "/services/data/v52.0/sobjects/Picklist2/01t3h000001gyCFAAY" }, "vlocity_cmt__VersionLabel__c": "Version-1", "Name": "Picklist-Ashish", "PicklistCode": "Picklist-Ashish", "vlocity_cmt__SpecificationType__c": "Offer", "vlocity_cmt__SpecificationSubType__c": "Bundle", "vlocity_cmt__LifecycleStatus__c": "Draft", "vlocity_cmt__GlobalGroupKey__c": "a4096cc5-8bbb-cfd5-7b93-869a7c2b4caf", "RecordTypeId": "0123h000000slEnAAI", "Id": "01t3h000001gyCFAAY", "RecordType": { "attributes": { "type": "RecordType", "url": "/services/data/v52.0/sobjects/RecordType/0123h000000slEnAAI" }, "Id": "0123h000000slEnAAI", "Name": "Picklist" } } } ], "overallResult": "success" } } ``` # Retrieve the Versions of Products Retrieve the versions of products using REST APIs by specifying the ID of the product in the resource URI. ```nolang GET /v2/epc/products/{product-ID}/versions ``` ## Remote Method ```nolang readProduct2 ``` ## REST Handler ```nolang APIProductVersionRestHandler ``` ## Apex Remote Service ```nolang PCAppHandler ``` ## Package Communication (vlocity_cmt) ## API Parameters and Response Format For API parameter names and descriptions, see the [Swagger (OpenAPI) reference documentation for Industries EPC REST APIs](https://developer.salesforce.com/docs/industries/cme/references/epc?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | -------------------------------------------------------------------- | | Resource URL | /services/apexrest/{namespace}/v2/epc/products/{product-ID}/versions | ## Example Request ```nolang GET /v2/epc/products/01t3h000001gyCFAAY/versions ``` ## Example Result ``` { "epcResponse": { "entities": [ { "supplimentryEntity": [ { "attributes": { "type": "Product2", "url": "/services/data/v52.0/sobjects/Product2/01t3h000001gyCFAAY" }, "vlocity_cmt__VersionLabel__c": "Version-1", "Name": "Product-Ashish", "ProductCode": "Product-Ashish", "vlocity_cmt__SpecificationType__c": "Offer", "vlocity_cmt__SpecificationSubType__c": "Bundle", "vlocity_cmt__LifecycleStatus__c": "Draft", "vlocity_cmt__GlobalGroupKey__c": "a4096cc5-8bbb-cfd5-7b93-869a7c2b4caf", "RecordTypeId": "0123h000000slEnAAI", "Id": "01t3h000001gyCFAAY", "RecordType": { "attributes": { "type": "RecordType", "url": "/services/data/v52.0/sobjects/RecordType/0123h000000slEnAAI" }, "Id": "0123h000000slEnAAI", "Name": "Product" } }, { "attributes": { "type": "Product2", "url": "/services/data/v52.0/sobjects/Product2/01t3h000001h1uxAAA" }, "vlocity_cmt__VersionLabel__c": "Version-2", "Name": "Product-Ashish", "ProductCode": "Product-Ashish", "vlocity_cmt__SpecificationType__c": "Offer", "vlocity_cmt__SpecificationSubType__c": "Bundle", "vlocity_cmt__LifecycleStatus__c": "Draft", "vlocity_cmt__GlobalGroupKey__c": "a4096cc5-8bbb-cfd5-7b93-869a7c2b4caf", "RecordTypeId": "0123h000000slEnAAI", "Id": "01t3h000001h1uxAAA", "RecordType": { "attributes": { "type": "RecordType", "url": "/services/data/v52.0/sobjects/RecordType/0123h000000slEnAAI" }, "Id": "0123h000000slEnAAI", "Name": "Product" } } ], "entity": { "attributes": { "type": "Product2", "url": "/services/data/v52.0/sobjects/Product2/01t3h000001gyCFAAY" }, "vlocity_cmt__VersionLabel__c": "Version-1", "Name": "Product-Ashish", "ProductCode": "Product-Ashish", "vlocity_cmt__SpecificationType__c": "Offer", "vlocity_cmt__SpecificationSubType__c": "Bundle", "vlocity_cmt__LifecycleStatus__c": "Draft", "vlocity_cmt__GlobalGroupKey__c": "a4096cc5-8bbb-cfd5-7b93-869a7c2b4caf", "RecordTypeId": "0123h000000slEnAAI", "Id": "01t3h000001gyCFAAY", "RecordType": { "attributes": { "type": "RecordType", "url": "/services/data/v52.0/sobjects/RecordType/0123h000000slEnAAI" }, "Id": "0123h000000slEnAAI", "Name": "Product" } } } ], "overallResult": "success" } } ``` # Retrieving Additional Product2 or Promotion Fields To return additional Product2 or Promotion fields that are not returned by default, use the [GetOffersByCatalog](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-get-offers-by-catalog-api.md) and [GetOfferDetails](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-get-offer-details-api.md) APIs. For the response to contain additional fields from the Product2 or Promotion objects, you must first specify the fields as part of the GetOffersByCatalog or GetOfferDetails API metadata. Once configured, rerun the API Response Batch jobs to populate the cache response. To return additional Product2 or Promotion fields: 1. Navigate to the **All Tabs** page by clicking the **+** icon. 2. From the list of tabs, select **Vlocity API Metadata**. The list of API objects is displayed. If the Vlocity API Metadata tab is not shown in the All Tabs list, see the [Creating a Custom Object Tab](https://help.salesforce.com/articleView?id=creating_custom_object_tabs.htm&type=5) topic in the Salesforce help. 3. To display the metadata fields, select **All** from the Select Views list. ![Vlocity API Metadata fields](https://developer.salesforce.com/docs/media/api_metadata_lightning.png) 4. Click the GetOffers API Name then select the **Edit** icon next to **API Params**. 5. In the **API Params** field, enter the Product2 or Promotions fields that you want to retrieve using the API call. For example, to return the fields **IsActive** and **Family** from the Product2 catalog enter the following in the **API Params** field: ```nolang {"productFields":["IsActive","Family"]} ``` You can return Promotion fields in a similar manner: ```nolang {"promotionFields":["pricelist","Service_continuation"]} ``` 6. From the Vlocity CMT Administration screen, click **Maintenance Jobs** and then click **Start** next to **Clear Managed Platform Cache**. 7. From the Vlocity CMT Administration screen, click **Cacheable API** Jobs, then click **Start** next to **Delete Expired API Cache**. 8. From the Vlocity CMT Administration screen, click **Cache Catalog Product Definition**, and run `Generate Catalog Product Definitions` job. 9. Run the GetOffersByCatalog or GetOfferDetails API. The additional fields are displayed in the JSON output. Only fields that are populated in the catalog are displayed in the API results. The API does not return empty or undefined fields. **note:** Do not run the **Load API Metadata** job. Doing so will overwrite the data you specified in the API metadata field. **note:** The APIParms metadata returned by the GetOffers API overwrites the metadata returned by the Get Contains Products API. That is, if the APIParams field is configured with a specific value, and the GetOffers API is run, the metadata from GetOffers overwrites the metadata for the Get Contains Products API. # Review the Billing Zip Code Custom Field In your training org we have created a custom field, Billing Zip Code, on the Order Product. The Billing Zip Code field will be used throughout this example, so we need to be familiar with its setup. 1. Go to **Setup** and click **Object Manager**. 2. In the **Quick Find** box, type Order Product. 3. Under Label, click **Order Product**. 4. Click **Field & Relationships** from the navigation pane on the left. ![](https://developer.salesforce.com/docs/media/image83.png) 5. Click **Billing Zip Code**. 6. Make a notation of the **API name**. 7. Make a notation of the **formula**. 8. Close the Setup browser tab. See [Create an Attribute Pricing Matrix for the Billing Zip Code](https://developer.salesforce.com/docs/industries/cme/guide/comms-create-an-attribute-pricing-matrix-for-the-billing-zip-code.md). # Rule Set Combinations API The Rule Set Combinations API generates a string representation of a boolean expression created by entity filters involved in the passed rule set. When this expression is parsed by substituting the values of context dimensions, the rule set evaluates to true or false and eligibility of offers is determined for a context. The Rule Set Combinations API call is required if you have rule sets associated with your catalog. If you do not have any rule sets linked to your catalog, you do not need to perform this API call. If this is the case, the CatalogCodeToRuleAssignments node from the response of the Catalog Profile API will be empty. You can obtain the rulesetId required in the URI of this API from the values of the hash map in the `apiResponse.data.catalogCodeToRuleAssignments` node in the response body of the [Catalog Profile API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-catalog-profile-api.md). ## Precondition You must first run the [Catalog Profile API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-catalog-profile-api.md) to obtain the rulesetId required in the request body of this API. ## URI /services/apexrest/{namespace}/v3/admin/ruleset/{rulesetId}/rulesetcombinations ## HTTP Method GET ## URI Parameters If you specify just one of these two parameters, it follows the behavior described in the table below and accepts your defined time for the parameter you specified. If you are using one or both parameters, you must specify them with the same values for all of the Populate Cache APIs in this sequence. | Parameter | Example | Default | Optional/Required | Notes | | ------------------ | ------------------- | ------------------------------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | effectiveStartTime | 2001-07-04T12:08:56 | Current date and time | Optional | effectiveStartTime is the time that you want your cached catalog entries to be effective. It should be in the UTC date-time format. Your effectiveStartTime must occur after the current time for which you are executing the Populate Cache APIs or you will receive an error message. | | expirationTime | 2001-07-04T12:08:56 | effectiveStartTime + TimeToLive | Optional | expirationTime is the time that you want your cached catalog entries to expire. It should also be in the UTC date-time format. Your expirationTime must occur after your effectiveStartTime or you receive an error message. TimeToLive is a custom setting created in CPQ Configuration Setup. It has a default value of 30 days. | Here is an example of how to pass the URI parameters: ```nolang GET /services/apexrest/vlocity_cmt/v3/admin/catalogs/AS-Test-Catalog/rulesetcombinations?effectiveStartTime=2021-07-04T12:08:56&expirationTime=2021-08-04T12:08:56 ``` ## Remote API This is an example of how you invoke the API using Apex: ```nolang String methodName; Map input = new Map(); Map output = new Map(); Map options = new Map(); // Setting remote parameters methodName = 'getRulesetCombinations'; input.put('apiName', 'CMRuleSetCombinations'); // required input.put('rulesetId', 'a3e4x000000q0KcAAI'); // required input.put('effectiveStartTime', null); // optional input.put('expirationTime', null); // optional input.put('methodName', methodName); // required input.put('requestURL', '/v3/admin/ruleset/a3e4x000000q0KcAAI/rulesetcombinations'); // required //remote action invocation vlocity_cmt.CpqAppHandler appHandler = new vlocity_cmt.CpqAppHandler(); appHandler.invokeMethod(methodName, input, output, options); ``` ## Parallel Invocation You can run this API in parallel for multiple catalogs. For example, if you have 100 catalogs (Catalog1, Catalog2..Catalog 100), you can run the API for all 100 catalogs in 100 parallel threads. ```nolang THREAD1 - GET /services/apexrest/{namespace}/v3/admin/ruleset/rulesetId1/catalogprofile THREAD2 - GET /services/apexrest/{namespace}/v3/admin/ruleset/rulesetId2/catalogprofile ...... THREAD100 - GET /services/apexrest/{namespace}/v3/admin/ruleset/rulesetId100/catalogprofile ``` ## HTTP Headers | Header | Description | | ------------ | ---------------- | | Content-Type | application/json | ## Response Body This example shows a string representation of a boolean expression created by entity filters involved in the passed rule set. ``` "( ( DIM_0 == 'V_0_1' ) AND ( DIM_1 == 'V_1_1' ) )" ``` ## HTTP Response Codes | Code | Description | | ---- | --------------------- | | 200 | OK | | 500 | Internal Server Error | # Run Admin Jobs for Standard Digital Commerce After enabling Standard Digital Commerce, run jobs in Vlocity CMT Administration to prepare your org to use Standard Digital Commerce. 1. From the App Launcher, find and select **Vlocity CMT Administration**. 2. Under the Admin Console section, click **Maintenance Jobs**. 3. Run the following jobs: 1. [INTERFACE IMPLEMENTATION MAINTENANCE (MERGE)](https://help.salesforce.com/s/articleView?id=ind.comms_interface_implementation_maintenance__merge_.htm&type=5) 2. [FIELD MAPS MAINTENANCE](https://help.salesforce.com/s/articleView?id=ind.comms_field_maps_maintenance.htm&type=5) 3. [OBJECT MAP MAINTENANCE](https://help.salesforce.com/s/articleView?id=ind.comms_object_maps_maintenance.htm&type=5) 4. [Clear Managed Platform Cache](https://help.salesforce.com/s/articleView?id=ind.comms_clear_managed_platform_cache.htm&type=5) 5. [Product Hierarchy Maintenance](https://help.salesforce.com/s/articleView?id=ind.comms_product_hierarchy_maintenance.htm&type=5). Ensure that you select **Delete Old Data**. 6. [REFRESH PLATFORM CACHE (FULL)](https://help.salesforce.com/s/articleView?id=ind.comms_Refresh_Platform_Cache_Full.htm&type=5) 7. [LOAD API METADATA](https://help.salesforce.com/s/articleView?id=ind.comms_load_api_metadata.htm&type=5). This populates the API Metadata table as part of Digital Commerce Cache Management. 4. Click **Back to dashboard**. 5. Under the Admin Console section of Vlocity CMT Administration, click **Cache Catalog Product Definition**. 6. Click **Start**. 7. Select the catalogs that you want to be accessible using the APIs and click **Ok**. # 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. ```nolang 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 ```nolang priceCart ``` ## REST Handler ```nolang APIPriceCartsCpqV2 ``` ## Apex Remote Service ```nolang CpqAppHandler ``` ## Apex Remote Input Map Where `items` specifies the associated line item IDs. ```nolang { "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](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | ------------------------------------------------------------- | | Resource URL | `/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/price` | ## Example Request ```nolang POST /services/apexrest/vlocity_cmt/v2/cpq/carts/80141000000Cg8H/price ``` ## Example Response ```nolang { "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": {} } } } } }] } ``` # 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. ```nolang POST /v2/cpq/carts/{cart_ID}/price ``` 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 ```nolang priceCart ``` ## REST Handler ```nolang APIPriceCartsCpqV2 ``` ## Apex Remote Service ```nolang CpqAppHandler ``` ## Apex Remote Input Map Where `items` specifies the associated line item IDs. ```nolang { "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](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary). ## Resource Information | Response Format | JSON | | --------------- | ------------------------------------------------------------- | | Resource URL | `/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/price` | ## Example Request ```nolang POST /services/apexrest/vlocity_cmt/v2/cpq/carts/80141000000Cg8H/price ``` ## Example Response ```nolang { "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": {} } } } } }] } ``` # Run the Digital Commerce API Examples The Postman examples illustrate how to run each of the Digital Commerce APIs, along with hints and usage tips. # Run the PopulateCacheOrchestratorApplication Class You've used Postman to get the session token from your org, configured your IDE for Java, and loaded the orchestration classes into your IDE. Now you're ready to configure and run the PopulateCacheOrchestratorApplication class. To run the PopulateCacheOrchestratorApplication class in Visual Studio Code: 1. In Visual Studio Code, click the Explorer icon and expand the CACHE_AND_POPULATE_ORCHESTRATORS pane. 2. Locate and click the `PopulateCacheOrchestratorApplication.java` file. The file opens in a tab. 3. Edit these String values in the file: | String Value | Set the value to | | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | | accessToken | The `access_token` value you saved in the [Set Up Postman, Import the Files, and Get the Token](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-set-up-postmanimport-the-filesand-get-the-token.md) task | | orgNamespace | `vlocity_cmt`. | | instanceUrl | Your org's hostname, for example `https://demo.my.salesforce.com` | | catalogCodes | The name of a catalog in your org | 4. Make sure the file looks something like this, then save it: ```nolang import com.fasterxml.jackson.core.JsonProcessingException; import java.net.URISyntaxException; import java.util.List; public class PopulateCacheOrchestratorApplication { public static void main(String[] args) throws URISyntaxException, InterruptedException, JsonProcessingException { String accessToken = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; String orgNamespace = "vlocity_cmt"; String instanceUrl = "https://demo.my.salesforce.com"; List < String > catalogCodes = List.of("AcmeProductCatalog"); PopulateCacheOrchestrator orchestrator = new PopulateCacheOrchestrator( accessToken, orgNamespace, instanceUrl, catalogCodes); orchestrator.populateCache(); } } ``` 5. Right-click the `PopulateCacheOrchestratorApplication.java` file and select **Run Java**. 6. Watch the TERMINAL pane to see JSON responses for REST API calls appear. [Prepare to Use the Regenerate Cache APIs](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-prepare-to-use-the-regenerate-cache-apis.md) # Run the RegenerateCacheOrchestratorApplication Class You've used Postman to get the session token from your org, configured your IDE for Java, loaded the orchestration classes into your IDE, and populated the cache. Now you're ready to configure and run the RegenerateCacheOrchestratorApplication class. To run the RegenerateCacheOrchestratorApplication class in Visual Studio Code: 1. In Visual Studio Code, click the Explorer icon and expand the CACHE_AND_POPULATE_ORCHESTRATORS pane. 2. Locate and click the `RegenerateCacheOrchestratorApplication.java` file. The file opens in a tab. 3. Edit these String values in the file: | String Value | Set the value to | | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | | accessToken | The `access_token` value you saved in the [Set Up Postman, Import the Files, and Get the Token](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-set-up-postmanimport-the-filesand-get-the-token.md) task | | orgNamespace | `vlocity_cmt`. | | instanceUrl | Your org's hostname, for example `https://demo.my.salesforce.com` | 4. Make sure part of the file looks something like this, then save it: ```nolang ... String accessToken = "xxxxxxxxxxxxxxxxxxxxxxxxxx"; String orgNamespace = "vlocity_cmt"; String instanceUrl = "https://demo.my.salesforce.com"; ... ``` 5. Right-click the `RegenerateCacheOrchestratorApplication.java` file and select **Run Java**. 6. Watch the TERMINAL pane to see JSON responses for REST API calls appear. # runCartValidation Method Runs the Industries CPQ Validate API on a sub quote. ## Class ## Input Parameters | Parameter | Required | Description | | --------- | -------- | ---------------------- | | Id | Required | Sub quote or order ID. | ## Output Parameters | Parameter | Description | | ---------------- | ------------------------------------------ | | validationResult | A map of id and boolean. Map\ | | message | In case of any error. | ## Example Input Data ``` {"Id":"0Q06g000000IRwGCAW","name":"Proposal -10","parentId":"0066g000022k7AhAAI"} ``` ## Example Output Data ``` {"masterQuoteId":"0Q06g000000IRwLCAW","error":"OK"} ``` # Running Maintenance and Digital Commerce Cache Jobs Remotely You can run the Maintenance Jobs and the Digital Commerce API cache jobs programmatically by using anonymous Apex code as shown in the following examples. ## Product Hierarchy Maintenance Use this anonymous Apex job to build a streamlined version of the product hierarchies in the Data Store subjects. This is the same result as using **Vlocity CMT Administration > Maintenance Jobs > Product Hierarchy Maintenance**. ```nolang Map input = new Map{'methodName' => 'startProductHierarchyJob'}; vlocity_cmt.TelcoAdminConsoleController controllerClass = new vlocity_cmt.TelcoAdminConsoleController(); controllerClass.setParameters(JSON.serialize(input)); controllerClass.invokeMethod(); ``` ## Clear Managed Platform Cache Use this anonymous Apex job to clear the org cache in the CPQPartition platform cache. This is the same result as using **Vlocity CMT Administration > Maintenance Jobs > Clear Managed Platform Cache**. ```nolang Map input = new Map{'methodName' => 'clearPlatformCache'}; vlocity_cmt.TelcoAdminConsoleController controllerClass = new vlocity_cmt.TelcoAdminConsoleController(); controllerClass.setParameters(JSON.serialize(input)); controllerClass.invokeMethod(); ``` ## Refresh Platform Cache (Full) Use this anonymous Apex job to copy product hierarchy data to the platform cache and to rebuild the product attribute cache. This is the same result as using **Vlocity CMT Administration > Maintenance Jobs > Refresh Platform Cache (Full)**. Note that you must include the appropriate Pricebook2 ID in the script shown here: ```nolang Map input = new Map{'methodName' => 'refreshPriceBook', 'priceBookId' => 'price book ID'}; vlocity_cmt.TelcoAdminConsoleController controllerClass = new vlocity_cmt.TelcoAdminConsoleController(); controllerClass.setParameters(JSON.serialize(input)); controllerClass.invokeMethod(); ``` ## ClearCacheBatch Copy and paste the following Apex class into your org. This is a batch job that clears the cache. Use this if you have a large catalog or many context dimensions that result in a cache of 50k+ records. ```nolang global class ClearCacheBatch implements Database.Batchable { public String query = 'SELECT Id FROM vlocity_cmt__CachedAPIResponse__c'; global Database.QueryLocator start(Database.BatchableContext BC){ return Database.getQueryLocator(query); } global void execute(Database.BatchableContext BC, List scope){ delete scope; DataBase.emptyRecycleBin(scope); } global void finish(Database.BatchableContext BC){ } } ``` ## Clear Cache You can fully clear the Digital Commerce API cache with the following anonymous Apex. Use it to debug and troubleshoot failures with the Digital Commerce APIs. ```nolang Id batchInstanceId = Database.executeBatch(new ClearCacheBatch()); ``` ## Check Job Status Use this anonymous Apex job to check a jobs' status. This is critical as the jobs can take a long time to run if you have a large catalog. Here is the anonymous apex for it: ```nolang Map input = new Map{'methodName' => 'refreshBatchJobLists'}; vlocity_cmt.TelcoAdminConsoleController controllerClass = new vlocity_cmt.TelcoAdminConsoleController(); controllerClass.setParameters(JSON.serialize(input)); controllerClass.invokeMethod(); ``` ## ContextEligibilityGenerator Job This job populates the cache with the eligible offers for individual context combinations. The data is used by the **GetOffers** and **GetContainOffers** jobs. You can run the job using anonymous apex code as shown here: ```nolang Map input = new Map{'methodName' => 'populateCacheCAJob', 'selectedList' => new List{'ContextEligibilityGenerator'}}; vlocity_cmt.TelcoAdminConsoleController controllerClass = new vlocity_cmt.TelcoAdminConsoleController(); controllerClass.setParameters(JSON.serialize(input)); controllerClass.invokeMethod(); ``` ## Generate Full Cache Use this job to generate, or populate, a full cache. This is the same result as using **Vlocity CMT Administration > Cacheable API Jobs > Populate API Cache** and selecting all of the jobs and catalogs. ```nolang Map input = new Map{'methodName' => 'populateCacheCAJob','selectedList' => new List{'ContextEligibilityGenerator','GetOffersHierarchyHelper','GetOffers','GetContainOffers','GetPrices','GetOfferDetails'},'filters'=> new Map>{}}; vlocity_cmt.TelcoAdminConsoleController controllerClass = new vlocity_cmt.TelcoAdminConsoleController(); controllerClass.setParameters(JSON.serialize(input)); controllerClass.invokeMethod(); ``` ## GetOffersHierarchyHelper Job This job populates the cache with the hierarchy of bundles. The data is used in the **GetOfferDetails** Job. ```nolang Map input = new Map{'methodName' => 'populateCacheCAJob', 'selectedList' => new List{'GetOffersHierarchyHelper'}}; vlocity_cmt.TelcoAdminConsoleController controllerClass = new vlocity_cmt.TelcoAdminConsoleController(); controllerClass.setParameters(JSON.serialize(input)); controllerClass.invokeMethod(); ``` ## GetOffers Job This job populates the cache with the list of offers for individual context combinations. ```nolang Map input = new Map{'methodName' => 'populateCacheCAJob', 'selectedList' => new List{'GetOffers'}}; vlocity_cmt.TelcoAdminConsoleController controllerClass = new vlocity_cmt.TelcoAdminConsoleController(); controllerClass.setParameters(JSON.serialize(input)); controllerClass.invokeMethod(); ``` ## GetContainsOffers Job This job populates the cache with the parent offers for individual offers. ```nolang Map input = new Map{'methodName' => 'populateCacheCAJob', 'selectedList' => new List{'GetContainOffers'}}; vlocity_cmt.TelcoAdminConsoleController controllerClass = new vlocity_cmt.TelcoAdminConsoleController(); controllerClass.setParameters(JSON.serialize(input)); controllerClass.invokeMethod(); ``` ## GetPrices Job This job populates the cache with the prices of products. This is used in **GetOffers**, **GetContainsOffers** and **GetOfferDetails** jobs. ```nolang Map input = new Map{'methodName' => 'populateCacheCAJob', 'selectedList' => new List{'GetPrices'}}; vlocity_cmt.TelcoAdminConsoleController controllerClass = new vlocity_cmt.TelcoAdminConsoleController(); controllerClass.setParameters(JSON.serialize(input)); controllerClass.invokeMethod(); ``` ## GetOfferDetails Job This job populates the cache with the details of individual offers (product or promotion). ```nolang Map input = new Map{'methodName' => 'populateCacheCAJob', 'selectedList' => new List{'GetOfferDetails'}}; vlocity_cmt.TelcoAdminConsoleController controllerClass = new vlocity_cmt.TelcoAdminConsoleController(); controllerClass.setParameters(JSON.serialize(input)); controllerClass.invokeMethod(); ``` ## Generating the Cache for Specific Catalogs You can run any of the batch jobs from anonymous Apex code by specifying the ID of the catalog. In the following example, the ID of the catalog is a0G0b00000dT45JEAS: ```nolang Map input = new Map{new Map{'methodName' => 'populateCacheCAJob', 'selectedList' => new List {'GetOfferDetails'}, 'filters'=> new Map>{'Catalogs'=> new List{'a0G0b00000dT45JEAS'}}}; vlocity_cmt.TelcoAdminConsoleController controllerClass = new vlocity_cmt.TelcoAdminConsoleController(); controllerClass.setParameters(JSON.serialize(input)); controllerClass.invokeMethod(); ``` ## Regenerate Cached API Records Run this job to regenerate cached API records. If the catalog has been modified, this job regenerates the cached API response objects based on the modified sales catalog and product models. ```nolang Map input = new Map{'methodName' => 'regenerateCacheAPIRecordsJobs'}; vlocity_cmt.TelcoAdminConsoleController controllerClass = new vlocity_cmt.TelcoAdminConsoleController(); controllerClass.setParameters(JSON.serialize(input)); controllerClass.invokeMethod(); ``` # Running SDK Server in a Heroku Environment You can deploy and host this ServerSDK application in any node-supported server. 1. Log in to your Heroku account. 2. Click the **New** button and select **Create a new App from Dashboard**. 3. Enter an app name and click the **Create app** button. 4. Navigate to the **Deploy** tab. Follow the steps to install the Heroku CLI, create a new Git repository, and deploy your application. ![Server SDK Installation - Deploy](https://developer.salesforce.com/docs/media/sdk_heroku.png) After following the previous step, a folder is created containing the Heroku cloned/setup. You now must copy the ServerSDK into the Heroku cloned/setup folder. Copy all of the files located in `vop_server_sdk/secure-server-reference-app`. There is no need to copy the `dist` and `node_modules` folders. 5. Paste the following into the `Procfile` file: ```nolang web: npm run start-prod-server ``` The code runs the ServerSDK in Heroku after a code push. 6. Open the Heroku cloned/setup folder in a terminal, commit and push the files to Heroku using the following commands: ```nolang $ git add . $ git commit -am "make it better" $ git push heroku master ``` 7. After you push the code, Heroku automatically detects it as a Node.JS app. Your log should look similar to the following after you push: ```nolang akodaganur:server-sdk-109-pref aminkodaganur$ heroku login heroku: Press any key to open up the browser to login or q to exit: Opening browser to https://cli-auth.heroku.com/auth/cli/browser/658be33b-6251-4700-ba48-1f5319f3a978?requestor=SFMyNTY.g3QAAAACZAAEZGF0YW0AAAAMNDkuMzcuMTY1Ljg2ZAAGc2lnbmVkbgYA14ka5HQB.G2_9GKq-Q_Lz8L7oFvJplCMG1MMVhr20pcscL6a48jU Logging in... done Logged in as akodaganur@vlocity.com akodaganur:server-sdk-109-pref aminkodaganur$ git add . akodaganur:server-sdk-109-pref aminkodaganur$ git commit -m "Intial commit" [master 2492e4e] Intial commit 1 file changed, 1 insertion(+), 1 deletion(-) akodaganur:server-sdk-109-pref aminkodaganur$ git push heroku master Enumerating objects: 8, done. Counting objects: 100% (8/8), done. Delta compression using up to 8 threads Compressing objects: 100% (6/6), done. Writing objects: 100% (6/6), 593 bytes | 593.00 KiB/s, done. Total 6 (delta 4), reused 0 (delta 0) remote: Compressing source files... done. remote: Building source: remote: remote: -----> Node.js app detected remote: remote: -----> Creating runtime environment remote: remote: NPM_CONFIG_LOGLEVEL=error remote: NODE_ENV=production remote: NODE_MODULES_CACHE=true remote: NODE_VERBOSE=false remote: remote: -----> Installing binaries remote: engines.node (package.json): 12.16.3 remote: engines.npm (package.json): 6.14.4 remote: remote: Resolving node version 12.16.3... remote: Downloading and installing node 12.16.3... remote: npm 6.14.4 already installed with node remote: remote: -----> Restoring cache remote: - node_modules is checked into source control and cannot be cached remote: remote: -----> Installing dependencies remote: Prebuild detected (node_modules already exists) remote: Rebuilding any native modules remote: remote: > protobufjs@6.9.0 postinstall /tmp/build_527a1f8d/node_modules/protobufjs remote: > node scripts/postinstall remote: remote: remote: > core-js@3.6.5 postinstall /tmp/build_527a1f8d/node_modules/core-js remote: > node -e "try{require('./postinstall')}catch(e){}" remote: remote: remote: > fsevents@1.2.13 install /tmp/build_527a1f8d/node_modules/fsevents remote: > node install.js remote: remote: remote: Skipping 'fsevents' build as platform linux is not supported remote: remote: > nodemon@1.19.4 postinstall /tmp/build_527a1f8d/node_modules/nodemon remote: > node bin/postinstall || exit 0 remote: remote: Love nodemon? You can now support the project via the open collective: remote: > https://opencollective.com/nodemon/donate remote: remote: @types/compression@1.7.0 /tmp/build_527a1f8d/node_modules/@types/compression remote: @types/express@4.17.6 /tmp/build_527a1f8d/node_modules/@types/express remote: @types/body-parser@1.19.0 /tmp/build_527a1f8d/node_modules/@types/body-parser remote: @types/connect@3.4.33 /tmp/build_527a1f8d/node_modules/@types/connect remote: @types/node@13.13.5 /tmp/build_527a1f8d/node_modules/@types/node remote: @types/express-serve-static-core@4.17.7 /tmp/build_527a1f8d/node_modules/@types/express-serve-static-core remote: @types/qs@6.9.2 /tmp/build_527a1f8d/node_modules/@types/qs remote: @types/range-parser@1.2.3 /tmp/build_527a1f8d/node_modules/@types/range-parser remote: @types/serve-static@1.13.3 /tmp/build_527a1f8d/node_modules/@types/serve-static remote: @types/mime@2.0.1 /tmp/build_527a1f8d/node_modules/@types/mime remote: @types/cookie-parser@1.4.2 /tmp/build_527a1f8d/node_modules/@types/cookie-parser remote: @types/cors@2.8.6 /tmp/build_527a1f8d/node_modules/@types/cors remote: @types/express-session@1.17.0 /tmp/build_527a1f8d/node_modules/@types/express-session remote: @types/jsonwebtoken@8.3.9 /tmp/build_527a1f8d/node_modules/@types/jsonwebtoken remote: @types/request-promise@4.1.46 /tmp/build_527a1f8d/node_modules/@types/request-promise remote: @types/bluebird@3.5.30 /tmp/build_527a1f8d/node_modules/@types/bluebird remote: @types/request@2.48.4 /tmp/build_527a1f8d/node_modules/@types/request remote: @types/caseless@0.12.2 /tmp/build_527a1f8d/node_modules/@types/caseless remote: @types/tough-cookie@4.0.0 /tmp/build_527a1f8d/node_modules/@types/tough-cookie remote: form-data@2.5.1 /tmp/build_527a1f8d/node_modules/form-data remote: asynckit@0.4.0 /tmp/build_527a1f8d/node_modules/asynckit remote: combined-stream@1.0.8 /tmp/build_527a1f8d/node_modules/combined-stream remote: delayed-stream@1.0.0 /tmp/build_527a1f8d/node_modules/delayed-stream remote: mime-types@2.1.27 /tmp/build_527a1f8d/node_modules/mime-types remote: mime-db@1.44.0 /tmp/build_527a1f8d/node_modules/mime-db remote: @types/spdy@3.4.4 /tmp/build_527a1f8d/node_modules/@types/spdy remote: @vlocity-cme-sdk/digitalcommerce-sdk@107.1.0 /tmp/build_527a1f8d/node_modules/@vlocity-cme-sdk/digitalcommerce-sdk remote: @vlocity-cme-sdk/translation-sdk@107.1.0 /tmp/build_527a1f8d/node_modules/@vlocity-cme-sdk/translation-sdk remote: body-parser@1.19.0 /tmp/build_527a1f8d/node_modules/body-parser remote: bytes@3.1.0 /tmp/build_527a1f8d/node_modules/bytes remote: content-type@1.0.4 /tmp/build_527a1f8d/node_modules/content-type remote: debug@2.6.9 /tmp/build_527a1f8d/node_modules/debug remote: ms@2.0.0 /tmp/build_527a1f8d/node_modules/ms remote: depd@1.1.2 /tmp/build_527a1f8d/node_modules/depd remote: http-errors@1.7.2 /tmp/build_527a1f8d/node_modules/http-errors remote: inherits@2.0.3 /tmp/build_527a1f8d/node_modules/inherits remote: setprototypeof@1.1.1 /tmp/build_527a1f8d/node_modules/setprototypeof remote: statuses@1.5.0 /tmp/build_527a1f8d/node_modules/statuses remote: toidentifier@1.0.0 /tmp/build_527a1f8d/node_modules/toidentifier remote: iconv-lite@0.4.24 /tmp/build_527a1f8d/node_modules/iconv-lite remote: safer-buffer@2.1.2 /tmp/build_527a1f8d/node_modules/safer-buffer remote: on-finished@2.3.0 /tmp/build_527a1f8d/node_modules/on-finished remote: ee-first@1.1.1 /tmp/build_527a1f8d/node_modules/ee-first remote: qs@6.7.0 /tmp/build_527a1f8d/node_modules/qs remote: raw-body@2.4.0 /tmp/build_527a1f8d/node_modules/raw-body remote: unpipe@1.0.0 /tmp/build_527a1f8d/node_modules/unpipe remote: type-is@1.6.18 /tmp/build_527a1f8d/node_modules/type-is remote: is-stream@2.0.0 /tmp/build_527a1f8d/node_modules/gcs-resumable-upload/node_modules/is-stream remote: node-fetch@2.6.0 /tmp/build_527a1f8d/node_modules/gcs-resumable-upload/node_modules/node-fetch remote: mime@2.4.6 /tmp/build_527a1f8d/node_modules/@google-cloud/storage/node_modules/mime remote: readable-stream@3.6.0 /tmp/build_527a1f8d/node_modules/@google-cloud/storage/node_modules/readable-stream remote: xdg-basedir@4.0.0 /tmp/build_527a1f8d/node_modules/@google-cloud/storage/node_modules/xdg-basedir remote: nodemon@1.19.4 /tmp/build_527a1f8d/node_modules/nodemon remote: debug@3.2.6 /tmp/build_527a1f8d/node_modules/nodemon/node_modules/debug remote: ms@2.1.2 /tmp/build_527a1f8d/node_modules/nodemon/node_modules/ms remote: Installing any new modules (package.json) remote: removed 1 package and audited 626 packages in 4.606s remote: remote: 33 packages are looking for funding remote: run `npm fund` for details remote: remote: found 25 vulnerabilities (19 low, 6 high) remote: run `npm audit fix` to fix them, or `npm audit` for details remote: remote: -----> Build remote: Running build remote: remote: > express-typescript@1.0.0 build /tmp/build_527a1f8d remote: > tsc remote: remote: remote: -----> Caching build remote: - node_modules remote: remote: -----> Pruning devDependencies remote: removed 210 packages and audited 412 packages in 4.776s remote: remote: 33 packages are looking for funding remote: run `npm fund` for details remote: remote: found 24 vulnerabilities (19 low, 5 high) remote: run `npm audit fix` to fix them, or `npm audit` for details remote: remote: -----> Build succeeded! remote: -----> Discovering process types remote: Procfile declares types -> web remote: remote: -----> Compressing... remote: Done: 48.3M remote: -----> Launching... remote: Released v28 remote: https://server-sdk-109-pref.herokuapp.com/ deployed to Heroku remote: remote: Verifying deploy... done. To https://git.heroku.com/server-sdk-109-pref.git 455a853..2492e4e master -> master akodaganur:server-sdk-109-pref aminkodaganur$ ``` Note that the base API URL is logged at the end. Once you pushed and deployed successfully, the base URL becomes: https://_your-app-name_.herokuapp.com/v1/serversdk. You can also find the name in the Heroku Dashboard > Settings > Domains. To verify whether the Heroku setup is working, open a browser and navigate to https://_your-app-name_.herokuapp.com/v1/serversdk/getcurrencydetails. The default currency details are displayed. **note:** `/v1/serversdk` is a default API prefix which can be changed to: `vop_server_sdk/secure-server-reference-app/sdkConfig.ts`/ # Running ServerSDK on a local computer (optional) If desired, follow the steps in this section to run the ServerSDK on a local computer. 1. Using a command line terminal, open the root directory: `vop_server_sdk/secure-server-reference-app`). 2. Run $ npm install to install all dependencies. 3. Run the following commands: 1. $ npm run build - This command will take few seconds to compile and build the typescript files. Once successful, the `/dist` folder is created in the root directory. 2. Run `$ npm start` to start the server. By default, the server will start listening to port 3000. The base API URL will be: http://localhost:3000/v1/serversdk To test whether the API is working, navigate to `http://localhost:3000/v1/serversdk/getcurrencydetail` in a browser. The default currency details are displayed, as shown here: ![Server SDK Installation - API test](https://developer.salesforce.com/docs/media/sdk_default_currency.png) **note:** Ensure that you comment out the lines in `vop_server_sdk/secure-server-reference-app/app.ts` . These settings are required only when you host using a third-party server such as Heroku. ![Server SDK Installation - SDK comment](https://developer.salesforce.com/docs/media/sdk_comment.png) # Sample Basket Usage Scenario in Digital Commerce You can add an offer without any configured attribute values to a basket. 1. Follow the [prerequisites](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-create-basket-with-basketaction.md). 2. Ensure you have run the appropriate batch jobs and configured the appropriate custom settings. See [Preparing Digital Commerce API Caching](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-preparing-digital-commerce-api-caching.md). 3. Execute a call to the [Get Offer Details API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-get-offer-details-api.md). 4. After successfully running GetOfferDetails, copy and save the entire contents of the `OfferDetails` node. For example: `{"result:{"offerDetails":{"offer"...}}}` **note:** To configure the offer before adding it to the basket, modify the `offerDetails` JSON result. 5. Paste the result node from the previous step into the body of the Basket API request. 6. Execute the Create Basket API call: ```nolang Method: POST API: /services/apexrest/vlocity_cmt/v3/catalogs/{catalog_code}/basket Request Body {"basketAction":"AddAfterConfig", "productConfig":{"offerDetails":{"offer": {}}}} ``` # Sample Implementation to Override the 255-Character Limitation The Digital Commerce APIs use the vlocity_cmt**APIParams**c field in the vlocity_cmt**VlocityAPIMetaData**c sObject to configure request response fields, batch size, and other options. This field is also used to identify certain settings of the API while processing batch jobs or while processing API requests at run time. However, the vlocity_cmt_APIParams\_\_c field is by default limited to 255 characters. In some scenarios, this can be insufficient. For example, consider the following JSON request for a batch job: ```nolang {"batchSize":20,"scopeAll":true, "productFields" : ["vlocity_cmt__IsActive__c"]} ``` In this example, if you specify multiple fields in productFields, the vlocity_cmt_APIParams\_\_c field might exceed the 255 character limitation. In such cases, to increase the number of characters this field can contain, you can override the default character limitation. To do this, you can create an Apex class along with an interface implementation. For example, create an implementation similar to the following sample. Sample Implementation Name DCAPIParamsImplementation Sample Implementation Method fetchAPIParamsOverride Input | Key | Type | Description | | ------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------- | | apiName | String | Defines the name of the API from vlocity_cmt**VlocityAPIMetaData**c.vlocity_cmt**APIName**c | | params | String | Defines the parameters of the given API name. This represents vlocity_cmt**VlocityAPIMetaData**c.vlocity_cmt**VlocityAPIMetaData**c | Output | Key | Type | Description | | ------ | ------ | -------------------------------------------------- | | result | String | Updates the API parameters for the given API name. | Sample Implementation ```nolang /* * We can override this default implementation by defining the following interface * INTERFACE : DCAPIParamsInterface */ global class DCAPIParamsImplementation implements vlocity_cmt.VlocityOpenInterface { public static Map < String, String > overiddenParamMap = new Map < String, String > {}; static { //Field should have their own string here for getoffers api overiddenParamMap.put('GetOffers', '{"batchSize":20,"productFields" : ["vlocity_cmt__IsActive__c"]}'); //Field should have their own string here for getofferdetails api overiddenParamMap.put('GetOfferDetails', '{"batchSize":20}'); //Field should have their own string here for getrelatedofferdetails api overiddenParamMap.put('GetRelatedOffers', '{"batchSize":20, "productFields" : ["vlocity_cmt__IsActive__c"]}'); } global DCAPIParamsImplementation() {} global static Boolean invokeMethod(String methodName, Map < String, Object > inputs, Map < String, Object > outputs, Map < String, Object > options) { if (methodName == 'fetchAPIParamsOverride') { return fetchAPIParamsOverride(inputs, outputs, options); } return false; } /* Inputs : 1) key : apiName, type : String 2) key : params, type : String Outputs : 1) key : result, type : String */ public static Boolean fetchAPIParamsOverride(Map < String, Object > inputs, Map < String, Object > outputs, Map < String, Object > options) { String apiName = (String) inputs.get('apiName'); String overiddenParam = overiddenParamMap.get(apiName) == null ? ((String) inputs.get('params')) : overiddenParamMap.get(apiName); outputs.put('result', overiddenParam); return true; } } ``` # Save Template Creates a new Sales Configuration Template by cloning an existing Quote or Order. ## Resource Information - **Resource URL:** `/services/apexrest//v1/cpq/templates` - **HTTP Method:** POST - **Content-Type:** application/json - **Response Format:** JSON ## Request Body | Parameter | Type | Required | Description | | ------------ | ------- | -------- | ------------------------------------------------------------------------------ | | cartId | String | Yes | The ID of the source Quote, Order, or Opportunity to save as a template. | | templateName | String | Yes | The name for the new template. | | description | String | No | A description of the template. | | category | String | No | The category for the template (defaults to "General" if not provided). | | asyncMode | Boolean | No | Set to true to run the clone operation asynchronously. Default value is false. | | pricing | Boolean | No | Set to true to execute pricing on the cloned cart. Default value is false. | | validation | Boolean | No | Set to true to execute validation on the cloned cart. Default value is false. | ## Example REST Request ``` { "cartId": "0Q0xx0000004CabCAE", "templateName": "Enterprise Fiber Bundle", "description": "Standard fiber bundle with router and installation for enterprise customers", "category": "Enterprise", "asyncMode": false, "pricing": false, "validation": false } ``` ## Example REST Response Success Response (200): ``` { "success": true, "errorCode": "INVOKE-200", "error": "OK", "result": { "messages": [], "records": [ { "templateId": "a1Bxx0000004XyzDEF" } ] } } ``` Success Response - Async Mode (200): ``` { "success": true, "errorCode": "INVOKE-200", "error": "OK", "result": { "messages": [], "records": [ { "templateId": "a1Bxx0000004XyzDEF", "jobId": "7071T00000ABCDEFGH" } ] } } ``` # SDK Core Class Structure and Methods The Software Development Kit (SDK) is used by developers to create applications that call the Digital Commerce APIs. **Fall '20 Release** The main class is VlocityDigitalCommerce, which has the following methods: - [getOffers](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/sdk/classes/_digitalcommerce_digitalcommerce_sdk_.digitalcommerce.html#getoffers)() - Retrieve a list of offers - Maps to GetOffersByCatalog API (/v3/catalogs/{catalog_code}/offers) or, if the **contains** parameter is specified, maps to the GetContainsProducts API (/v3/catalogs/{ catalog_code}/offers?contains={product_code}) - [getFilteredOffersList](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/sdk/classes/_digitalcommerce_digitalcommerce_sdk_.digitalcommerce.html#getfilteredofferslist) - Retrieves a filtered list of products and promotions. - [getOffer](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/sdk/classes/_digitalcommerce_digitalcommerce_sdk_.digitalcommerce.html#getoffer)() - Retrieves an offer with details - Maps to GetOfferDetails API (/v3/catalogs/{ catalog_code}/offers/{offer_code}) - [validateOffer](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/sdk/classes/_digitalcommerce_digitalcommerce_sdk_.digitalcommerce.html#validateoffer)() - Validates an offer - Maps to Configure Offer API (/v3/catalogs/{ catalog_code}/offers/{offer_code}) - If the offer is of `offerType=Promotion`, then the client must get the transactionKey from the first response and then call the same API again with transactionKey in the request POST body. This complexity is handled inside the SDK; therefore the client only needs to call the SDK configureOfferDetails method once regardless of what the offerType is. - [addToBasket](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/sdk/classes/_digitalcommerce_digitalcommerce_sdk_.digitalcommerce.html#addtocart)() - maps to Basket API: (/v3/catalogs/{catalog_code}/basket) - If the offer is of `offerType=Promotion`, then the client must get the transactionKey from the first response and then call the same API again with transactionKey inside the request Post body. This complexity is handled inside the SDK; therefore client only needs to call SDK addToBasket method once regardless of what the offerType is. - The basket is tracked using the cartContextKey in the URL; for an empty basket, there is no need to pass the cartContextKey. After the first call, cartContextKey is returned and the client must include this in all subsequent calls with cartContextKey in request Body. This complexity is handled and automated inside this SDK method. - [updateItemsInCart](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/sdk/classes/_digitalcommerce_digitalcommerce_sdk_.digitalcommerce.html#updateitemsincart)() - maps to Basket API: (/v3/catalogs/{catalog_code}/basket/{cart_context_key}) - If the offer is of `offerType=Promotion`, then the client must get the transactionKey from the first response and then call the same API again with transactionKey inside the request Post body. This complexity is handled inside the SDK; therefore client only needs to call SDK addToBasket method once regardless of what the offerType is. - The basket is tracked using the cartContextKey in the URL; for an empty basket, there is no need to pass the cartContextKey. After the first call, cartContextKey is returned and the client must include this in all subsequent calls with cartContextKey in request Body. This complexity is handled and automated inside this SDK method. - [checkoutCart](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/sdk/classes/_digitalcommerce_digitalcommerce_sdk_.digitalcommerce.html#checkoutcart)() - Maps to the [Create Cart from Basket API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-create-cart-from-basket.md) (/v3/carts) - [getPromotions](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/sdk/classes/_digitalcommerce_digitalcommerce_sdk_.digitalcommerce.html#getpromotions)() - Maps to GetOffersByCatalog API: /v3/catalogs/{catalog_code}/offers - Returns promotions for all products or for an associated to product. - [assetToBasket](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/sdk/classes/_digitalcommerce_digitalcommerce_sdk_.digitalcommerce.html#assettobasket)() - Maps to Basket API: /v3/catalogs/{catalog_code}/basket/{asset_ID} - Create a basket from a given asset ID - [authenticateUser](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/sdk/classes/_digitalcommerce_digitalcommerce_sdk_.digitalcommerce.html#authenticateuser)() - Maps to SignIn API: {checkout_SDK_node_server_URL}/signIn - Maps to SignUp API: {checkout_SDK_node_server_URL}/signUp - Securely login to salesforce using checkout node server SDK - [updateBillingDetails](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/sdk/classes/_digitalcommerce_digitalcommerce_sdk_.digitalcommerce.html#updatebillingdetails)() - Maps to SignIn API: {checkout_SDK_node_server_URL}/updateDetails - Securely update shipping and billing address to the Salesforce user account. - [saveCart](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/sdk/classes/_digitalcommerce_digitalcommerce_sdk_.digitalcommerce.html#savecart)() - Maps to SignIn API: {checkout_SDK_node_server_URL}/createOrder - Securely save the cart by creating an Order. - [submitOrder](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/sdk/classes/_digitalcommerce_digitalcommerce_sdk_.digitalcommerce.html#submitorder)() - Maps to SignIn API: {checkout_SDK_node_server_URL}/submitOrder - Securely create and submit order for given accountId and cartContextKey - [signOutUser](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/sdk/classes/_digitalcommerce_digitalcommerce_sdk_.digitalcommerce.html#signoutuser) - Signs out the user from the ServerSDK. See the [SDK Reference](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/sdk/index.html) for more details. For reference information about the Spring '20 SDK release, see [Digital Commerce Lightning Web Components (107.0)](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc107/lwc/107.0/index.html). # SDK Example: Add a Child Product to the Basket (Fall '19) Use the example SDK code in this topic to add a child product to a basket. ```nolang // Instantiate the input object for AddToCartInput to specify parameters const input = digitalCommerce.createAddToCartInput(); input.catalogCode = "Mobiles"; // use your Catalog Code input.basketAction = "AddChildProduct"; // deleting an offer that was added to cart input.actionParams = { rootProductCode: "iPhoneX", // use your rootProductCode parentLineKey: "c3a4590a2d231e7022e04e5eba539ead", // use your parentLineKey parentHierarchyPath: "01tf2000007Rb9JAAS", // use your parentHierarchyPath offer: "DeclineEquipmentProtection", // use your offer_code cartContextkey: "d80b2927f07938aefdc7e2e349e2ede7", // use your cartContextKey bundleContextKey: "c3a4590a2d231e7022e04e5eba539ead" // use your bundleContextKey}; input.customFields = ["customAttribute__c"]; // optional field which returns custom fields for given keys // Invoke Basket API via method addToBasket()digitalCommerce .addToCart(input) .then(response => { Logger.info( "Vlocity digital commerce addToCart with basketAction=AddChildProduct for anonymous user: " + JSON.stringify(response) ); }) .catch(error => { Logger.info( "addToBasket with basketAction=AddChildProduct for anonymous user rest call failed" + error ); }); ``` Possible error conditions: "AddToCartInput::getAPIPath() must have catalogCode." "AddToCartInput::getAnonymousSiteRestUrl() must have catalogCode." "AddToCartInput::getRequestPayload() must have basketAction." "AddToCartInput::getRequestPayload() must have rootProductCode when basketAction is 'AddChildProduct'." "AddToCartInput::getRequestPayload() must have parentLineKey when basketAction is 'AddChildProduct'." "AddToCartInput::getRequestPayload() must have parentHierarchyPath when basketAction is 'AddChildProduct'." "AddToCartInput::getRequestPayload() must have offer when basketAction is 'AddChildProduct'." "AddToCartInput::getRequestPayload() must have cartContextkey when basketAction is 'AddChildProduct'." "AddToCartInput::getRequestPayload() must have bundleContextKey when basketAction is 'AddChildProduct'." # SDK Example: Add a Child Product to the Basket (Fall '20) Use the example SDK code in this topic to add a child product to a basket. ```nolang // Instantiate the input object for AddToCartInput to specify parameters const input = digitalCommerce.createAddToCartInput(); input.catalogCode = "Mobiles"; // use your Catalog Code input.basketAction = "AddChildProduct"; // deleting an offer that was added to cart input.basketKey = "01tf2000007Rb9JAAS"; // use your basketKey input.actionParams = { rootProductCode: "iPhoneX", // use your rootProductCode parentLineKey: "c3a4590a2d231e7022e04e5eba539ead", // use your parentLineKey parentHierarchyPath: "01tf2000007Rb9JAAS", // use your parentHierarchyPath offer: "DeclineEquipmentProtection", // use your offer_code cartContextkey: "d80b2927f07938aefdc7e2e349e2ede7", // use your cartContextKey bundleContextKey: "c3a4590a2d231e7022e04e5eba539ead" // use your bundleContextKey}; input.customFields = ["customAttribute__c"]; // optional field which returns custom fields for given keys // Invoke Basket API via method addToBasket()digitalCommerce .addToCart(input) .then(response => { Logger.info( "Vlocity digital commerce addToCart with basketAction=AddChildProduct for anonymous user: " + JSON.stringify(response) ); }) .catch(error => { Logger.info( "addToBasket with basketAction=AddChildProduct for anonymous user rest call failed" + error ); }); ``` Possible error conditions: "AddToCartInput::getAPIPath() must have catalogCode." "AddToCartInput::getAnonymousSiteRestUrl() must have catalogCode." "AddToCartInput::getRequestPayload() must have basketAction." "AddToCartInput::getRequestPayload() must have rootProductCode when basketAction is 'AddChildProduct'." "AddToCartInput::getRequestPayload() must have parentLineKey when basketAction is 'AddChildProduct'." "AddToCartInput::getRequestPayload() must have parentHierarchyPath when basketAction is 'AddChildProduct'." "AddToCartInput::getRequestPayload() must have offer when basketAction is 'AddChildProduct'." "AddToCartInput::getRequestPayload() must have cartContextkey when basketAction is 'AddChildProduct'." "AddToCartInput::getRequestPayload() must have bundleContextKey when basketAction is 'AddChildProduct'." # SDK Example: Add a Child Product to the Basket (Winter '20) Use the example SDK code in this topic to add a child product to a basket. ```nolang // Instantiate the input object for AddToCartInput to specify parameters const input = digitalCommerce.createAddToCartInput(); input.catalogCode = "Mobiles"; // use your Catalog Code input.basketAction = "AddChildProduct"; // deleting an offer that was added to cart input.basketKey = "01tf2000007Rb9JAAS"; // use your basketKey input.actionParams = { rootProductCode: "iPhoneX", // use your rootProductCode parentLineKey: "c3a4590a2d231e7022e04e5eba539ead", // use your parentLineKey parentHierarchyPath: "01tf2000007Rb9JAAS", // use your parentHierarchyPath offer: "DeclineEquipmentProtection", // use your offer_code cartContextkey: "d80b2927f07938aefdc7e2e349e2ede7", // use your cartContextKey bundleContextKey: "c3a4590a2d231e7022e04e5eba539ead" // use your bundleContextKey}; input.customFields = ["customAttribute__c"]; // optional field which returns custom fields for given keys // Invoke Basket API via method addToBasket()digitalCommerce .addToCart(input) .then(response => { Logger.info( "Vlocity digital commerce addToCart with basketAction=AddChildProduct for anonymous user: " + JSON.stringify(response) ); }) .catch(error => { Logger.info( "addToBasket with basketAction=AddChildProduct for anonymous user rest call failed" + error ); }); ``` Possible error conditions: "AddToCartInput::getAPIPath() must have catalogCode." "AddToCartInput::getAnonymousSiteRestUrl() must have catalogCode." "AddToCartInput::getRequestPayload() must have basketAction." "AddToCartInput::getRequestPayload() must have rootProductCode when basketAction is 'AddChildProduct'." "AddToCartInput::getRequestPayload() must have parentLineKey when basketAction is 'AddChildProduct'." "AddToCartInput::getRequestPayload() must have parentHierarchyPath when basketAction is 'AddChildProduct'." "AddToCartInput::getRequestPayload() must have offer when basketAction is 'AddChildProduct'." "AddToCartInput::getRequestPayload() must have cartContextkey when basketAction is 'AddChildProduct'." "AddToCartInput::getRequestPayload() must have bundleContextKey when basketAction is 'AddChildProduct'." # SDK Example: Add a Configured Offer to the Cart (Fall '19) Use the example SDK code in this topic to add a previously configured offer to a cart. ````nolang ```javascript const addToCartInput = digitalCommerce.createAddToCartInput(); addToCartInput.catalogCode = "Phones"; addToCartInput.offerConfiguration = digitalCommerce.getSelectedOffer(offerCode); addToCartInput.customFields = ["customAttribute__c"]; // optional field which returns custom fields for given keys return digitalCommerce.addToCart(addToCartInput); }) .then(addToCartResponse => { Logger.info(addToCartResponse.orderId); }) .catch(error => { Logger.info("addToCart login user dual fail: " + error); }); ```` # SDK Example: Add to Cart with Configuration Changes (Fall '19) Use the example SDK code in this topic to add an already configured item to a cart. ````nolang ```javascript const addToCartInput = digitalCommerce.createAddToCartInput(); addToCartInput.catalogCode = "Phones"; addToCartInput.offerConfiguration = digitalCommerce.getSelectedOffer(offerCode); addToCartInput.customFields = ["customAttribute__c"]; // optional field which returns custom fields for given keys input.basketAction = "AddAfterConfig"; return digitalCommerce.addToCart(addToCartInput); }) .then(addToCartResponse => { Logger.info(addToCartResponse.orderId); }) .catch(error => { Logger.info("addToCart login user dual fail: " + error); }); ```` # SDK Example: Add to Cart with Configuration Changes (Fall '20) Use the example SDK code in this topic to add an already configured item to a cart. ````nolang // ```javascript const addToCartInput = digitalCommerce.createAddToCartInput(); addToCartInput.catalogCode = "Phones"; addToCartInput.offerConfiguration = digitalCommerce.getSelectedOffer(offerCode); addToCartInput.customFields = ["customAttribute__c"]; // optional field which returns custom fields for given keys input.basketAction = "AddAfterConfig"; return digitalCommerce.addToCart(addToCartInput); }) .then(addToCartResponse => { Logger.info(addToCartResponse.orderId); }) .catch(error => { Logger.info("addToCart login user dual fail: " + error); }); ```` # SDK Example: Add to Cart with Configuration Changes (Winter '20) Use the example SDK code in this topic to add an already configured item to a cart. ````nolang // ```javascript const addToCartInput = digitalCommerce.createAddToCartInput(); addToCartInput.catalogCode = "Phones"; addToCartInput.offerConfiguration = digitalCommerce.getSelectedOffer(offerCode); addToCartInput.customFields = ["customAttribute__c"]; // optional field which returns custom fields for given keys input.basketAction = "AddAfterConfig"; return digitalCommerce.addToCart(addToCartInput); }) .then(addToCartResponse => { Logger.info(addToCartResponse.orderId); }) .catch(error => { Logger.info("addToCart login user dual fail: " + error); }); ```` # SDK Example: Add to Cart with No Configuration Changes (Fall '19) Use the example SDK code in this topic to add an already configured item to a cart. ```nolang // Instantiate the input object for addToCart to specify parameters const input = digitalCommerce.createAddToCartInput(); input.catalogCode = "Mobiles"; // use your Catalog Code input.basketAction = "AddWithNoConfig"; // adding an offer that has not been configured (no change in its json structure from getOfferDetails) to cart input.offerCode = "iPhone8Offer"; // use your Offer Code to be added to cart input.customFields = ["customAttribute__c"]; // optional field which returns custom fields for given keys // Invoke Cart API via method addToCart() digitalCommerce .addToCart(input) .then(response => { Logger.info( "Vlocity digital commerce addToCart with basketAction=AddWithNoConfig for anonymous user: " + JSON.stringify(response) ); return response; }) .catch(error => { Logger.error( "addToCart() with basketAction=AddWithNoConfig failed" + error ); }); ``` Possible error conditions: "AddTocartInput::getAPIPath() must have catalogCode." "AddTocartInput::getAnonymousSiteRestUrl() must have catalogCode." "AddTocartInput::getRequestPayload() must have basketAction." "AddTocartInput::getRequestPayload() must have offerCode." "AddTocartInput::getRequestPayload() must have offer when basketAction is 'AddWithNoConfig'." # SDK Example: Add to Cart with No Configuration Changes (Fall '20) Use the example SDK code in this topic to add an already configured item to a cart. ```nolang // Instantiate the input object for addToCart to specify parameters const input = digitalCommerce.createAddToCartInput(); input.catalogCode = "Mobiles"; // use your Catalog Code input.basketAction = "AddWithNoConfig"; // adding an offer that has not been configured (no change in its json structure from getOfferDetails) to cart input.offerCode = "iPhone8Offer"; // use your Offer Code to be added to cart input.customFields = ["customAttribute__c"]; // optional field which returns custom fields for given keys // Invoke Cart API via method addToCart() digitalCommerce .addToCart(input) .then(response => { Logger.info( "Vlocity digital commerce addToCart with basketAction=AddWithNoConfig for anonymous user: " + JSON.stringify(response) ); return response; }) .catch(error => { Logger.error( "addToCart() with basketAction=AddWithNoConfig failed" + error ); }); ``` Possible error conditions: "AddTocartInput::getAPIPath() must have catalogCode." "AddTocartInput::getAnonymousSiteRestUrl() must have catalogCode." "AddTocartInput::getRequestPayload() must have basketAction." "AddTocartInput::getRequestPayload() must have offerCode." "AddTocartInput::getRequestPayload() must have offer when basketAction is 'AddWithNoConfig'." # SDK Example: Add to Cart with No Configuration Changes (Winter '20) Use the example SDK code in this topic to add an already configured item to a cart. ```nolang // Instantiate the input object for addToCart to specify parameters const input = digitalCommerce.createAddToCartInput(); input.catalogCode = "Mobiles"; // use your Catalog Code input.basketAction = "AddWithNoConfig"; // adding an offer that has not been configured (no change in its json structure from getOfferDetails) to cart input.offerCode = "iPhone8Offer"; // use your Offer Code to be added to cart input.customFields = ["customAttribute__c"]; // optional field which returns custom fields for given keys // Invoke Cart API via method addToCart() digitalCommerce .addToCart(input) .then(response => { Logger.info( "Vlocity digital commerce addToCart with basketAction=AddWithNoConfig for anonymous user: " + JSON.stringify(response) ); return response; }) .catch(error => { Logger.error( "addToCart() with basketAction=AddWithNoConfig failed" + error ); }); ``` Possible error conditions: "AddTocartInput::getAPIPath() must have catalogCode." "AddTocartInput::getAnonymousSiteRestUrl() must have catalogCode." "AddTocartInput::getRequestPayload() must have basketAction." "AddTocartInput::getRequestPayload() must have offerCode." "AddTocartInput::getRequestPayload() must have offer when basketAction is 'AddWithNoConfig'." # SDK Example: Authenticate a User (Winter '20) Use the example SDK code in this topic to sign in or sign up a user and authenticate. ```nolang // Instantiate the input object for authenticateUser to specify parameters const input = digitalCommerce.createAuthenticateUserInput(); input.email = "YOUR EMAIL ID"; input.password = "YOUR PASSWORD"; input.phoneNumber = "1234567889"; input.firstName = "YOUR FIRST NAME"; input.lastName = "YOUR LAST NAME"; input.signUp = true; // optional - default is false // Invoke authenticateUser API digitalCommerce .authenticateUser(input) .then(response => { Logger.info( "Vlocity digital commerce authenticateUser: " + JSON.stringify(response) ); }) .catch(error => { Logger.info("authenticateUser apexrest call failed" + error); }); ``` Possible error conditions: "AuthenticateUserInput::getRequestPayload() must have email." "AuthenticateUserInput::getRequestPayload() must have password." "AuthenticateUserInput::getRequestPayload() must have phoneNumber." "AssetToBasketInput::getRequestPayload() must have rootAssetIds." "AuthenticateUserInput::getRequestPayload() must have firstName." "AuthenticateUserInput::getRequestPayload() must have lastName. # SDK Example: Checkout Cart (Fall '19) Use the example SDK code in this topic to check out a cart. ```nolang // Instantiate the input object for checkoutCart to specify parameters const input = digitalCommerce.checkoutCartInput(); input.catalogCode = "Mobiles"; // use your Catalog Code input.accountId = "001f200001eSlhe"; // use your account Id input.cartContextKey = "d5ff11cccd19472ca7c21fa80bc93d2a"; // Used in Checkout process to persist shopping cart content into SF Database digitalCommerce .checkoutCart(input) .then(response => { Logger.info( "Vlocity digital commerce checkout cart for anonymous user: " + JSON.stringify(response) ); }) .catch(error => { Logger.info("checkout cart for anonymous user rest call failed" + error); }); ``` Possible error conditions: "checkoutCartInput::getAPIPath() must have catalogCode." "checkoutCartInput::getAPIPath() must have accountId." "checkoutCartInput::getAnonymousSiteRestUrl() must have catalogCode." "checkoutCartInput::getAnonymousSiteRestUrl() must have accountId." "checkoutCartInput::getRequestPayload() must have cartContextKey." # SDK Example: Checkout Cart (Fall '20) Use the example SDK code in this topic to check out a cart. ```nolang // Instantiate the input object for checkoutCart to specify parameters const input = digitalCommerce.checkoutCartInput(); input.catalogCode = "Mobiles"; // use your Catalog Code input.accountId = "001f200001eSlhe"; // use your account Id input.cartContextKey = "d5ff11cccd19472ca7c21fa80bc93d2a"; // Used in Checkout process to persist shopping cart content into SF Database digitalCommerce .checkoutCart(input) .then(response => { Logger.info( "Vlocity digital commerce checkout cart for anonymous user: " + JSON.stringify(response) ); }) .catch(error => { Logger.info("checkout cart for anonymous user rest call failed" + error); }); ``` Possible error conditions: "checkoutCartInput::getAPIPath() must have catalogCode." "checkoutCartInput::getAPIPath() must have accountId." "checkoutCartInput::getAnonymousSiteRestUrl() must have catalogCode." "checkoutCartInput::getAnonymousSiteRestUrl() must have accountId." "checkoutCartInput::getRequestPayload() must have cartContextKey." # SDK Example: Checkout Cart (Winter '20) Use the example SDK code in this topic to check out a cart. ```nolang // Instantiate the input object for checkoutCart to specify parameters const input = digitalCommerce.checkoutCartInput(); input.catalogCode = "Mobiles"; // use your Catalog Code input.accountId = "001f200001eSlhe"; // use your account Id input.cartContextKey = "d5ff11cccd19472ca7c21fa80bc93d2a"; // Used in Checkout process to persist shopping cart content into SF Database digitalCommerce .checkoutCart(input) .then(response => { Logger.info( "Vlocity digital commerce checkout cart for anonymous user: " + JSON.stringify(response) ); }) .catch(error => { Logger.info("checkout cart for anonymous user rest call failed" + error); }); ``` Possible error conditions: "checkoutCartInput::getAPIPath() must have catalogCode." "checkoutCartInput::getAPIPath() must have accountId." "checkoutCartInput::getAnonymousSiteRestUrl() must have catalogCode." "checkoutCartInput::getAnonymousSiteRestUrl() must have accountId." "checkoutCartInput::getRequestPayload() must have cartContextKey." # SDK Example: Create a Basket from an Asset (Fall '20) Use the example SDK code in this topic to create a basket from an existing asset. ```nolang // Instantiate the input object for assetToBasket to specify parameters const input = digitalCommerce.createAssetToBasketInput(); input.catalogCode = "Phones"; // use your Catalog Code input.basketAction = "assetToBasket"; input.isLoggedIn = true; input.canCreateBasket = false; // optional - default is false input.context = '{"accountId":"YOUR ACCOUNT ID", "contractId":"YOUR CONTRACT ID"}'; input.validatePrice = true; // optional - default is true input.validateAction = true; // optional - default is true input.rootAssetIds = "02i4P000009ion5QAA,02i4P000009ion6QAA"; input.requestDateTime = "2019-08-10T00:00:000z"; // date or date time in UTC format. // Invoke assetToBasket API via method assetToBasket() digitalCommerce .assetToBasket(input) .then(response => { Logger.info( "Vlocity digital commerce assetToBasket: " + JSON.stringify(response) ); }) .catch(error => { Logger.info("assetToBasket apexrest call failed" + error); }); ``` Possible error conditions: "AssetToBasketInput::getAPIPath() must have catalogCode." "AssetToBasketInput::getAPIPath() must have context." "AssetToBasketInput::getAPIPath() must have set isLoggedIn=true." "AssetToBasketInput::getRequestPayload() must have rootAssetIds." "AssetToBasketInput::getRequestPayload() must have basketAction." "AssetToBasketInput::getRequestPayload() must have valid requestDateTime input." # SDK Example: Create a Basket from an Asset (Winter '20) Use the example SDK code in this topic to create a basket from an existing asset. ```nolang // Instantiate the input object for assetToBasket to specify parameters const input = digitalCommerce.createAssetToBasketInput(); input.catalogCode = "Phones"; // use your Catalog Code input.basketAction = "assetToBasket"; input.isLoggedIn = true; input.canCreateBasket = false; // optional - default is false input.context = '{"accountId":"YOUR ACCOUNT ID", "contractId":"YOUR CONTRACT ID"}'; input.validatePrice = true; // optional - default is true input.validateAction = true; // optional - default is true input.rootAssetIds = "02i4P000009ion5QAA,02i4P000009ion6QAA"; input.requestDateTime = "2019-08-10T00:00:000z"; // date or date time in UTC format. // Invoke assetToBasket API via method assetToBasket() digitalCommerce .assetToBasket(input) .then(response => { Logger.info( "Vlocity digital commerce assetToBasket: " + JSON.stringify(response) ); }) .catch(error => { Logger.info("assetToBasket apexrest call failed" + error); }); ``` Possible error conditions: "AssetToBasketInput::getAPIPath() must have catalogCode." "AssetToBasketInput::getAPIPath() must have context." "AssetToBasketInput::getAPIPath() must have set isLoggedIn=true." "AssetToBasketInput::getRequestPayload() must have rootAssetIds." "AssetToBasketInput::getRequestPayload() must have basketAction." "AssetToBasketInput::getRequestPayload() must have valid requestDateTime input." # SDK Example: Create and Submit the Order (Winter '20) Use the example SDK code in this topic to create and submit the order as the final step in the checkout process. ```nolang // Instantiate the input object for submitOrder to specify parameters const input = digitalCommerce.createSubmitOrderInput(); input.email = "YOUR EMAIL ID"; input.catalogCode = "CATALOG CODE"; input.cartContextKey = "CART CONTEXT KEY"; input.orderId = "ORDER ID"; // optional parameter // Invoke submitOrder API digitalCommerce .submitOrder(input) .then(response => { Logger.info( "Vlocity digital commerce submitOrder: " + JSON.stringify(response) ); }) .catch(error => { Logger.info("submitOrder apexrest call failed" + error); }); ``` Possible error conditions: "SubmitOrderInput::getRequestPayload() must have email." "SubmitOrderInput::getRequestPayload() must have catalogCode." "SubmitOrderInput::getRequestPayload() must have cartContextKey." # SDK Example: Delete a Child Product from the Basket (Fall '19) Use the example SDK code in this topic to delete a child product from a basket. ```nolang // Instantiate the input object for AddToCartInput to specify parameters const input = digitalCommerce.createAddToCartInput(); input.catalogCode = "Mobiles"; // use your Catalog Code input.basketAction = "DeleteChildProduct"; // deleting an offer that was added to cart input.actionParams = { lineItemKey: "d83f475a776049d21054c105e9d53ee9", // use your lineItemKey cartContextkey: "d80b2927f07938aefdc7e2e349e2ede7", // use your cartContextKey bundleContextKey: "c3a4590a2d231e7022e04e5eba539ead" // use your bundleContextKey}; input.customFields = ["customAttribute__c"]; // optional field which returns custom fields for given keys // Invoke Basket API via method addToBasket() digitalCommerce .addToCart(input) .then(response => { Logger.info( "Vlocity digital commerce addToCart with basketAction=DeleteChildProduct for anonymous user: " + JSON.stringify(response) ); }) .catch(error => { Logger.info( "addToBasket with basketAction=DeleteChildProduct for anonymous user rest call failed" + error ); }); ``` Possible error conditions: "AddToCartInput::getAPIPath() must have catalogCode." "AddToCartInput::getAnonymousSiteRestUrl() must have catalogCode." "AddToCartInput::getRequestPayload() must have basketAction." "AddToCartInput::getRequestPayload() must have lineItemKey when basketAction is 'DeleteChildProduct'." "AddToCartInput::getRequestPayload() must have cartContextkey when basketAction is 'DeleteChildProduct'." "AddToCartInput::getRequestPayload() must have bundleContextKey when basketAction is 'DeleteChildProduct'." # SDK Example: Delete a Child Product from the Basket (Fall '20) Use the example SDK code in this topic to delete a child product from a basket. ```nolang // Instantiate the input object for AddToCartInput to specify parameters const input = digitalCommerce.createAddToCartInput(); input.catalogCode = "Mobiles"; // use your Catalog Code input.basketAction = "DeleteChildProduct"; // deleting an offer that was added to cart input.actionParams = { lineItemKey: "d83f475a776049d21054c105e9d53ee9", // use your lineItemKey cartContextkey: "d80b2927f07938aefdc7e2e349e2ede7", // use your cartContextKey bundleContextKey: "c3a4590a2d231e7022e04e5eba539ead" // use your bundleContextKey}; input.customFields = ["customAttribute__c"]; // optional field which returns custom fields for given keys // Invoke Basket API via method addToBasket() digitalCommerce .addToCart(input) .then(response => { Logger.info( "Vlocity digital commerce addToCart with basketAction=DeleteChildProduct for anonymous user: " + JSON.stringify(response) ); }) .catch(error => { Logger.info( "addToBasket with basketAction=DeleteChildProduct for anonymous user rest call failed" + error ); }); ``` Possible error conditions: "AddToCartInput::getAPIPath() must have catalogCode." "AddToCartInput::getAnonymousSiteRestUrl() must have catalogCode." "AddToCartInput::getRequestPayload() must have basketAction." "AddToCartInput::getRequestPayload() must have lineItemKey when basketAction is 'DeleteChildProduct'." "AddToCartInput::getRequestPayload() must have cartContextkey when basketAction is 'DeleteChildProduct'." "AddToCartInput::getRequestPayload() must have bundleContextKey when basketAction is 'DeleteChildProduct'." # SDK Example: Delete a Child Product from the Basket (Winter '20) Use the example SDK code in this topic to delete a child product from a basket. ```nolang // Instantiate the input object for AddToCartInput to specify parameters const input = digitalCommerce.createAddToCartInput(); input.catalogCode = "Mobiles"; // use your Catalog Code input.basketAction = "DeleteChildProduct"; // deleting an offer that was added to cart input.actionParams = { lineItemKey: "d83f475a776049d21054c105e9d53ee9", // use your lineItemKey cartContextkey: "d80b2927f07938aefdc7e2e349e2ede7", // use your cartContextKey bundleContextKey: "c3a4590a2d231e7022e04e5eba539ead" // use your bundleContextKey}; input.customFields = ["customAttribute__c"]; // optional field which returns custom fields for given keys // Invoke Basket API via method addToBasket() digitalCommerce .addToCart(input) .then(response => { Logger.info( "Vlocity digital commerce addToCart with basketAction=DeleteChildProduct for anonymous user: " + JSON.stringify(response) ); }) .catch(error => { Logger.info( "addToBasket with basketAction=DeleteChildProduct for anonymous user rest call failed" + error ); }); ``` Possible error conditions: "AddToCartInput::getAPIPath() must have catalogCode." "AddToCartInput::getAnonymousSiteRestUrl() must have catalogCode." "AddToCartInput::getRequestPayload() must have basketAction." "AddToCartInput::getRequestPayload() must have lineItemKey when basketAction is 'DeleteChildProduct'." "AddToCartInput::getRequestPayload() must have cartContextkey when basketAction is 'DeleteChildProduct'." "AddToCartInput::getRequestPayload() must have bundleContextKey when basketAction is 'DeleteChildProduct'." # SDK Example: Delete From Basket (Fall '19) Use the example SDK code in this topic to do an addToBasket with basketAction=DeleteFromBasket. The call must have deleteBundleNumber as an input parameter. ```nolang // Instantiate the input object for the addToBasket method to specify parameters. const input = digitalCommerce.createAddToBasketInput(); // Use your AWS gateway. input.anonymousSiteUrl = "https://mubnr8cjgl.execute-api.us-west-2.amazonaws.com/prod/dc"; // Use your Catalog Code. input.catalogCode = "Mobiles"; // Delete an offer that was added to basket. input.basketAction = "DeleteFromBasket"; input.forceInvalidateCache = true; // The basket item list grows from the bottom up. For example: if you add products A, B, and C in that order, // the JSONResult.records list would be C,B,A with respective numbering as 0,1,2. // The 0 item will always be the most recent addition. input.deleteBundleNumber = 0; // Invoke the Basket API via the addToBasket() method. digitalCommerce .addToBasket(input) .then(response => { Logger.info( "Vlocity digital commerce addToBasket with basketAction=DeleteFromBasket for anonymous user: " + JSON.stringify(response) ); }) .catch(error => { Logger.info( "addToBasket with basketAction=DeleteFromBasket for anonymous user rest call failed" + error ); }); ``` Possible error conditions: "AddToBasketInput::getAPIPath() must have catalogCode." "AddToBasketInput::getAnonymousRestUrl() must have anonymousSiteUrl." "AddToBasketInput::getAnonymousSiteRestUrl() must have catalogCode." "AddToBasketInput::getPostBody() must have basketAction." "AddToBasketInput::getPostBody() must have deleteBundleNumber when basketAction is 'DeleteFromBasket'." # SDK Example: Delete From Basket (Fall '20) Use the example SDK code in this topic to addToBasket with basketAction=DeleteFromBasket. The call must have deleteBundleNumber as an input parameter. ```nolang // Instantiate the input object for the addToBasket method to specify parameters. const input = digitalCommerce.createAddToBasketInput(); // Use your AWS gateway. input.anonymousSiteUrl = "https://mubnr8cjgl.execute-api.us-west-2.amazonaws.com/prod/dc"; // Use your Catalog Code. input.catalogCode = "Mobiles"; // Delete an offer that was added to basket. input.basketAction = "DeleteFromBasket"; input.forceInvalidateCache = true; // The basket item list grows from the bottom up. For example: if you add products A, B, and C in that order, // the JSONResult.records list would be C,B,A with respective numbering as 0,1,2. // The 0 item will always be the most recent addition. input.deleteBundleNumber = 0; // Invoke the Basket API via the addToBasket() method. digitalCommerce .addToBasket(input) .then(response => { Logger.info( "Vlocity digital commerce addToBasket with basketAction=DeleteFromBasket for anonymous user: " + JSON.stringify(response) ); }) .catch(error => { Logger.info( "addToBasket with basketAction=DeleteFromBasket for anonymous user rest call failed" + error ); }); ``` Possible error conditions: "AddToBasketInput::getAPIPath() must have catalogCode." "AddToBasketInput::getAnonymousRestUrl() must have anonymousSiteUrl." "AddToBasketInput::getAnonymousSiteRestUrl() must have catalogCode." "AddToBasketInput::getPostBody() must have basketAction." "AddToBasketInput::getPostBody() must have deleteBundleNumber when basketAction is 'DeleteFromBasket'." # SDK Example: Delete From Basket (Winter '20) Use the example SDK code in this topic to do an addToBasket with basketAction=DeleteFromBasket. The call must have deleteBundleNumber as an input parameter. ```nolang // Instantiate the input object for the addToBasket method to specify parameters. const input = digitalCommerce.createAddToBasketInput(); // Use your AWS gateway. input.anonymousSiteUrl = "https://mubnr8cjgl.execute-api.us-west-2.amazonaws.com/prod/dc"; // Use your Catalog Code. input.catalogCode = "Mobiles"; // Delete an offer that was added to basket. input.basketAction = "DeleteFromBasket"; input.forceInvalidateCache = true; // The basket item list grows from the bottom up. For example: if you add products A, B, and C in that order, // the JSONResult.records list would be C,B,A with respective numbering as 0,1,2. // The 0 item will always be the most recent addition. input.deleteBundleNumber = 0; // Invoke the Basket API via the addToBasket() method. digitalCommerce .addToBasket(input) .then(response => { Logger.info( "Vlocity digital commerce addToBasket with basketAction=DeleteFromBasket for anonymous user: " + JSON.stringify(response) ); }) .catch(error => { Logger.info( "addToBasket with basketAction=DeleteFromBasket for anonymous user rest call failed" + error ); }); ``` Possible error conditions: "AddToBasketInput::getAPIPath() must have catalogCode." "AddToBasketInput::getAnonymousRestUrl() must have anonymousSiteUrl." "AddToBasketInput::getAnonymousSiteRestUrl() must have catalogCode." "AddToBasketInput::getPostBody() must have basketAction." "AddToBasketInput::getPostBody() must have deleteBundleNumber when basketAction is 'DeleteFromBasket'." # SDK Example: Get Cart Details (Fall '19) Use the example SDK code in this topic to obtain details about a cart. ```nolang // Instantiate the input object for getItemsInCart to specify parameters const input = digitalCommerce.createGetItemsInCartInput(); input.catalogCode = "Phones"; // use your Catalog Code input.cartContextKey = "01tf2000007Rb9JAAS"; // use your cart_context_key input.cacheable = true; // Optional boolean flag to indicate if the sdk call should be cached. Default is false. input.reload = true; // Optional boolean flag to discard cache and call the api again Default is false. input.customFields = ["customAttribute__c"]; // optional field which returns your custom attributes or any given keys // Invoke get basket API via method getItemsInCart() digitalCommerce .getItemsInCart(input) .then(response => { Logger.info("vlocity get cart items anonymous user rest call" + response); }) .catch(error => { Logger.info("get cart items anonymous user rest call failed" + error); }); ``` Possible error conditions: "GetItemsInCartInput::getAPIPath() must have catalogCode." "GetItemsInCartInput::getAPIPath() must have cartContextKey." # SDK Example: Get Cart Details (Fall '20 version) Use the example SDK code in this topic to obtain details about a cart. ```nolang // Instantiate the input object for getItemsInCart to specify parameters const input = digitalCommerce.createGetItemsInCartInput(); input.catalogCode = "Phones"; // use your Catalog Code input.cartContextKey = "01tf2000007Rb9JAAS"; // use your cart_context_key input.cacheable = true; // Optional boolean flag to indicate if the sdk call should be cached. Default is false. input.reload = true; // Optional boolean flag to discard cache and call the api again Default is false. input.customFields = ["customAttribute__c"]; // optional field which returns your custom attributes or any given keys // Invoke get basket API via method getItemsInCart() digitalCommerce .getItemsInCart(input) .then(response => { Logger.info("vlocity get cart items anonymous user rest call" + response); }) .catch(error => { Logger.info("get cart items anonymous user rest call failed" + error); }); ``` Possible error conditions: "GetItemsInCartInput::getAPIPath() must have catalogCode." "GetItemsInCartInput::getAPIPath() must have cartContextKey." # SDK Example: Get Cart Details (Winter '20) Use the example SDK code in this topic to obtain details about a cart. ```nolang // Instantiate the input object for getItemsInCart to specify parameters const input = digitalCommerce.createGetItemsInCartInput(); input.catalogCode = "Phones"; // use your Catalog Code input.cartContextKey = "01tf2000007Rb9JAAS"; // use your cart_context_key input.cacheable = true; // Optional boolean flag to indicate if the sdk call should be cached. Default is false. input.reload = true; // Optional boolean flag to discard cache and call the api again Default is false. input.customFields = ["customAttribute__c"]; // optional field which returns your custom attributes or any given keys // Invoke get basket API via method getItemsInCart() digitalCommerce .getItemsInCart(input) .then(response => { Logger.info("vlocity get cart items anonymous user rest call" + response); }) .catch(error => { Logger.info("get cart items anonymous user rest call failed" + error); }); ``` Possible error conditions: "GetItemsInCartInput::getAPIPath() must have catalogCode." "GetItemsInCartInput::getAPIPath() must have cartContextKey." # SDK Example: Get filtered list of products and promotions (Fall '20) Use the example SDK code in this topic to retrieve a list of products and promotions. ```nolang // Instantiate the input object for getOffers to specify parameters. const input = digitalCommerce.createGetOffersInput(); input.catalogCode = "Phones"; // use your Catalog Code input.returnPromotion = true; // If undefined return both products and promotions, If true return only promotions, If false return only products - optional // Invoke GetOffersByCatalog API via method getFilteredOffersList() digitalCommerce .getFilteredOffersList(input) .then(result => { Logger.info( "vlocity get catalog filtered offers list anonymous user rest call" + result ); }) .catch(error => { Logger.info("get catalog offers anonymous user rest call failed" + error); }); ``` Possible error conditions: "GetCatalogOffersInput::getAPIPath() must have catalogCode." "GetCatalogOffersInput::getAnonymousRestUrl() must have anonymousSiteUrl." "GetCatalogOffersContainsInput::getAPIPath() should not have both sortBy and contains." "GetCatalogOffersContainsInput::getAnonymousRestUrl() should not have both sortBy and contains." # SDK Example: Get Filtered List of Products and Promotions (Winter '20) Use the example SDK code in this topic to retrieve a filtered list of products and promotions. ```nolang // Instantiate the input object for getOffers to specify parameters. const input = digitalCommerce.createGetOffersInput(); input.catalogCode = "Phones"; // use your Catalog Code input.returnPromotion = true; // If undefined return both products and promotions, If true return only promotions, If false return only products - optional // Invoke GetOffersByCatalog API via method getFilteredOffersList() digitalCommerce .getFilteredOffersList(input) .then(result => { Logger.info( "vlocity get catalog filtered offers list anonymous user rest call" + result ); }) .catch(error => { Logger.info("get catalog offers anonymous user rest call failed" + error); }); ``` Possible error conditions: "GetCatalogOffersInput::getAPIPath() must have catalogCode." "GetCatalogOffersInput::getAnonymousRestUrl() must have anonymousSiteUrl." "GetCatalogOffersContainsInput::getAPIPath() should not have both sortBy and contains." "GetCatalogOffersContainsInput::getAnonymousRestUrl() should not have both sortBy and contains." # SDK Example: Get List of Promotions or Promotions associated with a Product (Fall '20) Use the example SDK code in this topic to retrieve all promotions or promotions that are associated with a product. ```nolang // Instantiate the input object for getOffers to specify parameters. const input = digitalCommerce.createGetOffersInput(); input.catalogCode = "Phones"; // use your Catalog Code input.offerCode = "iPhoneX"; // If offerCode value is passed return all associated promotions for that product.If offerCode not passed return all promotions associated to products. - optional // Invoke GetOffersByCatalog API via method getPromotions() digitalCommerce .getPromotions(input) .then(result => { Logger.info("vlocity get promotions anonymous user rest call" + result); }) .catch(error => { Logger.info("get promotions anonymous user rest call failed" + error); }); ``` Possible error conditions: "GetCatalogOffersInput::getAPIPath() must have catalogCode." "GetCatalogOffersInput::getAnonymousRestUrl() must have anonymousSiteUrl." "GetCatalogOffersContainsInput::getAPIPath() should not have both sortBy and contains. "GetCatalogOffersContainsInput::getAnonymousRestUrl() should not have both sortBy and contains." # SDK Example: Get List of Promotions or Promotions associated with a Product (Winter '20) Use the example SDK code in this topic to retrieve all promotions or promotions that are associated with a product. ```nolang // Instantiate the input object for getOffers to specify parameters. const input = digitalCommerce.createGetOffersInput(); input.catalogCode = "Phones"; // use your Catalog Code input.offerCode = "iPhoneX"; // If offerCode value is passed return all associated promotions for that product.If offerCode not passed return all promotions associated to products. - optional // Invoke GetOffersByCatalog API via method getPromotions() digitalCommerce .getPromotions(input) .then(result => { Logger.info("vlocity get promotions anonymous user rest call" + result); }) .catch(error => { Logger.info("get promotions anonymous user rest call failed" + error); }); ``` Possible error conditions: "GetCatalogOffersInput::getAPIPath() must have catalogCode." "GetCatalogOffersInput::getAnonymousRestUrl() must have anonymousSiteUrl." "GetCatalogOffersContainsInput::getAPIPath() should not have both sortBy and contains. "GetCatalogOffersContainsInput::getAnonymousRestUrl() should not have both sortBy and contains." # SDK Example: getCatalogOffers with the `contains` parameter (Fall '19) Use the example SDK code in this topic to get catalog offers with the `contains` parameter. ```nolang // Instantiate the input object for getOffers to specify parameters const input = digitalCommerce.createGetOffersInput(); input.catalogCode = "Phones"; // use your Catalog Code input.offset = 0; // use for pagination - optional input.pageSize = 5; // use for pagination - optional input.contains = "iPhone8"; // find all offers that CONTAIN "iPhone8" - optional input.customFields = ["customAttribute__c"]; // optional field which returns custom fields for given keys // Invoke GetContainsProducts API via method getOffers() digitalCommerce .getOffers(input) .then(result => { Logger.info("vlocity get offers anonymous user rest call" + result); }) .catch(error => { Logger.info("get offers anonymous user rest call failed" + error); }); ``` Possible error conditions: "GetOffersInput::getAPIPath() must have catalogCode." "GetOffersContainsInput::getAPIPath() should not have both sortBy and contains." "GetOffersInput::getAnonymousRestUrl() must have catalogCode." "GetOffersContainsInput::getAnonymousRestUrl() should not have both sortBy and contains." # SDK Example: getCatalogOffers with the contains parameter (Fall '20 version) Use the example SDK code in this topic to obtain catalog offers with the `contains` parameter. ```nolang // Instantiate the input object for getOffers to specify parameters const input = digitalCommerce.createGetOffersInput(); input.catalogCode = "Phones"; // use your Catalog Code input.offset = 0; // use for pagination - optional input.pageSize = 5; // use for pagination - optional input.contains = "iPhone8"; // find all offers that CONTAIN "iPhone8" - optional input.customFields = ["customAttribute__c"]; // optional field which returns custom fields for given keys input.secureApiCall = false; // set to true if needs secure api calls without context parameters and session key. // Invoke GetContainsProducts API via method getOffers() digitalCommerce .getOffers(input) .then(result => { Logger.info("vlocity get offers anonymous user rest call" + result); }) .catch(error => { Logger.info("get offers anonymous user rest call failed" + error); }); ``` Possible error conditions: "GetOffersInput::getAPIPath() must have catalogCode." "GetOffersContainsInput::getAPIPath() should not have both sortBy and contains." "GetOffersInput::getAnonymousRestUrl() must have catalogCode." "GetOffersContainsInput::getAnonymousRestUrl() should not have both sortBy and contains." # SDK Example: getCatalogOffers with the `contains` parameter (Winter '20) Use the example SDK code in this topic to get catalog offers with the `contains` parameter. ```nolang // Instantiate the input object for getOffers to specify parameters const input = digitalCommerce.createGetOffersInput(); input.catalogCode = "Phones"; // use your Catalog Code input.offset = 0; // use for pagination - optional input.pageSize = 5; // use for pagination - optional input.contains = "iPhone8"; // find all offers that CONTAIN "iPhone8" - optional input.customFields = ["customAttribute__c"]; // optional field which returns custom fields for given keys input.secureApiCall = false; // set to true if needs secure api calls without context parameters and session key. // Invoke GetContainsProducts API via method getOffers() digitalCommerce .getOffers(input) .then(result => { Logger.info("vlocity get offers anonymous user rest call" + result); }) .catch(error => { Logger.info("get offers anonymous user rest call failed" + error); }); ``` Possible error conditions: "GetOffersInput::getAPIPath() must have catalogCode." "GetOffersContainsInput::getAPIPath() should not have both sortBy and contains." "GetOffersInput::getAnonymousRestUrl() must have catalogCode." "GetOffersContainsInput::getAnonymousRestUrl() should not have both sortBy and contains." # SDK Example: getCatalogOffers without the `contains` parameter (Fall '19) Use the example SDK code in this topic to get catalog offers without the `contains` parameter. ```nolang // Instantiate the input object for getCatalogOffers to specify parameters const input = digitalCommerce.createGetOffersInput(); input.catalogCode = "Phones"; // use your Catalog Code input.offset = 0; // use for pagination - optional input.pageSize = 5; // use for pagination - optional input.isLoggedIn = true; // use to fetch offers based on given accountId - optional input.context = '{"accountId":"ACCOUNT ID", "contractId":"CONTRACT ID"}'; // use to fetch offers based on context params - optional input.includeAttributes = ["ishidden__c", "customAttribute__c"]; //includeExtraOfferAttributes as part of the query string of the API which includes extra passed attributes with default attributes in Offer - optional input.customFields = ["customAttribute__c"]; // optional field which returns custom fields for given keys // Invoke GetOffersByCatalog API via method getCatalogOffers() digitalCommerce .getOffers(input) .then(result => { Logger.info("vlocity get offers anonymous user rest call" + result); }) .catch(error => { Logger.info("get offers anonymous user rest call failed" + error); }); ``` Possible error conditions: "GetOffersInput::getAPIPath() must have catalogCode." "GetOffersInput::getAnonymousRestUrl() must have catalogCode." # SDK Example: getCatalogOffers without the contains parameter (Winter '20) Use the example SDK code in this topic to getCatalogOffers without the `contains` parameter. ```nolang // Instantiate the input object for getCatalogOffers to specify parameters const input = digitalCommerce.createGetOffersInput(); input.catalogCode = "Phones"; // use your Catalog Code input.offset = 0; // use for pagination - optional input.pageSize = 5; // use for pagination - optional input.isLoggedIn = true; // use to fetch offers based on given accountId - optional input.secureApiCall = false; // set to true if needs secure api calls without context parameters and session key. input.context = '{"accountId":"ACCOUNT ID", "contractId":"CONTRACT ID"}'; // use to fetch offers based on context params - optional input.includeAttributes = ["ishidden__c", "customAttribute__c"]; //includeExtraOfferAttributes as part of the query string of the API which includes extra passed attributes with default attributes in Offer - optional input.customFields = ["customAttribute__c"]; // optional field which returns custom fields for given keys // Invoke GetOffersByCatalog API via method getCatalogOffers() digitalCommerce .getOffers(input) .then(result => { Logger.info("vlocity get offers anonymous user rest call" + result); }) .catch(error => { Logger.info("get offers anonymous user rest call failed" + error); }); ``` Possible error conditions: "GetOffersInput::getAPIPath() must have catalogCode." "GetOffersInput::getAnonymousRestUrl() must have catalogCode." # SDK Example: getOfferDetails via API (Fall '19) Use the example SDK code in this topic to validate an offer. ```nolang // Instantiate the input object for getOfferDetails to specify parameters const input = digitalCommerce.createGetOfferInput(); input.catalogCode = "Phones"; // use your Catalog Code input.offerCode = "iPhoneXS"; // use your Offer Code input.cacheable = false; // Optional Flag to indicate if the sdk call should be cached. Default is false. input.reload = false; // Optional Boolean flag to discard cache and call the api again. Default is false. input.isLoggedIn = true; // use to fetch offers based on given accountId - optional input.context = '{"accountId":"ACCOUNT ID"}'; // use to fetch offers based on given context params - optional input.customFields = ["customAttribute__c"]; // optional field which returns your custom attributes or any given keys // Invoke GetOfferDetails API via method getOfferDetails() digitalCommerce .getOffer(input) .then(response => { Logger.info("vlocity get offer anonymous user rest call" + response); }) .catch(error => { Logger.info("get offer anonymous user rest call failed" + error); }); ``` Possible error conditions: "GetOfferInput::getAPIPath() must have catalogCode." "GetOfferInput::getAPIPath() must have offerCode." # SDK Example: getOfferDetails via API (Fall '20) Use the example SDK code in this topic to obtain offer details via the API. ```nolang // Instantiate the input object for getOfferDetails to specify parameters const input = digitalCommerce.createGetOfferInput(); input.catalogCode = "Phones"; // use your Catalog Code input.offerCode = "iPhoneXS"; // use your Offer Code input.cacheable = false; // Optional Flag to indicate if the sdk call should be cached. Default is false. input.reload = false; // Optional Boolean flag to discard cache and call the api again. Default is false. input.isLoggedIn = true; // use to fetch offers based on given accountId - optional input.context = '{"accountId":"ACCOUNT ID"}'; // use to fetch offers based on given context params - optional input.customFields = ["customAttribute__c"]; // optional field which returns your custom attributes or any given keys // Invoke GetOfferDetails API via method getOfferDetails() digitalCommerce .getOffer(input) .then(response => { Logger.info("vlocity get offer anonymous user rest call" + response); }) .catch(error => { Logger.info("get offer anonymous user rest call failed" + error); }); ``` Possible error conditions: - "GetOfferInput::getAPIPath() must have catalogCode." - "GetOfferInput::getAPIPath() must have offerCode." # SDK Example: getOfferDetails via API (Winter '20) Use the example SDK code in this topic to get offer details through the AP. ```nolang // Instantiate the input object for getOfferDetails to specify parameters const input = digitalCommerce.createGetOfferInput(); input.catalogCode = "Phones"; // use your Catalog Code input.offerCode = "iPhoneXS"; // use your Offer Code input.cacheable = false; // Optional Flag to indicate if the sdk call should be cached. Default is false. input.reload = false; // Optional Boolean flag to discard cache and call the api again. Default is false. input.isLoggedIn = true; // use to fetch offers based on given accountId - optional input.context = '{"accountId":"ACCOUNT ID"}'; // use to fetch offers based on given context params - optional input.customFields = ["customAttribute__c"]; // optional field which returns your custom attributes or any given keys // Invoke GetOfferDetails API via method getOfferDetails() digitalCommerce .getOffer(input) .then(response => { Logger.info("vlocity get offer anonymous user rest call" + response); }) .catch(error => { Logger.info("get offer anonymous user rest call failed" + error); }); ``` Possible error conditions: "GetOfferInput::getAPIPath() must have catalogCode." "GetOfferInput::getAPIPath() must have offerCode." # SDK Example: Save the Cart (Winter '20) Use the example SDK code in this topic to save the cart by creating an order for the specified basket. ```nolang // Instantiate the input object for saveCart to specify parameters const input = digitalCommerce.createSaveCartInput(); input.email = "YOUR EMAIL ID"; input.catalogCode = "CATALOG CODE"; input.cartContextKey = "CART CONTEXT KEY"; // Invoke saveCart API digitalCommerce .saveCart(input) .then(response => { Logger.info( "Vlocity digital commerce saveCart: " + JSON.stringify(response) ); }) .catch(error => { Logger.info("saveCart apexrest call failed" + error); }); ``` Possible error conditions: "SaveCartInput::getRequestPayload() must have email." "SaveCartInput::getRequestPayload() must have catalogCode." "SaveCartInput::getRequestPayload() must have cartContextKey." # SDK Example: Sign Out User (Fall '20) Use the example SDK code in this topic sign out a user. ```nolang // Instantiate the input object for signOutUser to specify parameters const input = digitalCommerce.createSignOutUserInput(); // Invoke authenticateUser API digitalCommerce .signOutUser(input) .then(response => { Logger.info( "Vlocity digital commerce signOutUser: " + JSON.stringify(response) ); }) .catch(error => { Logger.info("signOutUser call failed" + error); }); ``` # SDK Example: Update Billing and Shipping Details (Winter '20) Use the example SDK code in this topic to update user account billing and shipping details. ```nolang // Instantiate the input object for updateBillingDetails to specify parameters const input = digitalCommerce.createUpdateBillingDetailsInput(); input.email = "YOUR EMAIL ID"; input.billingCity = "Bengaluru"; input.billingState = "KA"; input.billingAddress = "Vlocity, Cessna Business Tech Park"; input.billingZipCode = "560103"; input.shippingCity = "Bengaluru"; input.shippingState = "KA"; input.shippingAddress = "Vlocity, Cessna Business Tech Park"; input.shippingZipCode = "560103"; // Invoke updateBillingDetails API digitalCommerce .updateBillingDetails(input) .then(response => { Logger.info( "Vlocity digital commerce updateBillingDetails: " + JSON.stringify(response) ); }) .catch(error => { Logger.info("updateBillingDetails apexrest call failed" + error); }); ``` Possible error conditions: "UpdateBillingDetailsInput::getRequestPayload() must have email." "UpdateBillingDetailsInput::getRequestPayload() must have billingCity." "UpdateBillingDetailsInput::getRequestPayload() must have billingState." "UpdateBillingDetailsInput::getRequestPayload() must have billingAddress." "UpdateBillingDetailsInput::getRequestPayload() must have billingZipCode." "UpdateBillingDetailsInput::getRequestPayload() must have shippingCity." "UpdateBillingDetailsInput::getRequestPayload() must have shippingState." "UpdateBillingDetailsInput::getRequestPayload() must have shippingAddress." "UpdateBillingDetailsInput::getRequestPayload() must have shippingZipCode." # SDK Example: Update Items in Basket (Fall '19) Use the example SDK code in this topic to update items in a basket. ```nolang // Instantiate the input object for AddToCartInput to specify parameters let input = Object.assign( this.digitalCommerceSDK.createUpdateItemsInCartInput(), { catalogCode: "Phones", basketkey: "01tf2000007Rb9JAAS", basketAction: "updateBasket", bundleContextKey: "", lineItemKey: "", quantity: 2, customFields: ["customAttribute__c"] } ); this.digitalCommerceSDK .updateItemsInCart(input) .then(response => { Logger.info( "Vlocity digital commerce updateItemsInCart for anonymous user: " + JSON.stringify(response) ); }) .catch(error => { Logger.info("updateItemsInCart action failed: ", error); }); ``` Possible error conditions: "UpdateItemsInCart::getAPIPath() must have catalogCode." "UpdateItemsInCart::getAnonymousSiteRestUrl() must have catalogCode." "UpdateItemsInCart::getRequestPayload() must have basketAction." "UpdateItemsInCart::getRequestPayload() must have lineItemKey when basketAction is 'updateBasket'." "UpdateItemsInCart::getRequestPayload() must have basketkey when basketAction is 'updateBasket'." "UpdateItemsInCart::getRequestPayload() must have bundleContextKey when basketAction is 'updateBasket'." # SDK Example: Update Items in Basket (Fall '20) Use the example SDK code in this topic to update items in a basket. ```nolang // Instantiate the input object for AddToCartInput to specify parameters let input = Object.assign( this.digitalCommerceSDK.createUpdateItemsInCartInput(), { catalogCode: "Phones", basketkey: "01tf2000007Rb9JAAS", basketAction: "updateBasket", bundleContextKey: "", lineItemKey: "", quantity: 2, customFields: ["customAttribute__c"] } ); this.digitalCommerceSDK .updateItemsInCart(input) .then(response => { Logger.info( "Vlocity digital commerce updateItemsInCart for anonymous user: " + JSON.stringify(response) ); }) .catch(error => { Logger.info("updateItemsInCart action failed: ", error); }); ``` Possible error conditions: "UpdateItemsInCart::getAPIPath() must have catalogCode." "UpdateItemsInCart::getAnonymousSiteRestUrl() must have catalogCode." "UpdateItemsInCart::getRequestPayload() must have basketAction." "UpdateItemsInCart::getRequestPayload() must have lineItemKey when basketAction is 'updateBasket'." "UpdateItemsInCart::getRequestPayload() must have basketkey when basketAction is 'updateBasket'." "UpdateItemsInCart::getRequestPayload() must have bundleContextKey when basketAction is 'updateBasket'." # SDK Example: Update Items in Basket (Winter '20) Use the example SDK code in this topic to update items in a basket. ```nolang // Instantiate the input object for AddToCartInput to specify parameters let input = Object.assign( this.digitalCommerceSDK.createUpdateItemsInCartInput(), { catalogCode: "Phones", basketkey: "01tf2000007Rb9JAAS", basketAction: "updateBasket", bundleContextKey: "", lineItemKey: "", quantity: 2, customFields: ["customAttribute__c"] } ); this.digitalCommerceSDK .updateItemsInCart(input) .then(response => { Logger.info( "Vlocity digital commerce updateItemsInCart for anonymous user: " + JSON.stringify(response) ); }) .catch(error => { Logger.info("updateItemsInCart action failed: ", error); }); ``` Possible error conditions: "UpdateItemsInCart::getAPIPath() must have catalogCode." "UpdateItemsInCart::getAnonymousSiteRestUrl() must have catalogCode." "UpdateItemsInCart::getRequestPayload() must have basketAction." "UpdateItemsInCart::getRequestPayload() must have lineItemKey when basketAction is 'updateBasket'." "UpdateItemsInCart::getRequestPayload() must have basketkey when basketAction is 'updateBasket'." "UpdateItemsInCart::getRequestPayload() must have bundleContextKey when basketAction is 'updateBasket'." # SDK Example: ValidateOffer (Fall '19) Use the example SDK code in this topic to validate an offer. ```nolang // Instantiate the input object for validateOffer to specify parameters const input = digitalCommerce.createValidateOfferInput(); input.catalogCode = "Phones"; // use your Catalog Code input.offerCode = "iPhoneX"; // use your Offer Code // input.offerConfiguration: use digitalCommerce.getSelectedOffer(offerCode) input.offerConfiguration = digitalCommerce.getSelectedOffer(offerCode); input.customFields = ["customAttribute__c"]; // optional field which returns your custom attributes or any given keys // Invoke ConfigureOfferDetails API via method validateOffer() digitalCommerce .validateOffer(input) .then(response => { Logger.info( "vlocity validate offer for anonymous user" + JSON.stringify(response) ); }) .catch(error => { Logger.info("vlocity validateOffer for anonymous user failed" + error); }); ``` Possible error conditions: "ValidateOfferInput::getAPIPath() must have catalogCode." "ValidateOfferInput::getAPIPath() must have offerCode." "ValidateOfferInput::getPostBody() must have productConfiguration." # SDK Example: ValidateOffer (Fall '20) Use the example SDK code in this topic to validate an offer. ```nolang // Instantiate the input object for validateOffer to specify parameters const input = digitalCommerce.createValidateOfferInput(); input.catalogCode = "Phones"; // use your Catalog Code input.offerCode = "iPhoneX"; // use your Offer Code (Fall '20) // input.offerConfiguration: use digitalCommerce.getSelectedOffer(offerCode) input.offerConfiguration = digitalCommerce.getSelectedOffer(offerCode); input.customFields = ["customAttribute__c"]; // optional field which returns your custom attributes or any given keys input.secureApiCall = false; // set to true if needs secure api calls without context parameters and session key. // Invoke ConfigureOfferDetails API via method validateOffer() digitalCommerce .validateOffer(input) .then(response => { Logger.info( "vlocity validate offer for anonymous user" + JSON.stringify(response) ); }) .catch(error => { Logger.info("vlocity validateOffer for anonymous user failed" + error); }); ``` Possible error conditions: "ValidateOfferInput::getAPIPath() must have catalogCode." "ValidateOfferInput::getAPIPath() must have offerCode." "ValidateOfferInput::getPostBody() must have productConfiguration." # SDK Example: ValidateOffer (Winter '20) Use the example SDK code in this topic to validate an offer. ```nolang // Instantiate the input object for validateOffer to specify parameters const input = digitalCommerce.createValidateOfferInput(); input.catalogCode = "Phones"; // use your Catalog Code input.offerCode = "iPhoneX"; // use your Offer Code // input.offerConfiguration: use digitalCommerce.getSelectedOffer(offerCode) input.offerConfiguration = digitalCommerce.getSelectedOffer(offerCode); input.customFields = ["customAttribute__c"]; // optional field which returns your custom attributes or any given keys input.secureApiCall = false; // set to true if needs secure api calls without context parameters and session key. // Invoke ConfigureOfferDetails API via method validateOffer() digitalCommerce .validateOffer(input) .then(response => { Logger.info( "vlocity validate offer for anonymous user" + JSON.stringify(response) ); }) .catch(error => { Logger.info("vlocity validateOffer for anonymous user failed" + error); }); ``` Possible error conditions: "ValidateOfferInput::getAPIPath() must have catalogCode." "ValidateOfferInput::getAPIPath() must have offerCode." "ValidateOfferInput::getPostBody() must have productConfiguration." # SDK Usage Examples (Fall '19 version) This topic and the topics that follow illustrate several examples for instantiating and using the Digital Commerce SDK. ````nolang // Instantiate DigitalCommerceConfig for anonymous user const digitalCommerceConfig = VlocitySDK.digitalcommerce.createConfigForAnonymousUser(); // Instantiate the SDK itselfconst digitalCommerce = VlocitySDK.digitalcommerce.getInstance(digitalCommerceConfig); OR // Instantiate DigitalCommerceConfig for login user const digitalCommerceConfig = VlocitySDK.digitalcommerce.createConfigForLoginUser(salesforceUrl, sessionToken); // Instantiate the SDK itself const digitalCommerce = VlocitySDK.digitalcommerce.getInstance(digitalCommerceConfig); // To override the default namespace with your custom namespace this.digitalCommerce.namespace = "vlocity_cmt"; // use your custom namespace // To override the default custom api URL with your custom api URL this.digitalCommerce.apiURL = "YOUR_CUSTOM_API_URL"; // use your custom URL // To override the default api URL authTokenthis.digitalCommerce.authToken = "YOUR_CUSTOM_AUTH_TOKEN"; // use your custom authToken Note: digitalCommerce is a Singleton object. Calling getInstance(digitalCommerceConfig) repeatedly will return the same instance instantiated the first time when getInstance(digitalCommerceConfig) was called. // To instantiate a new instance of digitalCommerce, set create to true in the digitalCommerceConfig object: digitalCommerceConfig.create = true; digitalCommerce = VlocitySDK.digitalcommerce.getInstance(digitalCommerceConfig);``` ```` Possible error conditions: - "VlocityDigitalCommerce::getInstance: Config object must be given in argument to create an instance the first time." - "VlocityDigitalCommerce::constructor: VlocityDigitalCommerce cannot be instantiated properly. Both datasource and user context objects have to be in Config object as argument." # SDK Usage Examples (Fall '20 version) This topic and the topics that follow illustrate several examples for instantiating and using the Digital Commerce SDK. ```nolang // Instantiate DigitalCommerceConfig for anonymous user const digitalCommerceConfig = VlocitySDK.digitalcommerce.createConfigForAnonymousUser(); // Instantiate the SDK itself const digitalCommerce = VlocitySDK.digitalcommerce.getInstance(digitalCommerceConfig); OR // Instantiate DigitalCommerceConfig for login user const digitalCommerceConfig = VlocitySDK.digitalcommerce.createConfigForLoginUser(salesforceUrl, sessionToken); // Instantiate DigitalCommerceConfig for login user with proxy server URL const digitalCommerceConfig = VlocitySDK.digitalcommerce.createConfigForLoginUser(salesforceUrl, sessionToken, proxyUrl); // Instantiate the SDK itself const digitalCommerce = VlocitySDK.digitalcommerce.getInstance(digitalCommerceConfig); // To override the default namespace with your custom namespace this.digitalCommerce.namespace = "vlocity_cmt"; // use your custom namespace // To override the default custom api URL with your custom api URL this.digitalCommerce.apiURL = "YOUR_CUSTOM_API_URL"; // use your custom URL // To override the default api URL authToken this.digitalCommerce.authToken = "YOUR_CUSTOM_AUTH_TOKEN"; // use your custom authToken Note: digitalCommerce is a Singleton object. Calling getInstance(digitalCommerceConfig) repeatedly will return the same instance instantiated the first time when getInstance(digitalCommerceConfig) was called. // To instantiate a new instance of digitalCommerce, set create to true in the digitalCommerceConfig object: digitalCommerceConfig.create = true; digitalCommerce = VlocitySDK.digitalcommerce.getInstance(digitalCommerceConfig); ``` Possible error conditions: - "VlocityDigitalCommerce::getInstance: Config object must be given in argument to create an instance the first time." - "VlocityDigitalCommerce::constructor: VlocityDigitalCommerce cannot be instantiated properly. Both datasource and user context objects have to be in Config object as argument." # SDK Usage Examples (Winter '20 version) This topic and the topics that follow illustrate several examples for instantiating and using the Digital Commerce SDK. ````nolang // Instantiate DigitalCommerceConfig for anonymous user const digitalCommerceConfig = VlocitySDK.digitalcommerce.createConfigForAnonymousUser(); // Instantiate the SDK itselfconst digitalCommerce = VlocitySDK.digitalcommerce.getInstance(digitalCommerceConfig); OR // Instantiate DigitalCommerceConfig for login user const digitalCommerceConfig = VlocitySDK.digitalcommerce.createConfigForLoginUser(salesforceUrl, sessionToken); // Instantiate the SDK itself const digitalCommerce = VlocitySDK.digitalcommerce.getInstance(digitalCommerceConfig); // To override the default namespace with your custom namespace this.digitalCommerce.namespace = "vlocity_cmt"; // use your custom namespace // To override the default custom api URL with your custom api URL this.digitalCommerce.apiURL = "YOUR_CUSTOM_API_URL"; // use your custom URL // To override the default api URL authTokenthis.digitalCommerce.authToken = "YOUR_CUSTOM_AUTH_TOKEN"; // use your custom authToken Note: digitalCommerce is a Singleton object. Calling getInstance(digitalCommerceConfig) repeatedly will return the same instance instantiated the first time when getInstance(digitalCommerceConfig) was called. // To instantiate a new instance of digitalCommerce, set create to true in the digitalCommerceConfig object: digitalCommerceConfig.create = true; digitalCommerce = VlocitySDK.digitalcommerce.getInstance(digitalCommerceConfig);``` ```` Possible error conditions: - "VlocityDigitalCommerce::getInstance: Config object must be given in argument to create an instance the first time." - "VlocityDigitalCommerce::constructor: VlocityDigitalCommerce cannot be instantiated properly. Both datasource and user context objects have to be in Config object as argument." # Search Templates Searches, filters, sorts, and paginates Sales Configuration Templates, supporting field-level filtering (AND logic), free-text search (OR logic), tag-based filtering, and multi-field sorting. ## Resource Information - **Resource URL:** `/services/apexrest//v1/cpq/templates/search` - **HTTP Method:** POST - **Content-Type:** application/json - **Response Format:** JSON ## Request Body | Parameter | Type | Required | Description | | --------- | ------- | -------- | -------------------------------------------------------------- | | filter | Object | No | Filter criteria applied with AND logic. | | offset | Integer | No | Number of records to skip. Default value is 0. | | pageSize | Integer | No | Number of results per page. Default value is 20. | | search | Object | No | Search criteria applied with OR logic across specified fields. | | sortby | Array | No | Array of sort clauses. | ## Example REST Request: Full Search ``` { "filter": { "criteria": [ { "field": "Status__c", "operator": "=", "values": "Approved" }, { "field": "Category__c", "operator": "IN", "values": "Enterprise,Premium" } ] }, "search": { "fields": "Name,Description__c,tags", "value": "fiber" }, "sortby": [ { "field": "Name", "direction": "ASC" } ], "pageSize": 10, "offset": 0 } ``` ## Example REST Response Success Response (200): ``` { "success": true, "errorCode": "INVOKE-200", "error": "OK", "result": { "records": [ { "Id": "a1Bxx0000004XyzDEF", "Name": "Enterprise Fiber Bundle", "vlocity_cmt__Description__c": "Standard fiber bundle for enterprise customers", "vlocity_cmt__Status__c": "Approved", "vlocity_cmt__Category__c": "Enterprise", "Tags": ["Enterprise", "Fiber"], "vlocity_cmt__EffectiveOneTimeTotal__c": 299.99, "vlocity_cmt__EffectiveRecurringTotal__c": 89.99, "vlocity_cmt__PriceList__r": { "Id": "a3Dxx0000002GhiJKL", "Name": "Standard Price List", "vlocity_cmt__CurrencyCode__c": "USD" } } ], "messages": [] }, "totalCount": 1, "offset": 0, "pageSize": 10, "totalPages": 1 } ``` # Search Templates Searches, filters, sorts, and paginates Sales Configuration Templates, supporting field-level filtering (AND logic), free-text search (OR logic), tag-based filtering, and multi-field sorting. ## Resource Information - **Resource URL:** `/services/apexrest//v1/cpq/templates/search` - **HTTP Method:** POST - **Content-Type:** application/json - **Response Format:** JSON ## Request Body | Parameter | Type | Required | Description | | --------- | ------- | -------- | -------------------------------------------------------------- | | filter | Object | No | Filter criteria applied with AND logic. | | offset | Integer | No | Number of records to skip. Default value is 0. | | pageSize | Integer | No | Number of results per page. Default value is 20. | | search | Object | No | Search criteria applied with OR logic across specified fields. | | sortby | Array | No | Array of sort clauses. | ## Filter Object ``` { "filter": { "criteria": [ { "field": "Status__c", "operator": "=", "values": "Approved" }, { "field": "Category__c", "operator": "IN", "values": "Enterprise,Premium" } ] } } ``` ### Parameters | Property | Type | Description | | ------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | | criteria | Array | Array of filter criterion objects. All criteria are combined with AND logic. | | criteria[].field | String | The API name of the field to filter on. Supports SalesConfigTemplate\_\_c fields and relationship fields through TemplateQuoteId\_\_r and TemplateOrderId\_\_r. | | criteria[].operator | String | The comparison operator. | | criteria[].values | String | The value(s) to compare against. For IN and NOT IN, provide comma-separated values. | ### Supported Operators | Operator | Description | Example Values | | -------- | ------------------------------------- | ---------------- | | = | Equals | "Approved" | | != | Not equals | "Draft" | | IN | Value is in list | "Draft,Approved" | | NOT IN | Value is not in list | "Obsolete" | | LIKE | Pattern match (auto-adds % wildcards) | "Enterprise" | | > | Greater than | "2024-01-01" | | >= | Greater than or equal | "100" | | < | Less than | "500" | | <= | Less than or equal | "1000" | ## Tag Filtering To filter templates by tag IDs, use the special field name tagIds with the IN operator. ``` { "filter": { "criteria": [ { "field": "tags", "operator": "IN", "values": "Internet,Standard" } ] } } ``` ## Relationship Field Filtering You can filter on fields from the related Quote or Order ``` { "filter": { "criteria": [ { "field": "TemplateQuoteId__r.Name", "operator": "LIKE", "values": "Enterprise" } ] } } ``` **note:** Only TemplateQuoteId\_\_r (Quote) and TemplateOrderId\_\_r (Order) relationships are supported. ## Search Object ``` { "search": { "fields": "Name,Tags", "value": "fiber" } } ``` ### Parameters | Property | Type | Description | | -------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- | | fields | String | Comma-separated list of field names to search across. Use Tags to include tag name matching. All fields are searched with OR logic using LIKE matching. | | value | String | The search term. Automatically wrapped with % wildcards for LIKE queries. | ## Sort Object ``` { "sortby": [ { "field": "Name", "direction": "ASC" }, { "field": "CreatedDate", "direction": "DESC" } ] } ``` ### Parameters | Property | Type | Description | | --------- | ------ | --------------------------------------------------------- | | field | String | The API name of the field to sort by. | | direction | String | "ASC" (ascending) or "DESC" (descending). Default: "ASC". | | ## Example REST Request: Full Search ``` { "filter": { "criteria": [ { "field": "Status__c", "operator": "=", "values": "Approved" }, { "field": "Category__c", "operator": "IN", "values": "Enterprise,Premium" } ] }, "search": { "fields": "Name,Description__c,tags", "value": "fiber" }, "sortby": [ { "field": "Name", "direction": "ASC" } ], "pageSize": 10, "offset": 0 } ``` ## Example REST Response Success Response (200): ``` { "success": true, "errorCode": "INVOKE-200", "error": "OK", "result": { "records": [ { "Id": "a1Bxx0000004XyzDEF", "Name": "Enterprise Fiber Bundle", "vlocity_cmt__Description__c": "Standard fiber bundle for enterprise customers", "vlocity_cmt__Status__c": "Approved", "vlocity_cmt__Category__c": "Enterprise", "Tags": ["Enterprise", "Fiber"], "vlocity_cmt__EffectiveOneTimeTotal__c": 299.99, "vlocity_cmt__EffectiveRecurringTotal__c": 89.99, "vlocity_cmt__PriceList__r": { "Id": "a3Dxx0000002GhiJKL", "Name": "Standard Price List", "vlocity_cmt__CurrencyCode__c": "USD" } } ], "messages": [] }, "totalCount": 1, "offset": 0, "pageSize": 10, "totalPages": 1 } ``` # Set the Time Zone for Your Products and Promotions The Catalog Product Relationship (CPR) determines the effective date and time. When you create a CPR record, you can set the `EffectiveDateTime` and `EndDateTime` fields in the CPR layout. The DateTime information you provide is based on your local time zone, as specified in your user profile. The system automatically converts your local `DateTime` to its GMT equivalent and stores it. This ensures that the `DateTime` information is consistent across different time zones. **note:** This feature is available only to the classic Digital Commerce (DC) customers, and isn't extended to Standard DC or CPQ customers yet. To enable and use the time-zone-aware date feature in CPR objects, follow these steps: 1. Set the Configuration: - From **Vlocity CMT Administration**, click **CPQ Configuration Setup**. - Update the ShouldConsiderUserLocaleforCPR Setting Value to `true` and save your changes. 2. Edit the Catalog Product Relationship Layout. - From Setup in Classic DC user interface, click the **Catalogs** tab - Select a catalog. - From the Catalog Product Relationships section, and click **Edit** on a CPR record. - From the quick access menu, select Edit Layout. - Add the Effective Date Time and End Date Time fields to the layout. - Remove Old Fields: Remove the Effective Date and End Date fields from the CPR layout. 3. Input Local Dates and Times: When creating or updating CPR records, use the Effective Date Time and End Date Time fields to input date and time in the user's local time zone. **note:** If this feature is disabled, users cannot update `EffectiveDateTime__c` and `EndDateTime__c`. If enabled, users cannot update `EffectiveDate__c` and `EndDate__c`, as they are derived from `EffectiveDateTime__c` and `EndDateTime__c`. # Set Up a Connected App for Postman Configuring a connected app for Postman lets you use Postman to get the current session token from the org. 1. In Setup, in **Quick Find**, type `manager`, then click **App Manager**. 2. Click **New Connected App**. 3. Fill in a **Connected App Name**, **API Name**, and **Contact email**. 4. Under **API (Enable OAuth Settings)**, select **Enable OAuth Settings**. 5. [Set up authorization through the connected app and OAuth2.0.](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_oauth_and_connected_apps.htm) 6. Under **Callback URL**, enter the following: ```nolang https://www.getpostman.com/oauth2/callback ``` Your screen looks something like this: ![Connected App Name - Postman](https://developer.salesforce.com/docs/media/postman_connectedapp.png) 7. Click **Save**. The following message displays: ```nolang Changes can take up to 10 minutes to take effect. Deleting a parent org also deletes all connected apps with OAuth settings enabled. ``` 8. Click **Continue**. 9. Under **Consumer Key**, click **Copy**, and paste the value into the `clientId` setting in the environment file you created in the previous task. 10. Under **Consumer Secret**, click the **Click to reveal** link, click **Copy**, and paste the value into the `clientSecret` setting in the environment file. 11. Under **Initial Access Token for Dynamic Client Registration**, click **Generate**, then click **OK** in the pop-up. Click the **Click to reveal** link, click **Copy**, and paste the value into the `initAccessToken` setting in the environment file. 12. Make sure the values in your environment file look something like this, then save the file: ```nolang ... { "key": "clientId", "value": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "enabled": true }, { "key": "clientSecret", "value": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "enabled": true }, { "key": "initAccessToken", "value": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "enabled": true }, ... ``` 13. To return to the connected app later, in **Quick Find**, type `manager`, and click **App Manager**. Find the app in the list, click the down arrow at the right end of the row, and select **View** or **Edit**. Don't go to **Manage Connected Apps** in Setup. That page doesn't display the **Consumer Key**, **Consumer Secret**, or **Initial Access Token Value**. [Set Up Postman, Import the Files, and Get the Token](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-set-up-postmanimport-the-filesand-get-the-token.md) # Set up Attribute-Based Pricing Set up attribute-based pricing for standard cart APIs. In Spring '23 and later, only the DefaultPricingPlan is supported. For more information, see [Attribute-Based Pricing](https://help.salesforce.com/s/articleView?id=ind.comms_Attribute-Based_Pricing_for_Summer_23.htm&type=5) **Before you Begin** To use attribute-based pricing that uses decision matrices with expression sets, assign Business Rule Engine permission sets, Rules Engine Runtime Community Runtime, Rules Engine Designer, and Rules Engine Runtime. For more information, see [Decision Matrices](https://help.salesforce.com/s/articleView?id=sf.decision_matrices.htm&type=5) and [Permission Sets for Business Rules Engine](https://help.salesforce.com/s/articleView?id=sf.permission_sets.htm&type=5). Download the PricingPlanHelper and CustomPricingPlanStepImpl classes from this [zip](https://github.com/Salesforce-Industries-Process-Library/Industries-CPQ) file. 1. From the App Launcher, find and select **Vlocity Product Console**. 2. Under the Pricing section, click the search icon next to Pricing Plan. 3. Search for `Standard Pricing Plan`. 4. Edit the Standard Pricing Plan. 5. Click **Pricing Plan Steps**. 6. Edit the **Get Matrix Price** step. 7. Activate this pricing plan step by selecting Active. 8. Update the Implementation Name and Method Name based on the implementation of attribute-based pricing that you want to use. | Tier | Implementation Name | Method Name | | ----------------- | ------------------------- | -------------- | | Java core service | CpqPricingService | getMatrixPrice | | Apex (VPL) | CustomPricingPlanStepImpl | GetMatrixPrice | 9. In parameters field, specify the parameters depending on your implementation and tier.
**NOTE:** Prices must not be interger value in the matrix for standard cart APIs. When the users create their AttributePricingMatrix, the prices must be in double. For example, if the price is 329, then use 329.00 in the matrix. | Type of Attribute-Based Pricing | Type of Matrix | Parameters for Java Core Service | Parameters for Apex (VPL) | | ------------------------------------------ | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | Standard | DecisionMatrix + ExpressionSets | `{"DecisionMatrix":"true","MatrixVersionId":"0lNxx0000000001EAA","ProcedureName":"ABP-Standard"}` | `{"DecisionMatrix":"true","MatrixName":"AttributePricingMatrix","ProcedureName":"ABP-Standard"}` | | SourceTarget with Target as variable Path1 | DecisionMatrix + ExpressionSets | `{"DecisionMatrix":"true","MatrixVersionId":"0lNxx000000001dEAA","ProcedureName":"SourceTargetAttributePricingMatrix", "Path1":"PRODUCT-ABP-ROOT","DecisionMatrix":"true"}` | `{"RangeFields":"Quantity","ProcedureName":"VolumeBasedPricingProcedure","MatrixName":"VolumeBasedPricingMatrix","DecisionMatrix":"true"}` | | Standard | CalculationMatrix + CalculationProcedure | `{"MatrixVersionId":"0lNxx0000000001EAA","ProcedureName":"ABP-Standard"}` | `{"MatrixName":"AttributePricingMatrix","ProcedureName":"ABP-Standard"}` | | SourceTarget with Target as variable Path1 | CalculationMatrix + CalculationProcedure | `{"MatrixVersionId":"0lNxx000000001dEAA","ProcedureName":"SourceTargetAttributePricingMatrix", "Path1":"PRODUCT-ABP-ROOT{'startDateTime'=>Datetime.now().format(), 'endDateTime'=>Datetime.now().addDays(30).format()}); ``` 1. In Vlocity CMT Administration, run the Generate Compile Matrix Data EPC job. 2. Activate the configuration snapshot by executing following in an anonymous window of the developer console: ``` new vlocity_cmt.TelcoAdminConsoleController().invokeMethod('activateConfigurationSnapshot', new Map()); ``` 3. If you want to use a new matrix version, update the pricing plan step for attribute-based pricing with the ID of the new matrix version. # Set up Attribute-Based Pricing Set up attribute-based pricing for Standard Digital Commerce. In Spring '23 and later, Standard Digital Commerce supports only the DefaultPricingPlan for the Cart Based APIs and the Standard Digital Commerce APIs. **Before you Begin** To use attribute-based pricing that uses decision matrices with expression sets, assign Business Rule Engine permission sets, Rules Engine Runtime Community Runtime, Rules Engine Designer, and Rules Engine Runtime. For more information, see [Decision Matrices](https://help.salesforce.com/s/articleView?id=sf.decision_matrices.htm&type=5) and [Permission Sets for Business Rules Engine](https://help.salesforce.com/s/articleView?id=sf.permission_sets.htm&type=5). Download the PricingPlanHelper and CustomPricingPlanStepImpl classes from this [zip](https://volt.my.salesforce.com/sfc/p/#o0000000IKm8/a/3m000000xbED/lj7EB0e8ac_xrp3lBV0ZbPzZoiQ3G5O5tZVkBunLWI8) file. 1. From the App Launcher, find and select **Vlocity Product Console**. 2. Under the Pricing section, click the search icon next to Pricing Plan. 3. Search for `Standard Pricing Plan`. 4. Edit the Standard Pricing Plan. 5. Click **Pricing Plan Steps**. 6. Edit the **Get Matrix Price** step. 7. Activate this pricing plan step by selecting Active. 8. Update the Implementation Name and Method Name based on the implementation of attribute-based pricing that you want to use. | Tier | Implementation Name | Method Name | | ----------------- | ------------------------- | -------------- | | Java core service | CpqPricingService | getMatrixPrice | | Apex (VPL) | CustomPricingPlanStepImpl | GetMatrixPrice | 9. In parameters field, specify the parameters depending on your implementation and tier.
**NOTE:** Prices must not be interger value in the matrix for standard DC APIs. When the users create their AttributePricingMatrix, the prices must be in double. For example, if the price is 329, then use 329.00 in the matrix. | Type of Attribute-Based Pricing | Type of Matrix | Parameters for Java Core Service | Parameters for Apex (VPL) | | ------------------------------------------ | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | Standard | DecisionMatrix + ExpressionSets | `{"DecisionMatrix":"true","MatrixVersionId":"0lNxx0000000001EAA","ProcedureName":"ABP-Standard"}` | `{"DecisionMatrix":"true","MatrixName":"AttributePricingMatrix","ProcedureName":"ABP-Standard"}` | | SourceTarget with Target as variable Path1 | DecisionMatrix + ExpressionSets | `{"DecisionMatrix":"true","MatrixVersionId":"0lNxx000000001dEAA","ProcedureName":"SourceTargetAttributePricingMatrix", "Path1":"PRODUCT-ABP-ROOT","DecisionMatrix":"true"}` | `{"RangeFields":"Quantity","ProcedureName":"VolumeBasedPricingProcedure","MatrixName":"VolumeBasedPricingMatrix","DecisionMatrix":"true"}` | | Standard | CalculationMatrix + CalculationProcedure | `{"MatrixVersionId":"0lNxx0000000001EAA","ProcedureName":"ABP-Standard"}` | `{"MatrixName":"AttributePricingMatrix","ProcedureName":"ABP-Standard"}` | | SourceTarget with Target as variable Path1 | CalculationMatrix + CalculationProcedure | `{"MatrixVersionId":"0lNxx000000001dEAA","ProcedureName":"SourceTargetAttributePricingMatrix", "Path1":"PRODUCT-ABP-ROOT # Set Up Postman, Import the Files, and Get the Token You've configured your environment file and set up a connected app. The next task is to set up Postman and use it to get the session token from the org. 1. Go to [www.postman.com/downloads](https://www.postman.com/downloads/). 2. Click **Try the Web Version**. 3. Enter an **Email**, **Username**, and **Password**, then click Create free account. 4. Type your name, then click **Continue** twice. 5. From the Home page, click **Create New**, then click **HTTP Request**. 6. Click **Import**, drag your collection file into the Import window, and click **Import** in the window. 7. Click **Import**, drag your environment file into the Import window, and click **Import** in the window. 8. Click **Collections**, expand **Vlocity Digital Commerce APIs Collection**, and click **SFDC OAuth Username Password**. 9. Change **No Environment** to the name of the environment you uploaded. 10. Click **Send**. The response looks something like this: ```nolang { "access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxx", "instance_url": "https://demo.my.salesforce.com", "id": "https://login.salesforce.com/id/.../...", "token_type": "Bearer", "issued_at": "1632504402777", "signature": "wNsUOlj65HMf8vqbDwm8bRnsK" } ``` **note:** Note: If you create your org in Summer ’23 or later, the OAuth 2.0 username-password flow is blocked by default. To enable the username-password flow, from Setup, select OAuth and OpenID Connect Settings, and select Allow OAuth Username-Password Flows. 11. Save the `access_token` value for use in a subsequent task. [Use the access_token for the session locally](https://blog.postman.com/collaborating-oauth-postman/). [Make Sure Your IDE Is Configured for Java](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-make-sure-your-ide-is-configured-for-java.md) # Setting Up the Pubsub SDK (Winter '20) The Vlocity Digital Commerce SDK includes the [pubsub](https://developer.salesforce.com/docs/component-library/documentation/lwc/lwc.events_pubsub) SDK, which supports communication between Digital Commerce components, including Digital Commerce Lightning Web Components, Digital Commerce Web Components, JavaScript-based framework, and so on. For more details, see the [PubSub SDK reference](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/sdk/classes/_events_pubsub_sdk_.pubsub.html). ## Registering an Event Use the following example Digital Commerce pubsub register method to add a callback function to the list of subscribers for a particular event: ```nolang // registering pub-sub event this.callbackEventHandler = { result: this.callbackFunction.bind(this) }; callbackFunction(data) {/* callback triggered by the pubsub event */} this.digitalCommerceSDK.register("event-name",this.callbackEventHandler); ``` ## Firing an Event Use the following example fire method to publish the occurrence of an event: ```nolang this.digitalCommerceSDK.fire("event-name",action,payloadObject); ``` ## Unregistering an Event Use the following example unregister method to cancel subscription of an event: ```nolang // un-registering pub-sub event this.digitalCommerceSDK.unregister("event-name",this.callbackEventHandler); ``` # Software Development Toolkit (SDK) Overview The Digital Commerce Software Development Toolkit (SDK) is a JavaScript library that abstracts and simplifies the use of Digital Commerce APIs. The SDK improves usability and reduces the effort required to develop compelling user interfaces by hiding complex API semantics inside the SDK interface. The SDK comes packaged with a sample application that you can use to experiment with a typical Digital Commerce application. Using the sample application requires no experience other than familiarity with Digital Commerce. To develop your own Digital Commerce application, or to modify the sample application, requires web development experience and experience using JavaScript. You can access installation instructions for the sample application here: [Digital Commerce SDK Installation](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-digital-commerce-sdk-installation.md) Click [here](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/sdk/index.html) here for SDK reference material including method names and usage information. For a list of SDK coding examples, see [SDK Usage Examples (Winter '20 version)](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-sdk-usage-exampleswinter20-version-.md). # Standard Cart APIs The standard cart APIs leverage standard Salesforce libraries, Scale Cache for optimized processing, and refactored pricing and validation methods to minimize the number of SOQL queries and DML operations. These enhancements improve the performance of the APIs. You can enable only the following standard cart APIs. Cart APIs that are not in this list continue to work using Apex libraries. See [Known Limitations](https://developer.salesforce.com/docs/industries/cme/guide/standard-cart-known-limitations.md) and [Cart APIs vs Standard Cart APIs](https://developer.salesforce.com/docs/industries/cme/guide/comms-cart-based-apis-for-industries-cpq.md#cart-apis-vs-standard-cart-apis). We recommend that you review the usage considerations before enabling the standard cart APIs. | API
| Resource
| Available Version | | ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ----------------- | | Get Cart Items | `/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/items` | Winter'24 | | Get Cart Summary | `/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}?headerFieldSet={field_set_feature}&validate={true or false}` | Winter'24 | | Get List of Products | `/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/products` | Winter'24 | | Add Items to Cart | `/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/items` | Winter'24 | | Asset to Order | `/services/apexrest/{namespace}/v2/carts` | Winter'24 | | Update Items in Cart | `/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/items` | Winter'24 | | Replace Offers | `/services/apexrest/{namespace}/v2/cpq/carts/offermigration/replacement` | Winter'24 | | Run Pricing for Items to Cart | `/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/price` | Winter'24 | | Get Line Items by ID | `/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/items?id=` | Winter'24 | | Checkout Items in Cart | `/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/items/checkout` | Spring'24 | | Create Cart | `/services/apexrest/{namespace}/v2/carts` | Spring'24 | | Check Status of the Cart | `/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/items/checkout` | Spring'24 | | Delete Items from Cart | `/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/items` | Summer'24 | | Delete Applied Promotion Items | `/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/promotions` | Summer'24 | | Delete Cart Discount | `/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/discounts` | Summer'24 | | Multi-Edit Cart Line Items | `/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/items` | Summer'24 | | Apply Adjustment | `/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/items/{ID}/pricing` | Winter'26 | For required permission sets and licenses refer the following. - [Communications Cloud Permission Set Licenses](https://help.salesforce.com/s/articleView?id=ind.comms_t_communications_cloud_permission_set_licenses_244044.htm&type=5) - [CPQ, EPC, DC, OM Sample Permission Sets and Groups](https://help.salesforce.com/s/articleView?id=ind.comms_t_cpqepcdcom_sample_permission_sets_and_groups_250705.htm&type=5) To work with CPQ configuration settings refer [CPQ Configuration Settings Reference](https://help.salesforce.com/s/articleView?id=ind.comms_t_cpq_configuration_settings_reference_148927.htm&type=5). Standard Cart REST APIs # Standard Cart REST APIs Standard Configure, Price, Quote Web APIs (CPQ APIs) enable client application users to shop for and order products and services. The CPQ APIs provide a layer of abstraction between the client app developers and the CPQ developers who are configuring and customizing the underlying CPQ logic. * V2 of the CPQ APIs simplifies the APIs for mobile and external app development. The v2 APIs are the default APIs used by Industries applications. Base URL for the apis described is 'xx##.salesforce.com/services/apexrest/vlocity\_cmt/v2'. **Version:** Spring 2025 ## Servers * `https://{MyDomainLoginUrl}.salesforce.com/services/apexrest/vlocity_cmt/v2` ## Operations ### POST Create Cart (Asset To Order) `POST /carts` Operation ID: `AssetToOrder`. Tags: Cart. Create orders from existing assets and perform Move, Add, Change, and Delete (MACD) operations. The assetToOrder API is specifically intended for use with Future Dated Orders. Rest Handler - APICreateCartsCpqV2 Method Invoked - createCarts #### Request body (required) #### While performing AssetToOrder we can create Order of specific RecordType by RecordTypeId in the request payload. Request Example ```json { "subaction": "assetToOrder", "id": "02ixx0000004HROAA2", "inputFields": [ { "RecordTypeId": "012xx0000005pgzAAA" } ], "accountId": "001xx000003GfGdAAK", "requestDateTime": "2024-09-30 19:24:04" } ``` For assetToOrder, if future-dated order is not available, the requestDate should be greater than or equal to current date. If a future dated order(s) is/are available for that asset, the requestDate should be greater than or equal to current date and should be greater than or equal to the date on all the future dated orders of the asset. For assetToOrder, the field id can be a list of all assets or just the root asset. The child assets will be retrived from the root asset. Media type: `application/json`. Schema: `AssetToOrderRequest`. _Example: assetToOrderRequest_ Sample AssetToOrder Request Example ``` { "subaction": "assetToOrder", "accountId": "001xx000003H3cJAAS", "orderId": "003xx000002fIKa", "id": "02ixx0000004HrCAAU,02ixx0000004HrDABV", "requestDateTime": "2025-05-16T00:00:00.000Z", "validate": true } ``` #### Responses * **200** OK - API request processed. Look for messages in the response to determine if it succeeded or failed. Media type: `application/json`. Schema: `AssetToOrderResponse`. * **215** #### Example response for Invalid Request DateTime ```json [ { "message" : "Change To Order Failed. Request DateTime is less than now", "code" : "215", "severity" : "ERROR" } ] ``` * **500** Look for below error code in response. #### Example response for INVOKE-500 ```json { "errorCode" : "INVOKE-500", "error" : "An internal server error has occurred. Error ID: 672691857-12982 (1442400963)" } ``` ### GET Retrieves high-level cart metadata such as account associations, multi-site configurations, and context-aware actions (e.g., checkout, create site). `GET /cpq/carts/{cartId}` Operation ID: `Get Cart Summary`. Tags: Cart. The Get Cart Summary API provides a quick snapshot of a cart's key information such as totals, status, and account details. It is designed to help your applications display up-to-date cart overviews and guide users through the checkout process more efficiently. 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](https://help.salesforce.com/s/articleView?id=ind.v_admin_guest_user_technical_details_27809.htm&type=5). For additional information, ​see [UserSecurity Class](https://help.salesforce.com/s/articleView?id=ind.v_admin_usersecurity_class_28364.htm&type=5) and CPQ and Digital Commerce Changes for Guest Users. #### Parameters * `cartId` (path, string, required) Salesforce Id of the Cart (Opportunity, Quote or Order). _Example_ ``` 801xx000003GzX5AAK ``` * `validate` (query, boolean) Indicates whether validation rules are run for the current API request (true) or not (false). Default: `true`. * `headerFieldSet` (query, string) Feature name of a Salesforce Field Set defined for the given cart object (Opportunity, Quote, Order) which identifies the fields to return in the response. > **Note:** Use this parameter when you need a customised header payload (e.g., a lighter field set for mobile, or a specialised set for a specific UI flow). If omitted, the standard CPQV2 header fields will be returned. _Example_ ``` CPQV2 ``` * `serviceAccountLimit` (query, integer) The number of Account object records to be returned. The limit should be within 0-200, otherwise it defaults to 20. _Example_ ``` 20 ``` #### Responses * **200** OK - API request processed. Look for messages in the response to determine if it succeeded or failed. Media type: `application/json`. Schema: `GetCartsResponse`. * **500** Internal server error that may occur during cart processing. Below is a comprehensive list of possible error messages and their descriptions to help diagnose and resolve issues: | Message | Description | | --- | --- | | Checkout \| PCPValidation error | Failed to validate the cart against Product Configuration Procedure rules. Review cart configuration and rule settings. | | Checkout \| validation rules error | Failed to validate the cart against Advanced Validation rules. Review cart configuration for compliance with business rules. | | Checkout \|\| Multisite check for canCheckout error | Cart checkout operation failed due to invalid multi-site configuration. Ensure all site-specific requirements are met before proceeding. | | Compiled Data with key 'CartCompiledOfferHierarchy' not found | Unable to retrieve offer hierarchy data from CachedAPIResponse\_\_c. Verify it contains valid offer hierarchy compilation. | | Compiled Data with key 'CartCompiledPricingData' not found | Unable to retrieve pricing data from CachedAPIResponse\_\_c. Verify it contains valid pricing compilation. | | Compiled Data with key 'CompiledPricingVariableMaps' not found | Unable to retrieve pricing variable maps from CachedAPIResponse\_\_c. Verify it contains valid pricing variable compilation. | | Compiled Data with key 'pricelist-pbeid-sequence key' not found | Unable to retrieve price list sequence data from CachedAPIResponse\_\_c. Verify it contains valid price list compilation. | | CPQDiscountNotActivatedDiscounts | Cart contains discounts that have not been activated. Activate all applicable discounts before proceeding. | | CPQDiscountUnapproved | Cart contains discounts pending approval. Obtain necessary approvals for all discounts before proceeding. | | Invalid attribute values found. | The AttributeSelectedValues\_\_c contains invalid or incompatible values. Review and correct the attribute selections. | | Invalid id: {CART\_ID} | The provided cart identifier is either empty or invalid. Verify the cart Id format and type. | | InvalidAccountId | The cart is not properly associated with a valid Account record. Establish a valid account association. | | No Header Object found. | The requested cart does not exist in the system. Verify the cart identifier and ensure it has been created. | | No product compiled data found. | Product transaction data is missing from CachedAPIResponse\_\_c. Verify product configuration and recompile if necessary. | | No Results Found. (Under the sites node in the API response) | No site records are associated with the specified Account. Create or associate required site records. | | Not able to commit cart after Validation/PCPValidation | Failed to save cart changes after validation processes. Review validation errors and resolve any configuration issues. | | Not able to query {LINE\_ITEM} | Failed to retrieve line item information. Verify the line item exists and is accessible. | | PricebookEntry not found for product : {PRODUCT\_ID} with globalGroupKey {PRODUCT\_GGK} | Unable to locate price book entry for the specified product. Verify product exists in the active price book with valid global group key. | | Unable to populate selected attribute values | Failed to update the CartDocument with selected attribute values. Verify attribute selections and cart document integrity. | ### GET Get Cart Items `GET /cpq/carts/{cartId}/items` Operation ID: `GetCartItems`. Tags: Cart. Get a representation of the items in a specified cart. Rest Handler - APIItemsCartsCpqV2 Method Invoked - getCartsItems. #### Parameters * `cartId` (path, string, required) Salesforce Id of the Cart (Opportunity, Quote or Order). _Example_ ``` 801xx000003GzX5AAK ``` * `query` (query, string) Search text _Example_ ``` iphone+6s ``` * `id` (query, string) List of comma separated itemIds to return only the corresponding cart items. _Example_ ``` 01u41000001QPtsAAG ``` * `lastRecordId` (query, string) The last record ID from the previous search result, if available. * `pagesize` (query, integer) Number of records to be returned. * `hierarchy` (query, integer) Specifies product hierarchy. * `includeAttachment` (query, boolean) Indicates whether product attachments are returned (true) or not (false). * `fields` (query, array of string, style: form, explode: false) List of fields to return in the response, separated by commas. * `filter` (query, string) Filter field values. * `price` (query, boolean) Indicates whether to run the pricing engine (true) or not (false). Default: `true`. * `validate` (query, boolean) Indicates whether validation rules are run for the current API request (true) or not (false). Default: `true`. #### Responses * **101** No Results Found * **109** Invalid field * **200** OK - API request processed. Look for messages in the response to determine if it succeeded or failed. #### Get Cart Items Response Example **Note** - An entire result can be thousands of lines long. This example has been truncated. ```json { "totalSize":2 "messages":[] "actions":{ "itempricesupdated":{ "rest":{ "params":{} "method":"GET" "link":"/services/apexrest/vlocity_cmt/v2/cpq/carts/801xx000003H0UlAAK/price?price=false&cartId=801xx000003H0UlAAK" } "remote":{} "client":{} } } "records":[ { "messages":[] "actions":{} "displaySequence":-1 "productChildItemDefinition":{} "isVirtualItem":false "sequenceNumber":1 "groupMinQuantity":0 "productId":"01txx0000007CF2AAM" "Product2":{} "maxQuantity":99999 "ProductCode":"Internet5G" "IsActive":true "hasChildren":false "defaultQuantity":1 "groupMaxQuantity":99999 "PricebookEntry":{} "Name":"Internet5G" "UnitPrice":{} "Product2Id":"01txx0000007CF2AAM" "productChildItemId":"a3Pxx0000004nmuEAA" "minQuantity":0 "name":"Internet5G" "Pricebook2Id":"01sxx0000005qRhAAI" "action":"Add" "productHierarchyPath":"01txx0000007CF2AAM" "vlocity_cmt__RecurringPrice__c":50 "orderActive":false "itemType":"lineItem" "SellingPeriod":"Present" "vlocity_cmt__ProductGroupKey__c":{} "vlocity_cmt__RecurringDiscountPrice__c":{} "vlocity_cmt__ParentItemId__c":{} "vlocity_cmt__ItemName__c":{} "vlocity_cmt__EffectiveOneTimeTotal__c":{} "vlocity_cmt__EffectiveRecurringTotal__c":{} "vlocity_cmt__CatalogItemReferenceDateTime__c":{} "ListPrice":{} "vlocity_cmt__CpqCardinalityMessage__c":{} "vlocity_cmt__RecurringManualDiscount__c":{} "vlocity_cmt__IsChangesAllowed__c":{} "vlocity_cmt__CpqPricingMessage__c":{} "vlocity_cmt__OneTimeTotal__c":{} "vlocity_cmt__FulfilmentStatus__c":{} "vlocity_cmt__LineNumber__c":{} "vlocity_cmt__ServiceAccountId__c":{} "vlocity_cmt__RecurringCharge__c":{} "vlocity_cmt__OneTimeCharge__c":{} "vlocity_cmt__SubAction__c":{} "vlocity_cmt__CurrencyPaymentMode__c":{} "vlocity_cmt__ProductHierarchyGroupKeyPath__c":{} "vlocity_cmt__SupersededOrderItemId__c":{} "vlocity_cmt__RecurringTotal__c":{} "vlocity_cmt__SupplementalAction__c":{} "vlocity_cmt__Product2Id__c":{} "vlocity_cmt__OrderGroupId__c":{} "vlocity_cmt__Action__c":{} "Quantity":{} "vlocity_cmt__OneTimeManualDiscount__c":{} "OrderId":{} "vlocity_cmt__EffectiveQuantity__c":{} "vlocity_cmt__BillingAccountId__c":{} "vlocity_cmt__ProvisioningStatus__c":{} "vlocity_cmt__AssetReferenceId__c":{} "vlocity_cmt__InCartQuantityMap__c":{} "vlocity_cmt__FirstVersionOrderItemId__c":{} "PricebookEntryId":{} "vlocity_cmt__ProductHierarchyPath__c":{} "vlocity_cmt__RootItemId__c":{} "vlocity_cmt__CpqMessageData__c":{} "Id":{} "vlocity_cmt__RecurringCalculatedPrice__c":{} "vlocity_cmt__OneTimeCalculatedPrice__c":{} "productCategories":{} "vlocity_cmt__ServiceAccountId__r":{} "vlocity_cmt__BillingAccountId__r":{} } { "messages":[] "actions":{} "displaySequence":-1 "productChildItemDefinition":{} "isVirtualItem":false "sequenceNumber":1 "groupMinQuantity":0 "productId":"01txx0000007CBoAAM" "Product2":{} "maxQuantity":99999 "ProductCode":"Iphone16" "IsActive":true "hasChildren":true "defaultQuantity":1 "groupMaxQuantity":99999 "PricebookEntry":{} "Name":"Iphone16" "UnitPrice":{} "Product2Id":"01txx0000007CBoAAM" "productChildItemId":"a3Pxx0000004ni4EAA" "minQuantity":0 "name":"Iphone16" "Pricebook2Id":"01sxx0000005qRhAAI" "action":"Add" "productHierarchyPath":"01txx0000007CBoAAM" "vlocity_cmt__RecurringPrice__c":100 "orderActive":false "itemType":"lineItem" "SellingPeriod":"Present" "vlocity_cmt__ProductGroupKey__c":{} "vlocity_cmt__RecurringDiscountPrice__c":{} "vlocity_cmt__ParentItemId__c":{} "vlocity_cmt__ItemName__c":{} "vlocity_cmt__EffectiveOneTimeTotal__c":{} "vlocity_cmt__EffectiveRecurringTotal__c":{} "vlocity_cmt__CatalogItemReferenceDateTime__c":{} "ListPrice":{} "vlocity_cmt__CpqCardinalityMessage__c":{} "vlocity_cmt__RecurringManualDiscount__c":{} "vlocity_cmt__IsChangesAllowed__c":{} "vlocity_cmt__CpqPricingMessage__c":{} "vlocity_cmt__OneTimeTotal__c":{} "vlocity_cmt__FulfilmentStatus__c":{} "vlocity_cmt__LineNumber__c":{} "vlocity_cmt__ServiceAccountId__c":{} "vlocity_cmt__RecurringCharge__c":{} "vlocity_cmt__OneTimeCharge__c":{} "vlocity_cmt__SubAction__c":{} "vlocity_cmt__CurrencyPaymentMode__c":{} "vlocity_cmt__ProductHierarchyGroupKeyPath__c":{} "vlocity_cmt__SupersededOrderItemId__c":{} "vlocity_cmt__RecurringTotal__c":{} "vlocity_cmt__SupplementalAction__c":{} "vlocity_cmt__Product2Id__c":{} "vlocity_cmt__OrderGroupId__c":{} "vlocity_cmt__Action__c":{} "Quantity":{} "vlocity_cmt__OneTimeManualDiscount__c":{} "OrderId":{} "vlocity_cmt__EffectiveQuantity__c":{} "vlocity_cmt__BillingAccountId__c":{} "vlocity_cmt__ProvisioningStatus__c":{} "vlocity_cmt__AssetReferenceId__c":{} "vlocity_cmt__InCartQuantityMap__c":{} "vlocity_cmt__FirstVersionOrderItemId__c":{} "PricebookEntryId":{} "vlocity_cmt__ProductHierarchyPath__c":{} "vlocity_cmt__RootItemId__c":{} "vlocity_cmt__CpqMessageData__c":{} "Id":{} "vlocity_cmt__RecurringCalculatedPrice__c":{} "vlocity_cmt__OneTimeCalculatedPrice__c":{} "productCategories":{} "vlocity_cmt__ServiceAccountId__r":{} "vlocity_cmt__BillingAccountId__r":{} "lineItems":{ "totalSize":2 "messages":[] "records":[] } } ] } ``` * **500** Invalid Id Field ### PUT Update Item(s) in a Cart `PUT /cpq/carts/{cartId}/items` Operation ID: `UpdateItemsInCart`. Tags: Cart. Update one or more items in a specified cart. Rest Handler - APIItemsCartsCpqV2 Method Invoked - putCartsItems #### Parameters * `cartId` (path, string, required) Salesforce Id of the Cart (Opportunity, Quote or Order). _Example_ ``` 801xx000003GzX5AAK ``` #### Request body Request Body with input fields #### Update Items in Cart Request Example The request body requires a JSON records which is to be updated. This can be fetched from the API response of Add Items to cart or Get Items to cart. In the given response of Add or GET Items to cart, update the field which to be updated. **Note** - An entire result can be thousands of lines long. This example has been truncated. ```json { "items": { "records":[ { "messages":[] "actions":{} "displaySequence":-1 "productChildItemDefinition":{} "isVirtualItem":false "sequenceNumber":1 "groupMinQuantity":0 "productId":"01txx0000007CBoAAM" "Product2":{} "ProductCode":"Iphone16" "maxQuantity":99999 "IsActive":true "hasChildren":true "defaultQuantity":1 "PricebookEntry":{} "groupMaxQuantity":99999 "Name":"Iphone16" "UnitPrice":{} "productChildItemId":"a3Pxx0000004ni4EAA" "Product2Id":"01txx0000007CBoAAM" "minQuantity":0 "name":"Iphone16" "Pricebook2Id":"01sxx0000005qRhAAI" "action":"Add" "productHierarchyPath":"01txx0000007CBoAAM" "vlocity_cmt__RecurringPrice__c":250 "orderActive":false "itemType":"lineItem" "SellingPeriod":"Present" "vlocity_cmt__ProductGroupKey__c":{} "vlocity_cmt__ParentItemId__c":{} "vlocity_cmt__RecurringDiscountPrice__c":{} "vlocity_cmt__ItemName__c":{} "vlocity_cmt__EffectiveOneTimeTotal__c":{} "vlocity_cmt__EffectiveRecurringTotal__c":{} "vlocity_cmt__CatalogItemReferenceDateTime__c":{} "ListPrice":{} "vlocity_cmt__CpqCardinalityMessage__c":{} "vlocity_cmt__RecurringManualDiscount__c":{} "vlocity_cmt__CpqPricingMessage__c":{} "vlocity_cmt__IsChangesAllowed__c":{} "vlocity_cmt__OneTimeTotal__c":{} "vlocity_cmt__FulfilmentStatus__c":{} "vlocity_cmt__LineNumber__c":{} "vlocity_cmt__ServiceAccountId__c":{} "vlocity_cmt__RecurringCharge__c":{} "vlocity_cmt__OneTimeCharge__c":{} "vlocity_cmt__SubAction__c":{} "vlocity_cmt__CurrencyPaymentMode__c":{} "vlocity_cmt__ProductHierarchyGroupKeyPath__c":{} "vlocity_cmt__RecurringTotal__c":{} "vlocity_cmt__SupersededOrderItemId__c":{} "vlocity_cmt__SupplementalAction__c":{} "vlocity_cmt__Product2Id__c":{} "vlocity_cmt__OrderGroupId__c":{} "vlocity_cmt__Action__c":{} "Quantity":{} "vlocity_cmt__OneTimeManualDiscount__c":{} "OrderId":{} "vlocity_cmt__EffectiveQuantity__c":{} "vlocity_cmt__BillingAccountId__c":{} "vlocity_cmt__AssetReferenceId__c":{} "vlocity_cmt__ProvisioningStatus__c":{} "vlocity_cmt__InCartQuantityMap__c":{} "vlocity_cmt__FirstVersionOrderItemId__c":{} "PricebookEntryId":{} "vlocity_cmt__ProductHierarchyPath__c":{} "vlocity_cmt__CpqMessageData__c":{} "vlocity_cmt__RootItemId__c":{} "Id":{} "vlocity_cmt__RecurringCalculatedPrice__c":{} "vlocity_cmt__OneTimeCalculatedPrice__c":{} "productCategories":{} "vlocity_cmt__ServiceAccountId__r":{} "vlocity_cmt__BillingAccountId__r":{} "lineItems":{} } ] } } ``` Media type: `application/json`. Schema: `UpdateCartItemRequest`. #### Responses * **109** Invalid field * **151** Successfully Updated * **200** OK - API request processed. Look for messages in the response to determine if it succeeded or failed. #### Update Cart Items response ```json { "totalSize":1 "messages":[ { "code":"151" "severity":"INFO" "message":"Successfully updated." } ] "actions":{} "records":[ { "messages":[] "actions":{} "displaySequence":-1 "productChildItemDefinition":{} "isVirtualItem":false "sequenceNumber":1 "groupMinQuantity":0 "productId":"01txx0000007CBoAAM" "Product2":{} "ProductCode":"Iphone16" "maxQuantity":99999 "IsActive":true "hasChildren":true "defaultQuantity":1 "PricebookEntry":{} "groupMaxQuantity":99999 "Name":"Iphone16" "UnitPrice":{} "productChildItemId":"a3Pxx0000004ni4EAA" "Product2Id":"01txx0000007CBoAAM" "minQuantity":0 "name":"Iphone16" "Pricebook2Id":"01sxx0000005qRhAAI" "action":"Add" "productHierarchyPath":"01txx0000007CBoAAM" "vlocity_cmt__RecurringPrice__c":250 "orderActive":false "itemType":"lineItem" "SellingPeriod":"Present" "vlocity_cmt__ProductGroupKey__c":{} "vlocity_cmt__ParentItemId__c":{} "vlocity_cmt__RecurringDiscountPrice__c":{} "vlocity_cmt__ItemName__c":{} "vlocity_cmt__EffectiveOneTimeTotal__c":{} "vlocity_cmt__EffectiveRecurringTotal__c":{} "vlocity_cmt__CatalogItemReferenceDateTime__c":{} "ListPrice":{} "vlocity_cmt__CpqCardinalityMessage__c":{} "vlocity_cmt__RecurringManualDiscount__c":{} "vlocity_cmt__CpqPricingMessage__c":{} "vlocity_cmt__IsChangesAllowed__c":{} "vlocity_cmt__OneTimeTotal__c":{} "vlocity_cmt__FulfilmentStatus__c":{} "vlocity_cmt__LineNumber__c":{} "vlocity_cmt__ServiceAccountId__c":{} "vlocity_cmt__RecurringCharge__c":{} "vlocity_cmt__OneTimeCharge__c":{} "vlocity_cmt__SubAction__c":{} "vlocity_cmt__CurrencyPaymentMode__c":{} "vlocity_cmt__ProductHierarchyGroupKeyPath__c":{} "vlocity_cmt__RecurringTotal__c":{} "vlocity_cmt__SupersededOrderItemId__c":{} "vlocity_cmt__SupplementalAction__c":{} "vlocity_cmt__Product2Id__c":{} "vlocity_cmt__OrderGroupId__c":{} "vlocity_cmt__Action__c":{} "Quantity":{} "vlocity_cmt__OneTimeManualDiscount__c":{} "OrderId":{} "vlocity_cmt__EffectiveQuantity__c":{} "vlocity_cmt__BillingAccountId__c":{} "vlocity_cmt__AssetReferenceId__c":{} "vlocity_cmt__ProvisioningStatus__c":{} "vlocity_cmt__InCartQuantityMap__c":{} "vlocity_cmt__FirstVersionOrderItemId__c":{} "PricebookEntryId":{} "vlocity_cmt__ProductHierarchyPath__c":{} "vlocity_cmt__CpqMessageData__c":{} "vlocity_cmt__RootItemId__c":{} "Id":{} "vlocity_cmt__RecurringCalculatedPrice__c":{} "vlocity_cmt__OneTimeCalculatedPrice__c":{} "productCategories":{} "vlocity_cmt__ServiceAccountId__r":{} "vlocity_cmt__BillingAccountId__r":{} "lineItems":{ "totalSize":1 "messages":[] "records":[] } } ] } ``` * **500** Invalid Id Field ### POST Add Items to Cart `POST /cpq/carts/{cartId}/items` Operation ID: `postCartsItems`. Tags: Cart. Adds one or more products (root or child) to an existing cart. Enforces business rules such as product eligibility, quantity constraints, and cart state validation. Can trigger pricing, validation, and promotion logic. Ensures atomicity—either all items are added successfully, or none are. Supports guest users and extensibility. See documentation for details on child adds, virtual parents, and error handling. #### Parameters * `cartId` (path, string, required) Salesforce Id of the Cart (Opportunity/Quote/Order) to which items are being added. #### Request body (required) Media type: `application/json`. Schema: `PostCartsItemsRequest`. #### Responses * **200** Success response for Add Items to Cart operation. Example (root add): ```json { "totalSize": 1, "messages": [ { "code": "150", "severity": "INFO", "message": "Successfully added." } ], "actions": { "itempricesupdated": {} }, "records": [ { "messages": [], "actions": {}, "isVirtualItem": false, "maxQuantity": 99999, "ProductCode": "CODE-77706", "hasChildren": true, "IsActive": true, "defaultQuantity": 1, "productGroups": { "totalSize": 1, "messages": [], "records": [ {} ] }, "childProducts": { "totalSize": 1, "messages": [], "records": [ {} ] } } ] } ``` Example (noResponseNeeded=true): ```json { "totalSize": 0, "messages": [ { "code": "150", "severity": "INFO", "message": "Successfully added." } ], "actions": { "itempricesupdated": { "rest": { "params": {}, "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/801xx000003H4WlAAK/price?price=false&cartId=801xx000003H4WlAAK" }, "remote": { "params": {} }, "client": { "params": {} } } } } ``` Media type: `application/json`. Schema: `PostCartsItemsResponse`. * **400** Bad request or invalid input. Example (no items to add): ```json { "messages": [ { "code": "143", "severity": "ERROR", "message": "No items to add to cart." } ], "totalSize": 0 } ``` Media type: `application/json`. Schema: `PostCartsItemsErrorResponse`. * **default** Unexpected error ### DELETE Remove one or more line items from a specified cart. `DELETE /cpq/carts/{cartId}/items` Operation ID: `Remove Items from a Cart`. Tags: Cart. Remove one or more line items, whether standalone SKUs, bundle components, or promo freebies, while automatically collapsing empty parent bundles, safeguarding or cascading promotions, and (optionally) re-pricing and re-validating the cart so totals and rules stay consistent. NOTE: When using the deleteCart APIs with Standard Cart, the response structure includes an additional node at the root level. A childProducts node is present at the root level of the response. Consumers of the Standard Cart API can ignore or filter out the childProducts node at the root level if it is not relevant to their use case. #### Parameters * `cartId` (path, string, required) Salesforce Id of the Cart (Opportunity, Quote or Order). _Example_ ``` 801xx000003GzX5AAK ``` * `id` (query, string, required) Comma-separated Line-item Id(s) to delete. _Example_ ``` 802xx000001nsbfAAA,802xx000001nsbgAAA ``` * `price` (query, boolean) Indicates whether to run the pricing engine (true) or not (false). Default: `true`. * `validate` (query, boolean) Indicates whether validation rules are run for the current API request (true) or not (false). Default: `true`. * `checkActivePromos` (query, boolean) Controls whether the API prevents or allows deletions that would leave an active promotion without associated items. True => If any target line-item is tied to an active promotion, the call throws a validation error (code 406) — unless the custom setting DELETE\_APPLIED\_PROMO=true, in which case the promotion itself is first deleted and the item delete proceeds. False => Items are deleted even if they belong to an active promotion. Default: `true`. * `proceedToCommit` (query, boolean) Flag that tells the Delete Cart Items service whether to finish the transaction or stop after all validations. True => After the items pass validation, the service commits the deletes and writes the cart back to the database. False => The service still runs every check (promotion guard, cardinality rules, etc.) but does not save any changes, it returns the validation result only. Useful for "pre-check" buttons or batch jobs that want to validate first and commit in a later call. Default: `true`. * `noResponseNeeded` (query, boolean) Tells the API whether to send back the updated-cart JSON after it finishes deleting the items. False => The service builds the full response (messages array, updated line-items, follow-up actions) so a UI can refresh immediately. True => The service commits the delete but skips assembling the response body, returning only an HTTP 200. Default: `false`. #### Responses * **152** OK - API request processed. Look for messages in the response to determine if it succeeded or failed. Media type: `application/json`. Schema: `DeleteCartsItemsResponse`. * **500** Internal server error that may occur during cart processing. Below is a comprehensive list of possible error messages and their descriptions to help diagnose and resolve issues: | Message | Description | | --- | --- | | Action is invalid | The LineItem's Action\_\_c is invalid. | | CardinalityException | Error related to cardinality while executing advanced rules. | | Compiled Data with key 'CartCompiledOfferHierarchy' not found | The CachedAPIResponse\_\_c does not contain the 'CartCompiledOfferHierarchy' CacheKey for the latest and active ConfigurationSnapshotId. | | Compiled Data with key 'CartCompiledPricingData' not found | The CachedAPIResponse\_\_c does not contain the 'CartCompiledPricingData' CacheKey for the latest and active ConfigurationSnapshotId. | | Compiled Data with key 'CompiledPricingVariableMaps' not found | The CachedAPIResponse\_\_c does not contain the 'CompiledPricingVariableMaps' CacheKey for the latest and active ConfigurationSnapshotId. | | Compiled Data with key 'pricelist-pbeid-sequence key' not found | The CachedAPIResponse\_\_c does not contain the 'pricelist-pbeid-sequence key' CacheKey for the latest and active ConfigurationSnapshotId. | | CPQInvalidPriceList | Cart does not contain a PriceList. | | CPQNoItemsToDelete / No Item with the Provided ID Exists in Cart | The Line Item Ids passed in the input are not available to delete. | | CPQReadOnlyError | If the IsChangesAllowed\_\_c is set to False on the line item, then deleting it is not allowed. | | Delete the {PROMOTION\_NAME} promotion that's associated with the product or child product. Then delete the product. | The item is associated with one specific promotion (shown by {PROMOTION\_NAME}). Remove that promotion before deleting the item. | | Delete the {PROMOTION\_NAME} ({NO\_OF\_PROMOS}) promotions that are associated with the product or child product. Then delete the product. | The item is linked to several instances of the same promotion ({PROMOTION\_NAME} repeated {NO\_OF\_PROMOS} times). Delete every instance of that promotion, then delete the item. | | Delete the promotions ({NO\_OF\_PROMOS}) that are associated with the product or child product. Then delete the product. | The item you're trying to delete is tied to more than one different promotion. Delete all of them first, then retry the item delete. | | Entity Filter failed to evaluate conditions | Error while executing advanced rules. | | Invalid id: {CART\_ID} | Empty cartId input parameter or invalid cart type. | | InvalidAccountId | Cart is not associated with an Account. | | No Header Object found. | Cart does not exist. | | No product compiled data found. | No data related to the product in transaction has been found in the CachedAPIResponse\_\_c. | | PricebookEntry not found for product : {PRODUCT\_ID} with globalGroupKey {PRODUCT\_GGK} | PricebookEntry information of the product in transaction is not found in the CartDocument. | | SellingEndDateException | If the Line Item's SellingEndDate or EndOfLifeDate fall before the Cart's Start Date. | | Unable to convert Compiled Context Dimensions to Map | Error while converting the Context Dimensions cached data to a Map. | | Unable to get fetchCompiledData2 | Error while fetching the cached data from the CachedAPIResponse\_\_c. | | {PRODUCT\_NAME} can not have less than {MIN\_QUANTITY} quantity. | If deletion of a line item violates its minimum quantity configuration. | ### POST Checkout Items in a Cart. `POST /cpq/carts/{cartId}/items/checkout` Operation ID: `Checkout items`. Tags: Cart. Based on the header object, submit the object to create a Quote, Order, or Assets. If the header object is an Opportunity, submit the Opportunity to create a Quote. If the header object is a Quote, submit the Quote to create an Order. If the header object is an Order, submit the Order to create Assets. #### Parameters * `cartId` (path, string, required) Salesforce Id of the Cart (Opportunity, Quote or Order). _Example_ ``` 801xx000003GzX5AAK ``` * `validate` (query, boolean) Indicates whether validation rules are run for the current API request (true) or not (false). Default: `true`. * `assetizeFullBundlePerRoot` (query, boolean) Flag to indicate whether to assetize the line items by the root item ids. Default: `false`. * `validateSubmittedXLI` (query, boolean) Flag to indicate whether to run the line item presubmit validation or not. Default: `false`. * `skipCheckoutValidation` (query, boolean) Flag to indicate whether to skip Checkout validation or not. Default: `false`. * `checkOrderStatus` (query, boolean) Flag to indicate whether to check the order status on checkout or not. Default: `false`. * `provisioningStatus` (query, string) Lets the caller override the default provisioning status that the checkout pipeline assigns to every Asset it creates or clones. Supply a valid pick-list value to have all new assets start in that state; if the key is omitted, checkout falls back to the org's standard "Active" status. _Example_ ``` Active ``` * `returnOriginalMessage` (query, boolean) Tells the Checkout API whether to bypass the Translation Service and surface the raw, untranslated message text that the CPQ engine produced. Set it to true when your integration or debugging tools need the exact original strings for logging, monitoring, or downstream parsing; leave it false (or omit it) to have the response messages automatically localized by the Translation Service, so users receive user-friendly, language-specific text. Default: `false`. #### Request body Media type: `application/json`. Schema: `CheckoutRequest`. #### Responses * **200** OK - API request processed. Look for messages in the response to determine if it succeeded or failed. Media type: `application/json`. Schema: `CheckoutResponse`. * **500** Internal server error that may occur during cart processing. Below is a comprehensive list of possible error messages and their descriptions to help diagnose and resolve issues: | Message | Description | | --- | --- | | Checkout \| PCPValidation error | Error while executing PCP rules. | | Checkout \| validation rules error | Error while executing advanced rules. | | Checkout \|\| Multisite check for canCheckout error | Error while performing checkout of multisite cart. | | Compiled Data with key 'CartCompiledOfferHierarchy' not found | The CachedAPIResponse\_\_c does not contain the 'CartCompiledOfferHierarchy' CacheKey for the latest and active ConfigurationSnapshotId. | | Compiled Data with key 'CartCompiledPricingData' not found | The CachedAPIResponse\_\_c does not contain the 'CartCompiledPricingData' CacheKey for the latest and active ConfigurationSnapshotId. | | Compiled Data with key 'CompiledPricingVariableMaps' not found | The CachedAPIResponse\_\_c does not contain the 'CompiledPricingVariableMaps' CacheKey for the latest and active ConfigurationSnapshotId. | | Compiled Data with key 'pricelist-pbeid-sequence key' not found | The CachedAPIResponse\_\_c does not contain the 'pricelist-pbeid-sequence key' CacheKey for the latest and active ConfigurationSnapshotId. | | CPQDiscountActivated | No Line Item exists but Discount(s) are Activated in the Cart. | | CPQDiscountNotActivatedDiscounts | Discounts in the cart are not Activated. | | CPQDiscountUnapproved | Discounts in the cart are not Approved. | | CPQInvalidPriceList | Cart does not contain a PriceList. | | CPQNoItemsToClone | No Line Item exists in the Cart. | | Exception: SObjectClonerUtility \| queryRecords | Unable to fetch SObject records for cloning. | | Invalid id: {CART\_ID} | Empty cartId input parameter or invalid cart type. | | InvalidAccountId | Cart is not associated with an Account. | | No Header Object found. | Cart does not exist. | | No product compiled data found. | No data related to the product in transaction has been found in the CachedAPIResponse\_\_c. | | Not able to commit cart after Validation/PCPValidation | Error while committing the cart state to the database after executing the validation/PCP rules. | | PricebookEntry not found for product : {PRODUCT\_ID} with globalGroupKey {PRODUCT\_GGK} | PricebookEntry information of the product in transaction is not found in the CartDocument. | | The following line items that are passed in objectTypeToIdsToClone are not valid | The Line Items present in the Cart are not configured correctly. | | Unable to convert Compiled Context Dimensions to Map | Error while converting the Context Dimensions cached data to a Map. | | Unable to get fetchCompiledData2 | Error while fetching the cached data from the CachedAPIResponse\_\_c. | ### POST Run pricing for given items to a Cart. `POST /cpq/carts/{cartId}/price` Operation ID: `Run Pricing for Items to Cart`. Tags: Cart. Return the pricing information for each line item by invoking pricing rules. If line items are specified, they are priced, but it requires root line itemId to be passed in the items along with the child item. If line items are not specified, all of the items in the cart are priced. #### Parameters * `cartId` (path, string, required) Salesforce Id of the Cart (Opportunity, Quote or Order). _Example_ ``` 801xx000003GzX5AAK ``` #### Request body Request Body with cartId - required #### Price Cart Request Example ```json { "cartId": "801xx000003H0sxAAC", "items": [ "802xx000001o1YWAAY", "802xx000001o1YXAAY" ], "validate": true } ``` Media type: `application/json`. Schema: `PriceCartBody`. #### Responses * **101** No Results Found * **200** OK - API request processed. Look for messages in the response to determine if it succeeded or failed. #### Price Cart Items response Example **Note** - An entire result can be thousands of lines long. This example has been truncated. ```json { "totalSize":1 "messages":[] "actions":{} "records":[ { "messages":[] "actions":{} "displaySequence":-1 "productChildItemDefinition":{} "isVirtualItem":false "sequenceNumber":1 "groupMinQuantity":0 "productId":"01txx0000007CBoAAM" "Product2":{} "ProductCode":"Iphone16" "maxQuantity":99999 "hasChildren":true "IsActive":true "defaultQuantity":1 "PricebookEntry":{} "groupMaxQuantity":99999 "Name":"Iphone16" "UnitPrice":{} "productChildItemId":"a3Pxx0000004ni4EAA" "Product2Id":"01txx0000007CBoAAM" "minQuantity":0 "name":"Iphone16" "action":"Add" "Pricebook2Id":"01sxx0000005qRhAAI" "productHierarchyPath":"01txx0000007CBoAAM" "vlocity_cmt__RecurringPrice__c":100 "orderActive":false "itemType":"lineItem" "SellingPeriod":"Present" "vlocity_cmt__ProductGroupKey__c":{} "vlocity_cmt__ParentItemId__c":{} "vlocity_cmt__RecurringDiscountPrice__c":{} "vlocity_cmt__ItemName__c":{} "vlocity_cmt__EffectiveOneTimeTotal__c":{ "value":130 "previousValue": NULL "originalValue": NULL "messages":[] "label":"Effective One Time Total" "hidden":false "fieldName":"vlocity_cmt__EffectiveOneTimeTotal__c" "editable":true "dataType":"CURRENCY" "alternateValues": NULL "actions":{} } "vlocity_cmt__EffectiveRecurringTotal__c":{ "value":100 "previousValue": NULL "originalValue": NULL "messages":[] "label":"Effective Recurring Total" "hidden":false "fieldName":"vlocity_cmt__EffectiveRecurringTotal__c" "editable":true "dataType":"CURRENCY" "alternateValues": NULL "actions":{} } "vlocity_cmt__CatalogItemReferenceDateTime__c":{} "ListPrice":{} "vlocity_cmt__CpqCardinalityMessage__c":{} "vlocity_cmt__RecurringManualDiscount__c":{} "vlocity_cmt__CpqPricingMessage__c":{} "vlocity_cmt__IsChangesAllowed__c":{} "vlocity_cmt__OneTimeTotal__c":{ "value":130 "previousValue": NULL "originalValue": NULL "messages":[] "label":"One Time Total" "hidden":false "fieldName":"vlocity_cmt__OneTimeTotal__c" "editable":false "dataType":"CURRENCY" "alternateValues": NULL "actions":{} } "vlocity_cmt__FulfilmentStatus__c":{} "vlocity_cmt__LineNumber__c":{} "vlocity_cmt__ServiceAccountId__c":{} "vlocity_cmt__RecurringCharge__c":{ "value":50 "previousValue": NULL "originalValue": NULL "messages":[] "label":"Recurring Charge" "hidden":true "fieldName":"vlocity_cmt__RecurringCharge__c" "editable":false "dataType":"CURRENCY" "alternateValues": NULL "actions":{} } "vlocity_cmt__OneTimeCharge__c":{ "value":100 "previousValue": NULL "originalValue": NULL "messages":[] "label":"One Time Charge" "hidden":true "fieldName":"vlocity_cmt__OneTimeCharge__c" "editable":false "dataType":"CURRENCY" "alternateValues": NULL "actions":{} } "vlocity_cmt__SupersededOrderItemId__c":{} "vlocity_cmt__SupplementalAction__c":{} "vlocity_cmt__Product2Id__c":{} "vlocity_cmt__OrderGroupId__c":{} "vlocity_cmt__Action__c":{} "Quantity":{} "vlocity_cmt__OneTimeManualDiscount__c":{} "OrderId":{} "vlocity_cmt__EffectiveQuantity__c":{} "vlocity_cmt__BillingAccountId__c":{} "vlocity_cmt__AssetReferenceId__c":{} "vlocity_cmt__ProvisioningStatus__c":{} "vlocity_cmt__InCartQuantityMap__c":{} "vlocity_cmt__FirstVersionOrderItemId__c":{} "PricebookEntryId":{} "vlocity_cmt__ProductHierarchyPath__c":{} "vlocity_cmt__CpqMessageData__c":{} "vlocity_cmt__RootItemId__c":{} "Id":{} "vlocity_cmt__RecurringCalculatedPrice__c":{} "vlocity_cmt__OneTimeCalculatedPrice__c":{} "productCategories":{} "vlocity_cmt__ServiceAccountId__r":{} "vlocity_cmt__BillingAccountId__r":{} "lineItems":{ "totalSize":2 "messages":[] "records":[ { "messages":[] "actions":{} "displaySequence":-1 "productChildItemDefinition":{} "isVirtualItem":false "sequenceNumber":1 "groupMinQuantity":0 "productId":"01txx0000007CDQAA2" "Product2":{} "ProductCode":"Iphone16-Case" "maxQuantity":10 "hasChildren":false "IsActive":true "defaultQuantity":1 "PricebookEntry":{} "groupMaxQuantity":99999 "Name":"Iphone16-Case" "UnitPrice":{} "productChildItemId":"a3Pxx0000004nlIEAQ" "Product2Id":"01txx0000007CDQAA2" "minQuantity":0 "name":"Iphone16-Case" "action":"Add" "Pricebook2Id":"01sxx0000005qRhAAI" "productHierarchyPath":"01txx0000007CBoAAM<01txx0000007CDQAA2" "vlocity_cmt__RecurringPrice__c":0 "orderActive":false "itemType":"lineItem" "SellingPeriod":"Present" "vlocity_cmt__ProductGroupKey__c":{} "vlocity_cmt__ParentItemId__c":{} "vlocity_cmt__RecurringDiscountPrice__c":{} "vlocity_cmt__ItemName__c":{} "vlocity_cmt__EffectiveOneTimeTotal__c":{} "vlocity_cmt__EffectiveRecurringTotal__c":{} "vlocity_cmt__CatalogItemReferenceDateTime__c":{} "ListPrice":{} "vlocity_cmt__CpqCardinalityMessage__c":{} "vlocity_cmt__RecurringManualDiscount__c":{} "vlocity_cmt__CpqPricingMessage__c":{} "vlocity_cmt__IsChangesAllowed__c":{} "vlocity_cmt__OneTimeTotal__c":{ "value":30 "previousValue": NULL "originalValue": NULL "messages":[] "label":"One Time Total" "hidden":false "fieldName":"vlocity_cmt__OneTimeTotal__c" "editable":false "dataType":"CURRENCY" "alternateValues": NULL "actions":{} } "vlocity_cmt__FulfilmentStatus__c":{} "vlocity_cmt__LineNumber__c":{} "vlocity_cmt__ServiceAccountId__c":{} "vlocity_cmt__RecurringCharge__c":{} "vlocity_cmt__OneTimeCharge__c":{} "vlocity_cmt__SubAction__c":{} "vlocity_cmt__CurrencyPaymentMode__c":{} "vlocity_cmt__ProductHierarchyGroupKeyPath__c":{} "vlocity_cmt__RecurringTotal__c":{ "value":0 "previousValue": NULL "originalValue": NULL "messages":[] "label":"Recurring Total" "hidden":false "fieldName":"vlocity_cmt__RecurringTotal__c" "editable":false "dataType":"CURRENCY" "alternateValues": NULL "actions":{} } "vlocity_cmt__SupersededOrderItemId__c":{} "vlocity_cmt__SupplementalAction__c":{} "vlocity_cmt__Product2Id__c":{} "vlocity_cmt__OrderGroupId__c":{} "vlocity_cmt__Action__c":{} "Quantity":{} "vlocity_cmt__OneTimeManualDiscount__c":{} "OrderId":{} "vlocity_cmt__EffectiveQuantity__c":{} } {} ] } "childProducts":{} } ] } ``` * **500** Invalid Id Field ### GET Get Products for Cart `GET /cpq/carts/{cartId}/products` Operation ID: `getCartsProducts`. Tags: Cart. Retrieves a list of products available for a specific cart. Supports filtering by search text, product attributes, categories, and price list. Pagination is available via page size, offset, and last record ID parameters. Caching can be enabled with maxRecords and eaCacheKey. Only products available under the cart's price list are returned. Authentication via Bearer token is required. NOTE: * The ProductChildItemDefinition behaves differently based on the cart type. * For Classic Cart the childLineNumber is returned as an integer, for example childLineNumber = 1 * For Standard Cart the childLineNumber is returned as an decimal, for example childLineNumber = 1.0 * Currently, productCategories are not included in Standard Cart APIs, as support for ProdCatalogInfoOpen is not available in Standard, unlike Classic. #### Parameters * `cartId` (path, string, required) Salesforce Id of the Cart (Opportunity/Quote/Order) in which the Promotion has to be added. * `pagesize` (query, integer) Specifies the maximum number of products to return in a single response. Controls pagination size for result sets. Default: `20`. Example: `10`. * `query` (query, string) Search text for product filtering. Executes queries against Product2.Name and Product2.Description fields by default. Use the searchBy parameter to specify custom search fields, with PricebookEntry as the parent object context. Example: `PRODUCT-11`. * `lastRecordId` (query, string) Record identifier from the previous search result set. Used for cursor-based pagination to retrieve the next batch of records. * `offsetSize` (query, integer) Number of records to skip from the beginning of the result set. Used for offset-based pagination. Example: `10`. * `includeAttachments` (query, boolean) Determines whether product attachments are included in the response. Set to true to include attachments, false to exclude them. Default: `false`. * `includeAttributes` (query, boolean) Controls whether product attributes and their associated values are returned in the response. Default: `false`. Example: `true`. * `includeIneligible` (query, boolean) Specifies whether to include both qualified and disqualified products in the response. When true, returns all products regardless of eligibility status. Default: `false`. Example: `true`. * `sortBy` (query, string) Defines the sorting criteria for returned products. Accepts field names with optional sort direction suffixes: \_ASC (ascending), \_DESC (descending), or no suffix for default ordering. Example: `Product2.Name_DESC, Product2.Code`. * `searchBy` (query, string) Comma-separated list of field names to search when the query parameter is provided. Overrides default search behavior to target specific fields for text matching. Example: `Product2.Name,Product2.Description`. * `maxRecords` (query, integer) Maximum number of product records to process and cache (limit: 1000). Used in conjunction with eaCacheKey for optimized caching of qualified products. Example: `50`. * `eaCacheKey` (query, string) Unique identifier for caching product lists. Should be constructed to ensure uniqueness per cart, catalog, and relevant context dimensions for efficient cache management. Example: `cart1234-user5678-20240601`. * `eaCheck` (query, boolean) Enables Eligibility and Availability (EA) rule evaluation. When true, applies configured EA rules to filter products that don't meet eligibility or availability criteria. Default: `true`. Example: `false`. * `attributes` (query, string) Product attribute-based filtering criteria. Format: :\_,:|. Supports both discrete values and numeric ranges (min/max). Example: `Color:Red_Blue,Size:10|20`. * `fields` (query, string) Comma-separated list of field names to include in the response. Controls which product or item fields are returned in the result set. Example: `Name,Description,UnitPrice,vlocity_cmt__RecurringCharge__c`. * `filterByPriceListOnly` (query, boolean) Restricts results to products associated with the specified price list. When true, excludes products not present in the target price list. Example: `true`. * `filters` (query, string) Field-based filtering criteria in the format :\_. Multiple filters can be specified using comma separation. Supports multiple values per field using underscore separation. Example: `h_cpq__ServiceAccountId__c:991360000008eNU_991360000008eNY,h_cpq__BillingAccountId__c:01t36000000pfcKAAQ_01t36000000pfcKAAQ`. * `category` (query, string) Comma-separated list of product category identifiers for category-based filtering. Restricts results to products belonging to the specified categories. Example: `a10LT00001FSy05,a10LT00001FSz05,a10LT00001FSx05`. * `parentId` (query, string) The unique identifier of the parent product. Use this to specify the parent node in the product hierarchy from which child products should be retrieved. This is required only when querying for child products/items under a specific parent. Example: `01t5g00000A1b2C`. * `parentProductHierarchyPath` (query, string) The full hierarchy path of the parent product, represented as a string of product IDs separated by the < character. This path encodes the ancestry of the current node in the product hierarchy, allowing the API to determine the current position and context within nested bundles. Used together with parentId for nested queries. Example: `01t5g00000A1b2C<01t5g00000A1b2D`. * `maxProdListHierarchy` (query, string) Specifies the maximum depth of the product hierarchy to be returned in the product list. This controls how many levels deep the API will traverse when returning child products, preventing excessive recursion and limiting the size of the response. If not provided, the value is taken from the CPQ configuration (DefaultMaxHierarchyDepthForProdList), or defaults to 0. If the current hierarchy level (as determined by the number of segments in parentProductHierarchyPath) equals this value, the API will not return further child products. Example: `2`. * `parentItemId` (query, string) The unique identifier of the parent item instance in the cart (such as a line item in a quote or order). Use this when the query context is a specific cart item, rather than a product definition. This is relevant for operations that need to reference a specific cart item instance, such as line item customizations. Not always required for product hierarchy queries. Example: `a1B5g00000A1b2E`. #### Responses * **200** Successful response with product list. Note: The following example is trimmed for brevity and does not include all possible response fields. Example: ```json { "totalSize": 2, "messages": [], "records": [ { "Product2": { "Name": "PRODUCT-46223", "Id": "01tLT0000093Pr7YAE" }, "UnitPrice": { "label": "List Price", "value": 3472.87 }, "IsActive": { "label": "Active", "value": true }, "Name": { "label": "Product Name", "value": "PRODUCT-46223" }, "ProductCode": { "label": "Product Code", "value": "CODE-88388" } } ] } ``` Media type: `application/json`. Schema: `GetCartsProductsResponse`. * **400** Bad request or invalid input. Example (invalid maxRecords): ```json { "messages": [ { "message": "maxRecords must be a positive integer.", "messageId": "INVOKE-500", "code": "Invalid input: maxRecords must be a positive integer.", "severity": "ERROR" } ], "totalSize": 0 } ``` Example (no qualified products found): ```json { "messages": [ { "message": "CPQNoResultsFound", "code": "101", "severity": "ERROR" } ], "totalSize": 0 } ``` Media type: `application/json`. Schema: `GetCartsProductsErrorResponse`. * **default** Unexpected error ### DELETE Delete Applied Promotion from a Cart. `DELETE /cpq/carts/{cartId}/promotions` Operation ID: `Delete Applied Promotion`. Tags: Cart. All-in-one operation that cleanly removes a promotion from a CPQ cart, along with any promo-generated items while automatically recalculating prices and re-checking cart rules. #### Parameters * `cartId` (path, string, required) Salesforce Id of the Cart (Opportunity, Quote or Order). _Example_ ``` 801xx000003GzX5AAK ``` * `id` (query, string, required) Comma-separated Applied Promotion Id(s) to delete. _Example_ ``` a2Lf40000008nL5EAI,a2Lf40000008nL5FVG ``` * `price` (query, boolean) Indicates whether to run the pricing engine (true) or not (false). Default: `true`. * `validate` (query, boolean) Indicates whether validation rules are run for the current API request (true) or not (false). Default: `true`. * `checkActivePromos` (query, boolean) Controls whether the API prevents or allows deletions that would leave an active promotion without associated items. True => If any target line-item is tied to an active promotion, the call throws a validation error (code 406) — unless the custom setting DELETE\_APPLIED\_PROMO=true, in which case the promotion itself is first deleted and the item delete proceeds. False => Items are deleted even if they belong to an active promotion. Default: `true`. * `proceedToCommit` (query, boolean) Flag that tells the Delete Cart Items service whether to finish the transaction or stop after all validations. True => After the items pass validation, the service commits the deletes and writes the cart back to the database. False => The service still runs every check (promotion guard, cardinality rules, etc.) but does not save any changes, it returns the validation result only. Useful for "pre-check" buttons or batch jobs that want to validate first and commit in a later call. Default: `true`. * `DeleteServices` (query, string) If YES, DEFAULT, or NULL, enables deep delete mode, which deletes promotion pricing and products from the cart. If NO, enables shallow delete mode, which removes promotion pricing but not promotion products from the cart. _Example_ ``` Default ``` * `cancellationDate` (query, string) Specify a Cancellation Date for the Applied Promotion that is being deleted. * `cancellationReason` (query, string) Specify a Cancellation Reason for the Applied Promotion that is being deleted. * `checkForAppliedAction` (query, boolean) Indicates whether to check the Applied Action of the Promotion that is being deleted. Default: `true`. #### Responses * **152** OK - API request processed. Look for messages in the response to determine if it succeeded or failed. Media type: `application/json`. Schema: `DeleteAppliedPromoResponse`. * **500** Internal server error that may occur during cart processing. Below is a comprehensive list of possible error messages and their descriptions to help diagnose and resolve issues: | Message | Description | | --- | --- | | Compiled Data with key 'CartCompiledOfferHierarchy' not found | The CachedAPIResponse\_\_c does not contain the 'CartCompiledOfferHierarchy' CacheKey for the latest and active ConfigurationSnapshotId. | | Compiled Data with key 'CartCompiledPricingData' not found | The CachedAPIResponse\_\_c does not contain the 'CartCompiledPricingData' CacheKey for the latest and active ConfigurationSnapshotId. | | Compiled Data with key 'CompiledPricingVariableMaps' not found | The CachedAPIResponse\_\_c does not contain the 'CompiledPricingVariableMaps' CacheKey for the latest and active ConfigurationSnapshotId. | | Compiled Data with key 'pricelist-pbeid-sequence key' not found | The CachedAPIResponse\_\_c does not contain the 'pricelist-pbeid-sequence key' CacheKey for the latest and active ConfigurationSnapshotId. | | CPQInvalidPriceList | Cart does not contain a PriceList. | | CPQNoItemsToDelete / No Item with the Provided ID Exists in Cart | The Line Item Ids passed in the input are not available to delete. | | Delete the promotions ({NO\_OF\_PROMOS}) that are associated with the product or child product. Then delete the product. | The item you're trying to delete is tied to more than one different promotion. Delete all of them first, then retry the item delete. | | Delete the {PROMOTION\_NAME} promotion that's associated with the product or child product. Then delete the product. | The item is associated with one specific promotion (shown by {PROMOTION\_NAME}). Remove that promotion before deleting the item. | | Delete the {PROMOTION\_NAME} ({NO\_OF\_PROMOS}) promotions that are associated with the product or child product. Then delete the product. | The item is linked to several instances of the same promotion ({PROMOTION\_NAME} repeated {NO\_OF\_PROMOS} times). Delete every instance of that promotion, then delete the item. | | Entity Filter failed to evaluate conditions | Error while executing advanced rules. | | Invalid id: {CART\_ID} | Empty cartId input parameter or invalid cart type. | | InvalidAccountId | Cart is not associated with an Account. | | No Header Object found. | Cart does not exist. | | No product compiled data found. | No data related to the product in transaction has been found in the CachedAPIResponse\_\_c. | | PricebookEntry not found for product : {PRODUCT\_ID} with globalGroupKey {PRODUCT\_GGK} | PricebookEntry information of the product in transaction is not found in the CartDocument. | | {PRODUCT\_NAME} is still present as a service, even after deleting the promotion. Please request to remove if you wish. | This implies that the product associated with the applied promotion has not been deleted. | | Unable to convert Compiled Context Dimensions to Map | Error while converting the Context Dimensions cached data to a Map. | | Unable to get fetchCompiledData2 | Error while fetching the cached data from the CachedAPIResponse\_\_c. | ### POST Replace Offers in Cart `POST /cpq/carts/{cartId}/offermigration/replacement` Operation ID: `replaceOffers`. Tags: Cart. Replaces an assetized product (source product) with another product from the same product family (target product) within an order or quote. Preserves attributes, child products, and specific fields from the original order line item (OLI) during the replacement. See documentation for details on attribute copying, child product handling, and field settings. #### Parameters * `cartId` (path, string, required) Salesforce Id of the Cart (Opportunity/Quote/Order) in which the replacement is to be performed. #### Request body (required) Media type: `application/json`. Schema: `ReplaceOffersRequest`. #### Responses * **200** Success response for Replace Offers operation. Example: ```json { "actions": { "itempricesupdated": { "client": { "params": {} }, "remote": { "params": {} }, "rest": { "method": "GET", "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/801xx000003H57rAAC/price?price=false&cartId=801xx000003H57rAAC", "params": {} } } }, "messages": [ { "message": "Replacement applied successfully", "code": "830", "severity": "INFO" } ], "totalSize": 0 } ``` Media type: `application/json`. Schema: `ReplaceOffersResponse`. * **400** Bad request or invalid input. Example (missing targetOfferIdToItemIds): ```json { "messages": [ { "message": "Target product(s) not found.", "code": "109", "severity": "ERROR" } ], "totalSize": 0 } ``` Media type: `application/json`. Schema: `ReplaceOffersErrorResponse`. * **default** Unexpected error ## Schemas ### AssetToOrderRequest * `subaction` (_string_, required) This parameter specifies the required method to invoke from createCart. In this case, the subaction should be set to assetToOrder. This parameter is only necessary for REST API calls. Example: `assetToOrder`. * `id` (_string_, required) Comma-separated Salesforce IDs of the Assets to be added to FDO. * `accountId` (_string_) The Salesforce ID of the Account where the assets are located. If this is not provided in the input request, a root asset account will be used by default. * `orderId` (_string_) The Salesforce ID of the Order to which the assets should be transferred. * `requestDate` (_string_) It is the Future Dated Order request date. Either requestDate or requestDateTime is mandatory parameter to the request. Otherwise, API would fail with an error. Example: `2025-05-16`. * `requestDateTime` (_string_) It is the Future Dated Order requested start date. Either requestDate or requestDateTime is mandatory parameter to the request. Otherwise, API would fail with an error. Example: `2025-05-16T00:00:00.000Z`. * `price` (_boolean_) Indicates whether to run the pricing engine or not. Default: `false`. * `validate` (_boolean_) Indicates whether validation rules has to be run for the current API request or not. Default: `false`. ### AssetToOrderResponse * `totalSize` (_integer_) Total number of records. Example: `0`. * `messages` (_array of string_) Array of informational or error messages. Items: Example: `Error message`. * `records` (_array of object_) * `messages` (_array of string_) Items: Example: `Error message`. * `cartId` (_string_) Example: `801xx000003H3nbAAC`. * `displaySequence` (_integer_) Example: `-1`. ### GetCartsResponse Response containing cart details, associated sites, and metadata * `totalSize` (_integer_) Total number of cart records returned in the response Example: `1`. * `messages` (_array of string_) Array of messages at the root level for overall response status or errors * `records` (_array of object_) Array of cart records containing detailed cart information * `messages` (_array of string_) Messages specific to this cart record * `displaySequence` (_integer_) Ordering sequence for display purposes * `details` (_object_) Detailed information about the cart * `totalSize` (_integer_) Total number of detail records Example: `1`. * `messages` (_array of string_) Messages specific to cart details * `records` (_array of object_) Array of detailed cart records containing pricing, status, and configuration * `messages` (_array of string_) Messages specific to this cart detail record * `actions` (_object_) Available actions that can be performed on the cart * `checkout` (_object_) Checkout action configuration and endpoints * `remote` (_object_) Remote action configuration for checkout * `params` (_object_) Parameters required for remote checkout action * `cartId` (_string_) Unique identifier of the cart for checkout Example: `801DX000000FERDYA4`. * `methodName` (_string_) Name of the method to be invoked for checkout Example: `checkout`. * `rest` (_object_) REST endpoint configuration for checkout * `method` (_string_) HTTP method for the REST endpoint * `link` (_string_) REST endpoint URL * `params` (_object_) Parameters for the REST endpoint * `client` (_object_) Client-side configuration for checkout * `params` (_object_) Client-side parameters for checkout * `records` (_array of string_) Client-side records for checkout processing * `displaySequence` (_integer_) Display order sequence for the cart detail * `frameAgreementPresent` (_boolean_) Indicates if a frame agreement is associated with the cart Example: `false`. * `isNotActiveContractDiscountPresent` (_boolean_) Indicates if inactive contract discounts are present Example: `false`. * `PriceListId__r.LoyaltyCode__c` (_string_) Loyalty code associated with the price list Example: `PTS`. * `SupersededOrderId__c` (_string_) Id of the order that this order supersedes, if any * `OrderNumber` (_string_) Unique order number for the cart Example: `00001281`. * `PriceListId__r.CurrencyCode__c` (_string_) Currency code for the price list Example: `USD`. * `translatedLabels` (_object_) Localized labels for cart fields and attributes Additional properties: `string`. _Example_ ``` { "Status": "Status", "IsChangesAllowed__c": "Changes Allowed", "EffectiveRecurringTotal__c": "Recurring Total", "OriginatingContractId__c": "Originating Contract", "OrderNumber": "Order Number" } ``` * `EffectiveRecurringTotal__c` (_number_) Total recurring charges for the cart Example: `358`. * `canCheckoutDiscounts` (_boolean_) Indicates if discounts can be applied during checkout Example: `true`. * `EffectiveUsagePriceTotal__c` (_number_) Total usage-based charges for the cart Example: `0`. * `PriceListId__c` (_string_) Id of the price list associated with the cart Example: `a3sDX00000003lJYAQ`. * `accountDiscountsCount` (_integer_) Number of account-level discounts applied to the cart Example: `0`. * `ObjectType` (_string_) Type of the object (Order, Quote or Opportunity) Example: `Order`. * `Account.Id` (_string_) Id of the account associated with the cart Example: `001DX000002K5WlYAK`. * `orderStatusValue` (_string_) Current status value of the order Example: `Ready To Submit`. * `Account.PhotoUrl` (_string_) URL of the account's profile photo Example: `/services/images/photo/001DX000002K5WlYAK`. * `cartAddedDiscounts` (_integer_) Number of discounts added to the cart Example: `1`. * `Status` (_string_) Current status of the cart Example: `Draft`. * `EffectiveOneTimeTotal__c` (_number_) Total one-time charges for the cart Example: `0`. * `IsChangesAllowed__c` (_boolean_) Indicates if modifications to the cart are allowed Example: `true`. * `contractDiscountsCount` (_integer_) Number of contract-level discounts applied to the cart Example: `0`. * `OrderStatus__c` (_string_) Detailed order status Example: `Ready To Submit`. * `PriceListId__r.Name` (_string_) Name of the price list associated with the cart Example: `TEST_PRICELIST`. * `discountsForSubmission` (_boolean_) Indicates if there are discounts pending submission Example: `false`. * `EffectiveOrderTotal__c` (_number_) Total amount for the entire order including all charges Example: `0`. * `Account.Name` (_string_) Name of the account associated with the cart Example: `TestAcct`. * `Id` (_string_) Unique identifier of the cart Example: `801DX000000FERDYA4`. * `isCartActivated` (_boolean_) Indicates if the cart has been activated Example: `false`. * `sites` (_object_) Information about service locations or sites associated with the cart * `totalSize` (_integer_) Total number of sites associated with the cart Example: `0`. * `messages` (_array of object_) Messages related to site operations or status * `messageId` (_string_) Unique identifier for the message * `bundleId` (_string_) Id of the associated bundle if applicable * `code` (_string_) Message code for categorization Example: `101`. * `severity` (_string_) Severity level of the message Example: `ERROR`. * `message` (_string_) Detailed message text Example: `No Results Found.`. * `actions` (_object_) Available actions related to this message * `actions` (_object_) Available actions for site management * `newsite` (_object_) Configuration for creating a new site * `remote` (_object_) Remote action configuration for site creation * `params` (_object_) Parameters for remote site creation * `methodName` (_string_) Method name for creating a new site Example: `newSite`. * `type` (_string_) Type of site to be created Example: `Service`. * `rest` (_object_) REST endpoint configuration for site creation * `method` (_string_) HTTP method for the site creation endpoint Example: `POST`. * `link` (_string_) REST endpoint URL for site creation Example: `/services/apexrest/vlocity_cmt/v2/cpq/carts/801DX000000FERDYA4/sites`. * `params` (_object_) Parameters for the site creation endpoint * `type` (_string_) Type of site to create Example: `Service`. * `client` (_object_) Client-side configuration for site creation * `params` (_object_) Client-side parameters for site creation * `records` (_array of string_) Client-side records for site creation ### UpdateCartItemRequest Request for the update cart item * `items` (_UpdateCartItem_) ### PostCartsItemsRequest * `validate` (_boolean_) Indicates whether validation rules have to be run for the current API request or not. Default: `true`. Example: `true`. * `items` (_array of PostCartsItemsItem_) A list of items to be added. Each item object contains specific fields depending on the type of add. * `cartId` (_string_) The unique identifier for the cart. Example: `801xx000003H4WlAAK`. * `price` (_boolean_) Indicates whether to run the pricing engine or not. Default: `true`. Example: `true`. * `quantity` (_integer_) The quantity of the item to be added. Example: `3`. * `noResponseNeeded` (_boolean_) Returns no result node when set to true. Default: `false`. Example: `false`. ### PostCartsItemsResponse * `totalSize` (_integer_) * `messages` (_array of PostCartsItemsMessage_) * `actions` (_object_) * `records` (_array of object_) ### PostCartsItemsErrorResponse * `messages` (_array of PostCartsItemsMessage_) * `totalSize` (_integer_) ### DeleteCartsItemsResponse * `totalSize` (_integer_) * `messages` (_array of object_) Array of informational or error messages. * `code` (_string_) Example: `152`. * `severity` (_string_) Example: `INFO`. * `message` (_string_) Example: `Successfully deleted.`. * `actions` (_object_) * `itempricesupdated` (_object_) * `remote` (_object_) * `methodName` (_string_) Name of the remote method to retrieve updated cart line item prices after deletion. Example: `getCartLineItemPrices`. * `params` (_object_) Parameters required by the remote method for price retrieval. * `cartId` (_string_) Unique identifier of the cart for which prices are being updated. Example: `801xx000003H0D1AAK`. * `price` (_boolean_) Indicates whether to run the pricing engine (true) or not (false) when updating prices after deletion. Example: `false`. ### CheckoutRequest * `validate` (_boolean_) Indicates whether validation rules are run for the current API request (true) or not (false). Example: `true`. * `validateSubmittedXLI` (_boolean_) Flag to indicate whether to run the line item presubmit validation or not. Example: `false`. * `assetizeFullBundlePerRoot` (_boolean_) Flag to indicate whether to assetize the line items by the root item ids. Example: `false`. ### CheckoutResponse * `totalSize` (_integer_) Total number of records returned in the response Example: `1`. * `messages` (_array of object_) Array of informational or error messages. * `code` (_string_) Example: `SUBMIT-1008`. * `severity` (_string_) Example: `INFO`. * `message` (_string_) Example: `Order 801xx000003H0JTAA0 was assetized and activated.`. * `records` (_array of object_) Array of record objects returned by the checkout operation. * `messages` (_array of string_) Messages specific to this record * `displaySequence` (_integer_) Display order sequence for the record * `clonedObjectIds` (_string_) JSON stringified array of cloned object Ids Example: `["02ixx0000004N2AAAU"]`. * `id` (_string_) The unique identifier for the record Example: `001xx000003H0HrAAK`. * `objectType` (_string_) The type of the object (e.g., Account, Order, etc.) Example: `Account`. ### PriceCartBody Request body sent in for price cart * `cartId` (_string_) Example: `8011N00000157LkQAI`. * `methodName` (_string_) Example: `priceCart`. * `validate` (_boolean_) Example: `true`. * `items` (_array of string_) _Example_ ``` [ "80279000000Y5C9AAK", "80279000000Y5CAAA0" ] ``` ### GetCartsProductsResponse * `totalSize` (_integer_) * `messages` (_array of GetCartsProductsMessage_) * `records` (_array of GetCartsProductsRecord_) ### GetCartsProductsErrorResponse * `messages` (_array of GetCartsProductsMessage_) * `totalSize` (_integer_) ### DeleteAppliedPromoResponse * `totalSize` (_integer_) Total number of records affected by the delete operation. Example: `0`. * `messages` (_array of object_) Array of informational or error messages. * `code` (_string_) Example: `152`. * `severity` (_string_) Example: `INFO`. * `message` (_string_) Example: `Successfully deleted.`. * `actions` (_object_) Actions and follow-up operations available after the delete operation. * `itempricesupdated` (_object_) * `rest` (_object_) * `params` (_object_) * `method` (_string_) * `link` (_string_) * `remote` (_object_) * `params` (_object_) * `cartId` (_string_) Unique identifier of the cart for which prices are being updated. Example: `801xx000003H0JTAA0`. * `price` (_boolean_) Indicates whether to run the pricing engine (true) or not (false) when updating prices after deletion. Example: `false`. * `methodName` (_string_) Name of the remote method to retrieve updated cart line item prices after deletion. Example: `getCartLineItemPrices`. * `client` (_object_) * `params` (_object_) * `itemdeleted` (_object_) * `rest` (_object_) * `params` (_object_) * `method` (_string_) * `link` (_string_) * `remote` (_object_) * `params` (_object_) * `items` (_array of object_) * `message` (_string_) Example: `Test_Promo has been deleted from the cart.`. * `Id` (_string_) Example: `a35xx000000rOLhAAM`. * `client` (_object_) * `params` (_object_) * `items` (_array of object_) * `message` (_string_) Example: `Test_Promo has been deleted from the cart.`. * `Id` (_string_) Example: `a35xx000000rOLhAAM`. ### ReplaceOffersRequest * `attributeCodesToCopyDuringReplace` (_array of string_) List of attribute codes that should be copied from the source to the target during replacement. _Example_ ``` [ "CMT-9413-4", "CMT-9413" ] ``` * `targetOfferIdToItemIds` (_string_) Maps the target PricebookEntry ID to source OrderItem IDs to be replaced in the format: "targetOfferPbeId1:OrderItemId1\_OrderItemId2,targetOfferPbeId2:OrderItemId3\_OrderItemId4" Example: `01uf40000039ps9AAA:802f400000Pxl2mAAB_802f400000Pul2mAAB`. * `price` (_boolean_) Executes pricing on the line items and applies discount/promotion adjustments/overrides if defined and also rollups and totals for cart. Default: `true`. Example: `true`. * `validate` (_boolean_) Executes advanced rules if set to true. Default: `false`. Example: `true`. ### ReplaceOffersResponse * `actions` (_object_) * `itempricesupdated` (_object_) * `client` (_object_) * `params` (_object_) * `remote` (_object_) * `params` (_object_) * `rest` (_object_) * `method` (_string_) Example: `GET`. * `link` (_string_) Example: `/services/apexrest/vlocity_cmt/v2/cpq/carts/801xx000003H57rAAC/price?price=false&cartId=801xx000003H57rAAC`. * `params` (_object_) * `messages` (_array of ReplaceOffersMessage_) * `totalSize` (_integer_) ### ReplaceOffersErrorResponse * `messages` (_array of ReplaceOffersMessage_) * `totalSize` (_integer_) ### UpdateCartItem Request for the update cart item * `records` (_array of Cart_) ### PostCartsItemsItem * `itemId` (_string_) Pricebook entry id of the product to be added. Example: `01uxx00000099gxAAA`. * `fieldsToUpdate` (_object_) Used to update cart item fields. When passing price fields (`UnitPrice`, `ListPrice`), set `price` to `false` so caller-supplied values persist. When `price` is `true` (the default), the pricing engine runs after these values are applied and can overwrite price fields based on pricebook entries and pricing plan rules. * `parentId` (_string_) The unique identifier for the parent item. Example: `802xx000001ni7fAAA`. * `parentHierarchyPath` (_string_) The product hierarchy path of the parent item. Example: `01txx0000006qMaAAI`. * `parentRecord` (_PostCartsItemsParentRecord_) Contains records related to the parent item. See the table below for required/optional fields. ### PostCartsItemsMessage * `code` (_string_) * `severity` (_string_) * `message` (_string_) ### GetCartsProductsMessage * `message` (_string_) * `code` (_string_) * `severity` (_string_) ### GetCartsProductsRecord * `Product2` (_object_) * `Name` (_string_) * `Id` (_string_) * `UnitPrice` (_object_) * `label` (_string_) * `value` (_number_) * `IsActive` (_object_) * `label` (_string_) * `value` (_boolean_) * `Name` (_object_) * `label` (_string_) * `value` (_string_) * `ProductCode` (_object_) * `label` (_string_) * `value` (_string_) ### ReplaceOffersMessage * `message` (_string_) * `code` (_string_) * `severity` (_string_) ### Cart * `messages` (_Messages_) * `actions` (_Action_) * `displaySequence` (_integer_) Sequence to display in the UI. Example: `-1`. * `Id` (_string_) Example: `8016A000000bwElQAI`. * `Name` (_string_) Example: `New customer order`. * `EffectiveDate` (_string (date)_) Example: `2017-12-25`. * `AccountId` (_string_) Example: `0016A0000053kHN`. * `Account.Name` (_string_) Example: `Acme Inc.`. * `EffectiveRecurringTotal__c` (_number (float)_) * `EffectiveOneTimeTotal__c` (_number (float)_) * `EffectiveOrderTotal__c` (_number (float)_) * `OrderNumber` (_string_) Order Number assigned by Salesforce Example: `00000141`. * `Status` (_string_) Example: `Draft`. ### PostCartsItemsParentRecord Contains records related to the parent item. Used for child adds, especially under virtual parents. See field descriptions for required/optional status and alternatives. * `records` (_array of object_) Array of parent item record objects. * `vlocity_cmt__RootItemId__c` (_object_) Contains details about the root item ID. Recommended for child addition along with Id. * `vlocity_cmt__AssetReferenceId__c` (_object_) Contains details about the asset reference ID. Recommended for child addition along with Id. * `Id` (_object_) Contains details about the Parent Cart Item ID. Required for child addition. * `isVirtualItem` (_boolean_) Indicates if the item is a virtual item. Required for child adds under a virtual parent. * `parentLineItemId` (_string_) The line item ID of the parent. * `productHierarchyPath` (_string_) The product hierarchy path. Required for child adds under a virtual parent. ### Messages Array of `object`. ### Action * `remote` (_object_, read-only) JavaScript Remoting URL # Standard Digital Commerce Standard Digital Commerce is the next-generation version of the Digital Commerce APIs. Standard Digital Commerce, like Digital Commerce, is a cloud-based solution that enables high-volume browsing and configuration of product offers on digital self-service channels. Standard Digital Commerce is industry-specific and works with Salesforce Industries Communications, Media, and Energy verticals to provide a catalog-driven, unified commerce solution. Standard Digital Commerce improves the performance and scalability of the existing Digital Commerce APIs. Standard Digital Commerce delivers the industries-specific CPQ engine on Salesforce core to improve the performance of Digital Commerce Configure and Basket operations. The Configure and Basket operations no longer depend on the runtime cache of the API response. Instead, each API response for Configure and Basket operations is curated from Salesforce core instead of the CPQ engine in the Salesforce Industries Communications, Media, and Energy managed package. For Winter '23, Standard Digital Commerce services are available in Salesforce core, but you must still use the managed package to access the APIs. # Standard Digital Commerce APIs Use the Standard Digital Commerce APIs to meet your customers' needs. See [Standard Digital Commerce REST APIs](https://developer.salesforce.com/docs/industries/cme/references/std-dc-rest?meta=Summary). **note:** Running multiple APIs in a single transaction can result in governor limit, CPU limit, or inconsistent result. Standard Digital Commerce REST APIs # Standard Digital Commerce REST APIs Standard Digital Commerce APIs are RESTful Web APIs designed to enable client applications such as consumer-facing web and mobile apps to shop for products and services. The Digital Commerce APIs are optimized for consumer shopping use cases where the user may be anonymous until well into the check-out process. These APIs are also optimized to enable caching of API responses to provide performance enhancements and scalability. Finally, these APIs are optimized for lower bandwidth connections between the client app and the server by minimizing the metadata returned in the response. The Digital Commerce APIs are provided in addition to the Vlocity Cart Based APIs. The Cart Based APIs are optimized for highly interactive cart operations done by contact center agents and sales reps using an editor such as the Vlocity Cart UI. Therefore, Cart Based APIs provide more metadata to the client browser enabling a wide array of operations. Both the Cart Based CPQ APIs and the Digital Commerce APIs continues to be supported and actively enhanced. The Digital Commerce APIs are not intended to replace the Cart based APIs. All of the Vlocity Omnichannel REST APIs simplify client app development by hiding the details of internal CPQ processing. Client-side developers do not need to understand details of the underlying CPQ logic: no need to know the proper order to apply eligibility and availability rules and no need to learn the methods of the underlying CPQ rules engines and other CPQ services. * * * The basic flow of API calls with the digital commerce APIs is as follows: 1. Get eligible offers from a catalog: GET /v3/catalogs/{catalogcode}/offers 2. Get the details of a specific offer retrieved from the previous call: GET /v3/catalogs/{catalogcode}/offers/{offercode} 3. Get the details of a specific offer with attribute values specified: POST /v3/catalogs/{catalogcode}/offers/{offercode} 4. Preview details of multiple offers with attribute values specified: POST /v3/preview/catalogs/{catalogcode}/offers \[Only when Standard DC is enabled\] The above APIs retrieve eligible offers (products and/or promotions) from the specified catalog based on the customer context provided in the request, but these APIs only return default "starts-with" and base pricing information. To request more specific pricing and feedback on the validity of the configured bundle, use the basket APIs that follow. 5. Get a basket containing a configured offer bundle using an offer details response (3 above): POST /v3/catalogs/{catalogcode}/basket 6. Get a modification of the previous basket adding another bundle or deleting a bundle: POST /v3/catalogs/{catalogcode}/basket/{basketkey} The basket APIs get specific pricing for the context given by executing the Vlocity CPQ pricing services. The API returns a basket key that is a hash form of a cart containing the chosen items as configured. 7. Create a cart in Salesforce for a specific customer using the basket response (4 or 5 above): POST /v3/carts **Version:** Spring 2025 ## Servers * `https://xx##.salesforce.com/services/apexrest/vlocity_cmt` * `http://xx##.salesforce.com/services/apexrest/vlocity_cmt` Protocols: https, http. ## Operations ### GET Get application health, application build information, salesforce authentication,redis information (AWS only) `GET /app-status` Operation ID: `getAppStatus`. Tags: Audit. Get application health, details, build information and check jks keys and display\`s jks key expire information. Gets redis information and redis pool status. Note: Endpoint only for AWS. #### Responses * **200** successful operation Media type: `application/json`. Schema: `AppStatusResponse`. * **500** Invalid status value ### GET Diagnose the application and get current the information of application (AWS only) `GET /app-diagnostic` Operation ID: `getAppDiagnostic`. Tags: Audit. Get application diagnose information of salesforce , redis, application context. Note: Endpoint only for AWS. #### Responses * **200** successful operation Media type: `application/json`. Schema: `AppDiagnosticResponse`. * **500** Invalid status value ### GET Get Offers By Catalog, Get Featured Offers & Get Contains Products `GET /v3/catalogs/{catalogcode}/offers` Operation ID: `getOffersByCatalogCode`. Tags: Catalog. Get offers from the specified Catalog (identified by Catalog Code). Offers can be a product or a promotion (and in the future a product with an applied promotion). The sortby param can sort featured offers first in the result set. #### Parameters * `catalogcode` (path, string, required) Identifies the catalog of interest to a customer, prospect or partner. This defines the collection of offers to present to the users and sets a default price list and locale(lang). * `contains` (query, string) A Product Code (Product2.ProductCode) that is contained within one or more composite or bundle offers. Use to query for offers containing the desired component product such as an iPhone8. The sortby parameter (thus sorting) is not supported with the contains parameter in Fall '18. * `contextkey` (query, string) Context key (e.g. 784b264ea6dc63690369e721ffd8e112) which describes the anonymous or known customer's "context" to be used in rule processing. Use if the customer's context key is known. * `context` (query, array of string, collection format: csv) If isloggedin is not present in the API or isloggedin parameter value is false then, Context dimension values in the following format: dimension1:val1,dimension2:val2. Required if the context key or account id are not provided. The key value pairs specify Context Dimension values that describe the anonymous or known customer's "context" to be used in rule processing. If a value for any given context dimension defined in the Vlocity Product Catalog is not provided, the default value specified on the Context Dimension is used to determine eligibility and pricing. if isloggedin is present in the API and isloggedin parameter value is set to true then, this parameter should have, accountId, contractId(optional), rootAssetIds(optional), example format for logged-in user context param : {"accountId":"idvalue", "contractId":"idvalue", "rootAssetIds": \["idvalue"\]} * `forceinvalidatecache` (query, boolean) For debugging purposes, TRUE forces a cache refresh for this key. This parameter only works when a server setting enables forceinvalidatecache to be set from the API. * `isloggedin` (query, boolean) A flag which describes if the user is logged-in or anonymous. If isloggedin flag is true, It indicates present API is used by a logged-in user, then we expect an accountId and a contractId in the context param of the API. If the isloggedin flag is false or if this param is not specified, It indicates present API is used by an anonymous user * `pagesize` (query, integer) Page size of results defined as the number of offers to return. Default pagesize can be set in the server (Vlocity API Metadata > API Params). * `offset` (query, integer) Offset of results to return. This is used along with pagination to request a specific page of results. For example, an offset value of 40 and pagesize of 20 will request that the server return the third page of offers. In other words, it should return 20 offers starting from the 40th offer in the complete list. If not specified in request, offset defaults to 1, but this can be overridden in the server (Vlocity API Metadata > API Params). * `sortby` (query, string) Name of Catalog Product Relationship field to sort by. Defaults to Sequence (Catalog Product Relationship > Sequence Number). * `excludeoverridedefinition` (query, boolean) A flag to skip the override definitions for attributes of promotional products. When False (Default) : The promotions will show the overridden values for all attributes. When True (excludeoverridedefinition=true) : The override definitions will be skipped and result will have default attributes. * `offerList` (query, string) offerList takes in a list of offers, seperated by commas, as a input and the getOffers API returns eligible offers from that list. #### Responses * **200** successful operation Media type: `application/json`. Schema: `OffersApiResponse`. * **400** Invalid status value ### GET Get Offer Details `GET /v3/catalogs/{catalogcode}/offers/{offercode}` Operation ID: `getOfferDetails`. Tags: Catalog. Get detailed information about a specific offer (product or promotion). It returns the full hierarchy of a product or promotion as defined in the product catalog. #### Parameters * `catalogcode` (path, string, required) Identifies the catalog of interest to a customer, prospect or partner. This defines the collection of offers to present to the users and sets a default price list and locale(lang). * `offercode` (path, string, required) Identifies an offer of interest. Can be a Product Code or a Promo Code (GET only). (PRODUCTCODE+PROMOCODE and PROMOCODE ie addPromo cannot be supported for v103.) * `contextkey` (query, string) Context key (e.g. 784b264ea6dc63690369e721ffd8e112) which describes the anonymous or known customer's "context" to be used in rule processing. Use if the customer's context key is known. * `context` (query, array of string, collection format: csv) If isloggedin is not present in the API or isloggedin parameter value is false then, Context dimension values in the following format: dimension1:val1,dimension2:val2. Required if the context key or account id are not provided. The key value pairs specify Context Dimension values that describe the anonymous or known customer's "context" to be used in rule processing. If a value for any given context dimension defined in the Vlocity Product Catalog is not provided, the default value specified on the Context Dimension is used to determine eligibility and pricing. if isloggedin is present in the API and isloggedin parameter value is set to true then, this parameter should have, accountId, contractId(optional), rootAssetIds(optional), example format for logged-in user context param : {"accountId":"idvalue", "contractId":"idvalue", "rootAssetIds": \["idvalue"\]} * `forceinvalidatecache` (query, boolean) For debugging purposes, TRUE forces a cache refresh for this key. This parameter only works when a server setting enables forceinvalidatecache to be set from the API. * `isloggedin` (query, boolean) A flag which describes if the user is logged-in or anonymous. If isloggedin flag is true, It indicates present API is used by a logged-in user, then we expect an accountId and a contractId in the context param of the API. If the isloggedin flag is false or if this param is not specified, It indicates present API is used by an anonymous user #### Responses * **200** successful operation Media type: `application/json`. Schema: `OfferDetailsApiResponse`. * **400** Invalid status value ### POST Get Offer Details With Configuration `POST /v3/catalogs/{catalogcode}/offers/{offercode}` Operation ID: `cfgOffer`. Tags: Catalog. Get detailed info about a specific offer. Accepts a configuration of the chosen offer (quantity and attribute values) to enable validation and pricing of that configuration. If the basketKey is passed in the input, it'll honour the rules on the basket items which can affect the offer configuration. ContextKey field is removed from the configureOffer API response. #### Parameters * `catalogcode` (path, string, required) Identifies the catalog of interest to a customer, prospect or partner. This defines the collection of offers to present to the users and sets a default price list and locale(lang). * `offercode` (path, string, required) Identifies an offer of interest. Can be a Product Code or a Promo Code (GET only). (PRODUCTCODE+PROMOCODE and PROMOCODE ie addPromo cannot be supported for v103.) * `contextkey` (query, string) Context key (e.g. 784b264ea6dc63690369e721ffd8e112) which describes the anonymous or known customer's "context" to be used in rule processing. Use if the customer's context key is known. * `context` (query, array of string, collection format: csv) If isloggedin is not present in the API or isloggedin parameter value is false then, Context dimension values in the following format: dimension1:val1,dimension2:val2. Required if the context key or account id are not provided. The key value pairs specify Context Dimension values that describe the anonymous or known customer's "context" to be used in rule processing. If a value for any given context dimension defined in the Vlocity Product Catalog is not provided, the default value specified on the Context Dimension is used to determine eligibility and pricing. if isloggedin is present in the API and isloggedin parameter value is set to true then, this parameter should have, accountId, contractId(optional), rootAssetIds(optional), example format for logged-in user context param : {"accountId":"idvalue", "contractId":"idvalue", "rootAssetIds": \["idvalue"\]} * `isloggedin` (query, boolean) A flag which describes if the user is logged-in or anonymous. If isloggedin flag is true, It indicates present API is used by a logged-in user, then we expect an accountId and a contractId in the context param of the API. If the isloggedin flag is false or if this param is not specified, It indicates present API is used by an anonymous user #### Request body (required) Apply this Product configuration to get the resultant prices. A Promotion configuration is not currently supported. OFFERCODE ADD will be a product for v103. OFFERCODE can be configured to get details but ADD has to happen. If offer is a product this input will specify the details to be added and the promotion context it is to be added in. (productconfiguration will be in the format as #/definitions/productconfiguration) Media type: `application/x-www-form-urlencoded`. Schema: `offerDetails`. #### Responses * **200** successful operation Media type: `application/json`. Schema: `OfferDetailsApiResponse`. * **400** Invalid status value ### POST Preview Offers API `POST /v3/preview/catalogs/{catalogCode}/offers` Operation ID: `previewOffersAPI`. Tags: Catalog. Configures and prices multiple offers in a single API transaction \[Only in Standard DC\] #### Parameters * `catalogCode` (path, string, required) Code of the Catalog #### Request body (required) Media type: `application/json`. Schema: `PreviewOffersInputRequestBody`. #### Responses * **200** Successful operation Media type: `application/json`. Schema: `PreviewOffersOutputResponseBody`. * **400** Bad request Media type: `application/json`. Schema: `PreviewOffersOutputResponseBody`. _Example: application/json_ ``` { "status": { "message": "Catalog not found.", "httpStatus": 400, "code": "400.PreviewOffers.002", "apiStatus": "ERROR" } } ``` * **413** Request too large Media type: `application/json`. Schema: `PreviewOffersOutputResponseBody`. _Example: application/json_ ``` { "status": { "message": "Guardrail Exception : Limit for PreviewOffers API is : 10 offers per API call", "httpStatus": 413, "code": "413.PreviewOffers.413", "apiStatus": "ERROR" } } ``` * **500** Unexpected Server error Media type: `application/json`. Schema: `PreviewOffersOutputResponseBody`. _Example: application/json_ ``` { "status": { "message": "Internal server error: ", "httpStatus": 500, "code": "500.PreviewOffers.001", "apiStatus": "ERROR" } } ``` * **501** Functionality not implemented Media type: `application/json`. Schema: `PreviewOffersOutputResponseBody`. _Example: application/json_ ``` { "status": { "message": "Preview Offers API is supported with Standard DC only. Please enable Standard DC and follow the prerequisites in order to use this API.", "httpStatus": 501, "code": "501.PreviewOffers.001", "apiStatus": "ERROR" } } ``` ### POST Create Basket with basketAction = AddWithNoConfig/AddAfterConfig/AssetToBasket `POST /v3/catalogs/{catalogcode}/basket` Operation ID: `EmptyBasketOps`. Tags: Catalog Basket. Create a basket containing an offer bundle using one of three methods: 1. Pass basketAction = AddWithNoConfig and offer = Offer Code to add the offer without any configured attribute values. 2. Pass basketAction = AddAfterConfig and productConfig = result from Get Offer Details API to add a configured offer. 3. Pass basketAction = AssetToBasket and rootAssetIds = comma-separated set of the root item Ids and requestDateTime = the requested date time that must be future datetime. #### Parameters * `catalogcode` (path, string, required) Identifies the catalog of interest to a customer, prospect or partner. This defines the collection of offers to present to the users and sets a default price list and locale(lang). * `contextkey` (query, string) Context key (e.g. 784b264ea6dc63690369e721ffd8e112) which describes the anonymous or known customer's "context" to be used in rule processing. Use if the customer's context key is known. * `context` (query, array of string, collection format: csv) If isloggedin is not present in the API or isloggedin parameter value is false then, Context dimension values in the following format: dimension1:val1,dimension2:val2. Required if the context key or account id are not provided. The key value pairs specify Context Dimension values that describe the anonymous or known customer's "context" to be used in rule processing. If a value for any given context dimension defined in the Vlocity Product Catalog is not provided, the default value specified on the Context Dimension is used to determine eligibility and pricing. if isloggedin is present in the API and isloggedin parameter value is set to true then, this parameter should have, accountId, contractId(optional), rootAssetIds(optional), example format for logged-in user context param : {"accountId":"idvalue", "contractId":"idvalue", "rootAssetIds": \["idvalue"\]} * `isloggedin` (query, boolean) A flag which describes if the user is logged-in or anonymous. If isloggedin flag is true, It indicates present API is used by a logged-in user, then we expect an accountId and a contractId in the context param of the API. If the isloggedin flag is false or if this param is not specified, It indicates present API is used by an anonymous user * `includeAttachment` (query, boolean) A flag which describes if the basket API should return attachments or not. The default value is false. If includeAttachment is true, the basket API returns the attachments. If the isloggedin flag is false,the basket API doesn't return the attachments. * `returnBasket` (query, boolean) This flag indicates whether to return basket in the AssetToBasket DC API response. The default value is true. So the assettobasket API returns the basket as earlier(backward compatible). If it is set to false, the assettobasket API returns only the basket key, not the complete basket. * `validatebasket` (query, boolean) This flag indicates whether to run the lightweight basket validation for basket and create cart API. The default value is true. So the effectiveness and eligibility of an offer added to a basket and the existing basket are checked. If it is set to false, the lightweight basket validation will not run. * `responseFormat` (query, string) This flag indicates whether the response should be trimmed, leaner or full by taking the values trimResponse, leanerResponse or fullResponse. By default it is set to fullResponse. #### Request body Basket Action post input Media type: `application/x-www-form-urlencoded`. Schema: `APINewBasketInput`. #### Responses * **200** successful operation Media type: `application/json`. Schema: `APIBasketResponse`. * **400** Invalid status value ### GET Get Basket Details `GET /v3/catalogs/{catalogcode}/basket/{basketkey}` Operation ID: `getBasketDetails`. Tags: Catalog Basket. get Details of a basket #### Parameters * `basketkey` (path, string, required) Basket key (e.g. 784b264ea6dc63690369e721ffd8e112). Key identifying the basket. * `catalogcode` (path, string, required) Identifies the catalog of interest to a customer, prospect or partner. This defines the collection of offers to present to the users and sets a default price list and locale(lang). * `contextkey` (query, string) Context key (e.g. 784b264ea6dc63690369e721ffd8e112) which describes the anonymous or known customer's "context" to be used in rule processing. Use if the customer's context key is known. * `context` (query, array of string, collection format: csv) If isloggedin is not present in the API or isloggedin parameter value is false then, Context dimension values in the following format: dimension1:val1,dimension2:val2. Required if the context key or account id are not provided. The key value pairs specify Context Dimension values that describe the anonymous or known customer's "context" to be used in rule processing. If a value for any given context dimension defined in the Vlocity Product Catalog is not provided, the default value specified on the Context Dimension is used to determine eligibility and pricing. if isloggedin is present in the API and isloggedin parameter value is set to true then, this parameter should have, accountId, contractId(optional), rootAssetIds(optional), example format for logged-in user context param : {"accountId":"idvalue", "contractId":"idvalue", "rootAssetIds": \["idvalue"\]} * `validatebasket` (query, boolean) This flag indicates whether to run the lightweight basket validation for basket and create cart API. The default value is true. So the effectiveness and eligibility of an offer added to a basket and the existing basket are checked. If it is set to false, the lightweight basket validation will not run. * `responseFormat` (query, string) This flag indicates whether the response should be trimmed, leaner or full by taking the values trimResponse, leanerResponse or fullResponse. By default it is set to fullResponse. #### Responses * **200** successful operation Media type: `application/json`. Schema: `APIBasketResponse`. * **400** Invalid status value ### PUT Update Basket Items `PUT /v3/catalogs/{catalogcode}/basket/{basketkey}` Operation ID: `updateBasketItems`. Tags: Catalog Basket. update item in Basket(update quantity or attribute) #### Parameters * `basketkey` (path, string, required) Basket key (e.g. 784b264ea6dc63690369e721ffd8e112). Key identifying the basket. * `catalogcode` (path, string, required) Identifies the catalog of interest to a customer, prospect or partner. This defines the collection of offers to present to the users and sets a default price list and locale(lang). * `contextkey` (query, string) Context key (e.g. 784b264ea6dc63690369e721ffd8e112) which describes the anonymous or known customer's "context" to be used in rule processing. Use if the customer's context key is known. * `context` (query, array of string, collection format: csv) If isloggedin is not present in the API or isloggedin parameter value is false then, Context dimension values in the following format: dimension1:val1,dimension2:val2. Required if the context key or account id are not provided. The key value pairs specify Context Dimension values that describe the anonymous or known customer's "context" to be used in rule processing. If a value for any given context dimension defined in the Vlocity Product Catalog is not provided, the default value specified on the Context Dimension is used to determine eligibility and pricing. if isloggedin is present in the API and isloggedin parameter value is set to true then, this parameter should have, accountId, contractId(optional), rootAssetIds(optional), example format for logged-in user context param : {"accountId":"idvalue", "contractId":"idvalue", "rootAssetIds": \["idvalue"\]} * `isloggedin` (query, boolean) A flag which describes if the user is logged-in or anonymous. If isloggedin flag is true, It indicates present API is used by a logged-in user, then we expect an accountId and a contractId in the context param of the API. If the isloggedin flag is false or if this param is not specified, It indicates present API is used by an anonymous user * `includeAttachment` (query, boolean) A flag which describes if the basket API should return attachments or not. The default value is false. If includeAttachment is true, the basket API returns the attachments. If the isloggedin flag is false,the basket API doesn't return the attachments. * `validatebasket` (query, boolean) This flag indicates whether to run the lightweight basket validation for basket and create cart API. The default value is true. So the effectiveness and eligibility of an offer added to a basket and the existing basket are checked. If it is set to false, the lightweight basket validation will not run. * `responseFormat` (query, string) This flag indicates whether the response should be trimmed, leaner or full by taking the values trimResponse, leanerResponse or fullResponse. By default it is set to fullResponse. #### Request body Basket Action post input Media type: `application/json`. Schema: `UpdateBasketInput`. #### Responses * **200** successful operation Media type: `application/json`. Schema: `APIBasketResponse`. * **400** Invalid status value ### POST Modify Basket `POST /v3/catalogs/{catalogcode}/basket/{basketkey}` Operation ID: `BasketOps`. Tags: Catalog Basket. Add/Delete Offers to Basket 1. Pass basketAction = AddWithNoConfig and offer = Offer Code to add the offer without any configured attribute values. 2. Pass basketAction = AddAfterConfig and productConfig = result from Get Offer Details API to add a configured offer. Add/Delete Child products to a basket 1. For AddChildProduct Pass basketAction = AddWithNoConfig bundleContextKey = This represents bundle context key to which child product needs to be added offer = product code which needs to be added parentLineItemKey = This is the key of the parent under which the product needs to be added. In case the parent is a virtual product, the line key of the grand parent should be passed. parentHierarchyPath = This is the product hierarchy path of the parent. 2. For DeleteFromBasket Pass basketAction = DeleteFromBasket bundleContextKey = This represents bundle context key from which child product needs to be deleted lineItemKey = This is the key of the product to be deleted. Delete promotion from a basket 1. For DeleteFromBasket Pass basketAction = DeleteFromBasket offer = promotion code to be deleted appliedAction = Apply/Add/Existing, action of the applied promotion cancellationDate = This represents the cancellation date for promotion in case of MACD order cancellationReason = This represents the reason for cancellation of promo in case of MACD order Delete multiple products from a basket 1. For DeleteFromBasket Pass basketAction = DeleteFromBasket itemsToDelete = This represents the list of bundleContextKey & lineItemKey of the products to be deleted. #### Parameters * `basketkey` (path, string, required) Basket key (e.g. 784b264ea6dc63690369e721ffd8e112). Key identifying the basket. * `catalogcode` (path, string, required) Identifies the catalog of interest to a customer, prospect or partner. This defines the collection of offers to present to the users and sets a default price list and locale(lang). * `contextkey` (query, string) Context key (e.g. 784b264ea6dc63690369e721ffd8e112) which describes the anonymous or known customer's "context" to be used in rule processing. Use if the customer's context key is known. * `context` (query, array of string, collection format: csv) If isloggedin is not present in the API or isloggedin parameter value is false then, Context dimension values in the following format: dimension1:val1,dimension2:val2. Required if the context key or account id are not provided. The key value pairs specify Context Dimension values that describe the anonymous or known customer's "context" to be used in rule processing. If a value for any given context dimension defined in the Vlocity Product Catalog is not provided, the default value specified on the Context Dimension is used to determine eligibility and pricing. if isloggedin is present in the API and isloggedin parameter value is set to true then, this parameter should have, accountId, contractId(optional), rootAssetIds(optional), example format for logged-in user context param : {"accountId":"idvalue", "contractId":"idvalue", "rootAssetIds": \["idvalue"\]} * `isloggedin` (query, boolean) A flag which describes if the user is logged-in or anonymous. If isloggedin flag is true, It indicates present API is used by a logged-in user, then we expect an accountId and a contractId in the context param of the API. If the isloggedin flag is false or if this param is not specified, It indicates present API is used by an anonymous user * `includeAttachment` (query, boolean) A flag which describes if the basket API should return attachments or not. The default value is false. If includeAttachment is true, the basket API returns the attachments. If the isloggedin flag is false,the basket API doesn't return the attachments. * `validatebasket` (query, boolean) This flag indicates whether to run the lightweight basket validation for basket and create cart API. The default value is true. So the effectiveness and eligibility of an offer added to a basket and the existing basket are checked. If it is set to false, the lightweight basket validation will not run. * `responseFormat` (query, string) This flag indicates whether the response should be trimmed, leaner or full by taking the values trimResponse, leanerResponse or fullResponse. By default it is set to fullResponse. #### Request body Basket Action post input Media type: `application/x-www-form-urlencoded`. Schema: `APIExistingBasketInput`. #### Responses * **200** successful operation Media type: `application/json`. Schema: `APIBasketResponse`. * **400** Invalid status value ### POST Create Cart from Basket, Create Quote from Basket `POST /v3/carts` Operation ID: `CreateCartAfterConfigure`. Tags: Cart. Create a cart on Salesforce using a basket of configured items returned from one of the basket APIs. This API adds all the requested items to the cart and configures them. The API will validate & price the cart after bulk adding the items. In this version the API will always create an Order (not a quote or opportunity). It returns the Order Number of the created cart and a link to the /v2 API to retrieve the full cart contents. when Standard Digital Commerce API is enabled, we only support creating cart/quote by passing context key and not jsonResult in the requestBody. The dc\_basket\_fs fieldset is supported for this API. #### Parameters * `context` (query, array of string, collection format: csv) If isloggedin is not present in the API or isloggedin parameter value is false then, Context dimension values in the following format: dimension1:val1,dimension2:val2. Required if the context key or account id are not provided. The key value pairs specify Context Dimension values that describe the anonymous or known customer's "context" to be used in rule processing. If a value for any given context dimension defined in the Vlocity Product Catalog is not provided, the default value specified on the Context Dimension is used to determine eligibility and pricing. if isloggedin is present in the API and isloggedin parameter value is set to true then, this parameter should have, accountId, contractId(optional), rootAssetIds(optional), example format for logged-in user context param : {"accountId":"idvalue", "contractId":"idvalue", "rootAssetIds": \["idvalue"\]} * `isloggedin` (query, boolean) A flag which describes if the user is logged-in or anonymous. If isloggedin flag is true, It indicates present API is used by a logged-in user, then we expect an accountId and a contractId in the context param of the API. If the isloggedin flag is false or if this param is not specified, It indicates present API is used by an anonymous user * `price` (query, boolean) A flag which describes if the pricing should be run in createCart API. If price is true, it runs pricing on the created cart. If price is false, it doesn't run pricing on the created cart. Default value is true. * `validate` (query, boolean) A flag which describes if the validation should be run in createCart API. If validate is true, it runs validation on the created cart. If validate is false, it doesn't run validation on the created cart. Default value is true. * `validatebasket` (query, boolean) This flag indicates whether to run the lightweight basket validation for basket and create cart API. The default value is true. So the effectiveness and eligibility of an offer added to a basket and the existing basket are checked. If it is set to false, the lightweight basket validation will not run. #### Request body A representation of the desired cart, including an array of product configurations which convert to cart items. Media type: `application/x-www-form-urlencoded`. Schema: `object`. * `accountId` (_string_, required) The customer account id (Salesforce Id) for whom to create the cart. * `opportunityId` (_string_, required) Opportunity Id for which Quote needs to be created. Required for Create Quote. * `cartType` (_string_, required) The type of cart. The 'cartType' parameter determines whether an Order or Quote is created. * `catalogCode` (_string_, required) The Catalog Code from which the customer is ordering. This defines the default price list to use for the cart. * `cartContextKey` (_string_, required) the context key of the basket. If we pass this parameter, JSONResult parameter is not required. * `assetReferenceKey` (_string_, required) assetReferenceKey returned in asset to basket. Required for baskets created from asset. Not required for draft baskets. * `JSONResult` (_string_, required) Serialized form of the JSONResult format retrieved from a Basket API. This describes the items and configuration to add to the created cart.(Not required in v105 or higher, recommend to use cartContextKey instead) * `orderFields` (_object_) Optional Order fields API name to value pairs, for updating those fields. Additional properties: `any`. * `orderItemFields` (_array of object_) Optional array of objects containing OrderItem fields API-name to value pairs, for updating those fields. Additional properties: `any`. * `quoteFields` (_object_) Optional quote fields API name to value pairs, for updating those fields. Additional properties: `any`. * `quoteItemFields` (_array of object_) Optional array of objects containing QuoteItem. Additional properties: `any`. #### Responses * **200** successful operation Media type: `application/json`. Schema: `CreateCartResponse`. * **400** Invalid status value ## Schemas ### AppStatusResponse * `status` (_string_) Allowed values: `UP`, `DOWN`. * `details` (_object_) * `health` (_object_) * `status` (_string_) Allowed values: `UP`, `DOWN`. * `details` (_object_) * `app-name` (_string_) Name of the application. * `version` (_string_) Application version. * `build_time` (_string_) Application build time. * `build_info` (_object_) Application build information is displayed. * `commit` (_string_) Deployed commit information. * `buildInfo` (_string_) Has information about user who triggered build. * `branch` (_string_) Deployed branch information. * `date` (_string (date-time)_) Application build time. * `salesforce_last_contact` (_string_) * `app_start_time` (_string (date-time)_) Application start time. * `jks_expire_ms` (_string (date-time)_) jks key application expire information. * `redis` (_object_) * `status` (_string_) redis status Allowed values: `UP`, `DOWN`. * `details` (_object_) * `redis` (_string_) Allowed values: `UP`, `DOWN`. * `hits` (_integer_) Number of successful lookup of keys in the main dictionary. * `misses` (_integer_) Number of failed lookup of keys in the main dictionary. * `evicted` (_integer_) Number of evicted keys due to maximum memory limit. * `expired` (_integer_) Total number of key expiration events. * `hit_ratio` (_number_) Average hit ratio. * `con_active` (_integer_) Number of connection in active. * `con_idle` (_integer_) Number of connection idle in the pool. * `con_wait` (_integer_) Number of threads waiting for the pool. * `redis_pool_size` (_integer_) Redis connection max pool size. ### AppDiagnosticResponse * `app_context` (_object_) * `app_start_time` (_string (date-time)_) Application start time. * `build_info` (_string_) Application build information. * `jks_expire_ms` (_string (date-time)_) JKS key application expire information. * `sf` (_object_) * `authentication` (_object_) * `method` (_string_) Allowed values: `JWT`, `secretkey`. * `status` (_string_) Allowed values: `success`, `failure`. * `useLoginFlow` (_string_) Used for development and is disabled by default in production. Allowed values: `disabled`, `enabled`. * `cmt_access` (_object_) * `root_service_path` (_string_) Salesforce service root path. * `status_api_message` (_string_) * `namespace` (_string_) Connected salesforce org namespace. * `status_api_call` (_string_) Allowed values: `failure`, `success`. * `redis` (_object_) * `set` (_string_) Allowed values: `success`, `failure`. * `get` (_string_) Allowed values: `success`, `failure`. * `cache_partition_key` (_string_) Cache partition key for application. * `expiry` (_string_) redis cache expiry status Allowed values: `success`, `failure`. ### OffersApiResponse * `contextKey` (_string_) * `offers` (_array of Offer_) * `nextOffersAction` (_ApiRestAction_) Next page offers ### OfferDetailsApiResponse * `contextKey` (_string_) Refreshed contextkey * `result` (_offerDetails_) * `errorCode` (_string_) Example: `INVOKE-200`. * `error` (_string_) Example: `OK`. ### offerDetails * `offer` (_OfferDetail_) ### PreviewOffersInputRequestBody Preview Offers API Request Body Representation * `isLoggedIn` (_boolean_) whether operation needs to be run via logged-in flow Default: `false`. * `context` (_object_) User context for operation. For account context, key should be "accountId". For context dimensions, key should be Code of Context Dimension. * `accountId` (_string_) Example: `001xx000003Gl99`. _Example_ ``` { "accountId": "001xx000003Gl99", "Account_SLA": "Gold" } ``` * `offers` (_array of PreviewOffersInputOffer_) Collection of all offers to be previewed Minimum items: 1. Maximum items: 10. ### PreviewOffersOutputResponseBody Preview Offers API Response Body Representation * `status` (_PreviewOffersResponseStatus_, required) * `offers` (_array of PreviewOffersResponseOffer_) Collection of all offers previewed ### APINewBasketInput * `basketAction` (_string_, required) Defines the action to take to create the basket. Options are: * AddWithNoConfig - use when passing Offer Code only \* AddAfterConfig - use when passing productConfig \* AssetToBasket - use when doing a MACD \* DeleteFromBasket - use to delete bundle/lineitem to get a modified basket without the specified bundle/lineitem Allowed values: `AddWithNoConfig`, `AddAfterConfig`, `AssetToBasket`. * `offer` (_string_, required) Required when basketAction = 'AddWithNoConfig', OfferCode to be added or deleted. In case of multi add, the offercodes should be separated by comma. For example- "iphone11" in case of single add, \["iphone11","iphone12"\] in case of multi add. * `productConfig` (_OfferDetailsInput_) OfferDetail of the offer to be added. In case of multi add, the product configs should be separated by comma. For example- {ProductConfig1} in case of single add, \[{ProductConfig1},{ProductConfig2}\] * `requestDateTime` (_string_) Required when basketAction = 'AssetToBasket', requested date-time for the Asset To Basket. The date-time must be in UTC format. It cannot be null or an empty string (""). Additionally, it must be a future date-time relative to the current local time. * `rootAssetIds` (_string_) Required when basketAction = 'AssetToBasket', comma separated list of root asset ids * `canCreateBasket` (_boolean_) Required when basketAction = 'AssetToBasket', performs check whether we can create a basket for the requested date. So you can not create a basket for a previous date (for example 1st July 2020) if there a open order with higher request date (for example 1st August 2020). Default value is false. If it is false, then the above check is not performed. ### APIBasketResponse * `cartContextKey` (_string_) * `assetReferenceKey` (_string_) * `createCartAction` (_ApiRestAction_) Action to create cart. * `result` (_object_) * `totals` (_object_) * `vlocity_cmt__EffectiveOneTimeTotal__c` (_number_) * `vlocity_cmt__EffectiveRecurringTotal__c` (_number_) * `totalSize` (_integer_) * `BasketValidationResult` (_object_) * `isBasketValid` (_boolean_) * `basketValidationMessage` (_string_) * `isOffersEffective` (_boolean_) * `isPricingEffective` (_boolean_) * `IneligibleOffers` (_array of object_) It contains the details of offer for which the eligibility has failed. This will a part of response only if the offers in the basket are ineligible. If the eligibility has failed for anonymous user flow then the value will be an array of offer name that failed eligibility If the eligibility has failed for logged in user flow then the value will be an array of object where each object will be a mapping of offer name and the reason for eligibility fail * `InvalidOffers` (_object_) It contains the details of offer for which the effectivity has failed. This will a part of response only if the offers in the basket are eligible and 1 or more offers has failed the effectivity * `InvalidPLEs` (_array of InvalidPLEs_) * `InvalidProducts` (_array of InvalidProducts_) * `InvalidPromotions` (_array of InvalidPromotions_) * `records` (_array of JSONResultRecord_) ### UpdateBasketInput * `basketAction` (_string_, required) Defines the action to update Basket. Allowed values: `updateBasket`. * `bundleContextKey` (_string_, required) key of the bundle * `lineItemKey` (_string_, required) key of the line item to be updated * `Quantity` (_string_) quantity to be updated, this is required if you are updating the quantity. * `attributeCategories` (_string_) attribute to be updated, this is required if you are updating the attribute. ### APIExistingBasketInput * `basketAction` (_string_, required) Defines the action to take to create the basket. Options are: * AddWithNoConfig - use when passing Offer Code only \* AddAfterConfig - use when passing productConfig \* DeleteFromBasket - use to delete bundle/lineitem to get a modified basket without the specified bundle/lineitem Allowed values: `AddWithNoConfig`, `AddAfterConfig`, `DeleteFromBasket`. * `offer` (_string_, required) Required when basketAction = 'AddWithNoConfig', OfferCode to be added or deleted * `itemsToDelete` (_array of object_) Required when basketAction = 'DeleteFromBasket', with multiple deletions in a single API. * `lineItemKey` (_string_) Key of the basket line item * `bundleContextKey` (_string_) Key of the bundle * `bundleContextKey` (_string_, required) Key of the bundle * `lineItemKey` (_string_) Key of the basket line item * `parentLineItemKey` (_string_, required) Key of the parent line item * `parentHierarchyPath` (_string_, required) Product Hierarchy Path of the parent * `productConfig` (_OfferDetailsInput_) ### CreateCartResponse * `orderNumber` (_string_) Exclusive to Create Cart. Example: `11761`. * `orderId` (_string_) Exclusive to Create Cart. Example: `801f2000000uk6fAAA`. * `quoteId` (_string_) Exclusive to Create Quote. Example: `0Q0xx0000004E4OCAU`. * `errorCode` (_string_) Example: `INVOKE-200`. * `error` (_string_) Example: `OK`. * `action` (_object_) * `CartItems` (_object_) * `rest` (_object_) * `link` (_string_) The assembled URL (minus the [HTTP://hostname](HTTP://hostname)). Example: `/v2/carts/801f2000000uk6fAAA/items`. ### Offer * `offerDetailsAction` (_ApiRestAction_) OfferDetails API contextkey = from previous response * `qualification` (_Qualification_) * `addToCart` (_ApiRestAction_) Basket Action * `offerCode` (_string_) OfferCode is non null if a promo was applied * `offerType` (_string_, required) Allowed values: `product`, `promotion`. * `Name` (_string_, required) * `Description` (_string_) * `ProductCode` (_string (date-time)_) * `AttributeCategory` (_array of AttributeCategoryRecord_) * `priceResult` (_array of PriceResultRecord_) * `products` (_array of Product_) ### ApiRestAction * `params` (_array of object_) * `link` (_string_) * `method` (_string_) Allowed values: `POST`, `GET`, `PUT`, `DELETE`. ### OfferDetail * `addToCart` (_ApiRestAction_) Basket Action * `Name` (_string_, required) * `ProductCode` (_string_) * `Product2Id` (_string_) * `PricebookEntryId` (_string_) * `Quantity` (_string_) * `minQuantity` (_string_) * `maxQuantity` (_string_) * `groupMinQuantity` (_string_) * `groupMaxQuantity` (_string_) * `productHierarchyPath` (_string_) * `lineNumber` (_string_) * `Id` (_string_) * `Description` (_string_) * `vlocity_cmt__SellingStartDate__c` (_string (datetime)_) * `vlocity_cmt__SellingEndDate__c` (_string (datetime)_) * `vlocity_cmt__EndOfLifeDate__c` (_string (datetime)_) * `vlocity_cmt__IsOrderable__c` (_string_) * `IsActive` (_boolean_) * `offerType` (_string_, required) Allowed values: `product`, `promotion`. * `AttributeCategory` (_array of AttributeCategoryRecord_) * `Attachments` (_array of object_) * `contentType` (_string_) Example: `image`. * `defaultAttachment` (_boolean_) Example: `false`. * `description` (_string_) * `displayConditionsData` (_string_) * `mimeType` (_string_) Example: `image/jpeg`. * `sequenceNumber` (_integer_) * `title` (_string_) * `url` (_string_) * `priceResult` (_array of PriceResultRecord_) * `childProducts` (_array of OfferDetail_) ### PreviewOffersInputOffer Offer bundle to be previewed * `offerCode` (_string_, required) ProductCode of root product of the offer bundle Example: `Offer-0012`. * `configurations` (_array of PreviewOffersInputProductConfiguration_) Optional collection of product configurations (default configuration created if not provided) ### PreviewOffersResponseStatus Status of API Response * `message` (_string_) Message for the response status Example: `Successful operation.`. * `httpStatus` (_integer_) HTTP Status Code Example: `200`. * `code` (_PreviewOffersResponseStatusCode_) * `apiStatus` (_string_) Marks whether operation was successful Allowed values: `SUCCESS`, `ERROR`. ### PreviewOffersResponseOffer Offer bundle previewed * `result` (_offerDetails_) ### OfferDetailsInput * `offerDetails` (_object_) * `offer` (_offerDetails_) ### InvalidPLEs Contains the details of invalid Price List Entries(PLE) with invalid fields (1 or more) for offers * `OfferName` (_object_) * `PLECode` (_string_) Example: `Invalid Field1`. ### InvalidProducts Contains the details of invalid products with the invalid fields (1 or more) * `ProductName` (_array of object_) * `SellingStartDate` (_string_) * `SellingEndDate` (_string_) * `EndOfLifeDate` (_string_) * `IsActive` (_boolean_) * `IsOrderable` (_boolean_) ### InvalidPromotions Contains the details of invalid promotions with the invalid fields (1 or more) * `PromotionName` (_array of object_) * `EffectiveStartDate` (_string_) * `EffectiveEndDate` (_string_) * `IsActive` (_boolean_) * `IsOrderable` (_boolean_) ### JSONResultRecord * `actions` (_object_) * `item` (_object_) Action to get details of this offer -> GET /v3/catalogs/{catalogcode}/offers/{offercode}?contextkey={CONTEXTKEY} Doesn't provide all optional parameters such as: - cartContextkey or cartContext = MOST RECENT CARTContext, to be set by caller (NOT returned from backend) because another Add could have happened since this getOffers call, which could've modified cartcontext. - AppliedPromotionCode = NULL * `method` (_string_) HTTP method to use on the URL. If multiple are enabled, comma-delimit them. Allowed values: `GET`, `POST`. Example: `GET,POST`. * `link` (_string_) The assembled URL (minus the [HTTP://hostname](HTTP://hostname)). Example: `/services/apexrest/vlocity_cmt/v3/catalogs/CATALOG_CODE/offers/PRODUCTCODE?contextkey=6a8c75ba46f6bb6d529def9b992571fa`. * `addtocart` (_object_) Action to add this item to the user's cart. API -> POST /v3/carts POST BODY contains - contextkey = from previous response - cartContextkey, cartContext = Most Recent CARTContext, to be set by the caller (NOT returned from the backend). This manual entry ensures that the current Cartcontext remains unchanged during the process. For example, another Add could have occurred in the backend during the getOffers call, altering Cartcontext. * `method` (_string_) HTTP method to use on the URL. If multiple are enabled, comma-delimit them. Allowed values: `POST`. Example: `POST`. * `link` (_string_) The assembled URL (minus the [HTTP://hostname](HTTP://hostname)). Example: `/services/apexrest/vlocity_cmt/v3/carts?contextkey=6a8c75ba46f6bb6d529def9b992571fa`. * `attributeCategories` (_object_) * `records` (_array of AttributeCategoryRecord_) * `lineItemKey` (_string_) * `bundleContextKey` (_string_) * `productGroups` (_object_) * `records` (_array of ProductGroupsResponse_) * `totalSize` (_integer_) * `childProducts` (_object_) * `records` (_array of ChildProductRecord_) * `totalSize` (_integer_) * `lineItems` (_object_) * `records` (_array of JSONResultRecord_) * `totalSize` (_integer_) * `productCategories` (_object_) * `messages` (_integer_) * `totalSize` (_integer_) * `vlocity_cmt__CpqCardinalityMessage__c` (_object_) * `records` (_array of BasketNodeResponse_) * `vlocity_cmt__ParentItemId__c` (_array of BasketNodeResponse_) * `vlocity_cmt__RootItemId__c` (_array of BasketNodeResponse_) * `vlocity_cmt__RecurringTotal__c` (_array of BasketNodeResponse_) * `vlocity_cmt__RecurringCharge__c` (_array of BasketNodeResponse_) * `vlocity_cmt__RecurringCalculatedPrice__c` (_array of BasketNodeResponse_) * `vlocity_cmt__ProductHierarchyPath__c` (_array of BasketNodeResponse_) * `vlocity_cmt__GlobalGroupKey__c` (_string_) * `vlocity_cmt__SequenceNumber__c` (_string_) * `vlocity_cmt__Product2Id__c` (_array of BasketNodeResponse_) * `vlocity_cmt__PricingLogData__c` (_array of BasketNodeResponse_) * `vlocity_cmt__OneTimeTotal__c` (_array of BasketNodeResponse_) * `vlocity_cmt__OneTimeCharge__c` (_array of BasketNodeResponse_) * `vlocity_cmt__OneTimeCalculatedPrice__c` (_array of BasketNodeResponse_) * `vlocity_cmt__LineNumber__c` (_array of BasketNodeResponse_) * `vlocity_cmt__InCartQuantityMap__c` (_array of BasketNodeResponse_) * `vlocity_cmt__EffectiveRecurringTotal__c` (_array of BasketNodeResponse_) * `vlocity_cmt__EffectiveOneTimeTotal__c` (_array of BasketNodeResponse_) * `vlocity_cmt__AssetReferenceId__c` (_array of BasketNodeResponse_) * `vlocity_cmt__Action__c` (_array of BasketNodeResponse_) * `vlocity_cmt__ProductHierarchyGroupKeyPath__c` (_array of BasketNodeResponse_) * `vlocity_cmt__RecurringPrice__c` (_string_) * `Quantity` (_array of BasketNodeResponse_) * `PricebookEntryId` (_array of BasketNodeResponse_) * `UnitPrice` (_array of BasketNodeResponse_) * `ListPrice` (_array of BasketNodeResponse_) * `vlocity_cmt__CpqMessageData__c` (_array of BasketNodeResponse_) * `SellingPeriod` (_string_) * `action` (_string_) * `itemType` (_string_) * `lineNumber` (_string_) * `isVirtualItem` (_boolean_) * `name` (_string_) * `productHierarchyPath` (_string_) * `productChildItemId` (_string_) * `sequenceNumber` (_integer_) * `groupMaxQuantity` (_integer_) * `groupMinQuantity` (_integer_) * `maxQuantity` (_integer_) * `minQuantity` (_integer_) * `defaultQuantity` (_integer_) * `productId` (_string_) * `ProductCode` (_string_) * `Product2Id` (_string_) * `Name` (_string_) * `Pricebook2Id` (_string_) * `displaySequence` (_integer_) * `Product2` (_object_) * `productChildItemDefinition` (_object_) * `pricingLogValue` (_object_) * `PricebookEntry` (_object_) * `messages` (_object_) ### Qualification * `qualificationType` (_string_) Example: `Hard Fail`. * `message` (_string_) Example: `Account Sla is not Gold`. ### AttributeCategoryRecord * `messages` (_Messages_) * `displaySequence` (_integer (int32)_) * `Code__c` (_string_) Example: `NonSubscription`. * `Name` (_string_) Example: `Non Subscription Attributes`. * `id` (_string_) Example: `a0K0E000001m0tGUAQ`. * `productAttributes` (_ProductAttributes_) ### PriceResultRecord * `adjustments` (_array of object_) * `overrides` (_array of object_) * `chargeamount` (_string_) chargeamount is calculated by subtracting the adjustments from baseamount (baseamount- adjustments). * `baseamount` (_string_) This is the baseprice. * `IsVirtualPrice__c` (_string_) This is the IsVirtualPrice\_\_c flag defined on the Price List Entry of this price. * `IsBasePrice__c` (_string_) This is the IsBasePrice\_\_c flag defined on the Price List Entry of this price. * `effectiveuntildatespec` (_string (date-time)_) Specifies how the EffectiveUntilDate value can be calculated based on the Time Plan and Time Policy attached to the Price List Entry of this price. * `effectivefromdatespec` (_string (date-time)_) Specifies how the EffectiveFromDate value can be calculated based on the Time Plan and Time Policy attached to the Price List Entry of this price. * `SubType__c` (_string_) This is the SubType\_\_c defined on the Pricing Variable of the Price List Entry of this price. * `Type__c` (_string_) This is the Type\_\_c defined on the Pricing Variable of the Price List Entry of this price. * `RecurringFrequency__c` (_string_) This is the RecurringFrequency\_\_c defined on the Pricing Variable of the Price List Entry of this price. * `ChargeType__c` (_string_) This is the ChargeType\_\_c defined on the Pricing Variable of the Price List Entry of this price. * `DisplayText__c` (_string_) This is the DisplayText\_\_c defined on the Price List Entry of this price. ### Product * `Name` (_string_) * `Description` (_string_) * `Action:detailAction` (_string_) * `records` (_array of AttributeCategoryRecord_) * `priceResults` (_array of PriceResultRecord_) ### PreviewOffersInputProductConfiguration Collection of all configurations to be made to a specific product in an offer bundle * `productHierarchyPath` (_string_, required) Unique identifier of a product (Can be found in the response GetOfferDetails API, or Preview Offers API without any configurations) Example: `01txx0000006iNQAAY<01txx0000006i8uAAA`. * `fields` (_object_) Key-value pairs of fields to be modified for the specified product. Key is the API Name of the field. If not applicable, it will be ignored silently. _Example_ ``` { "Quantity": 2, "vlocity_cmt__UsageQuantity": 3.5 } ``` * `attributes` (_object_) Key-value pairs of attributes to be modified for the specified product. Key is the Attribute Code. If not applicable, it will be ignored silently. _Example_ ``` { "ATTR-COLOR": "Red", "MemorySize": "4GB" } ``` ### PreviewOffersResponseStatusCode Format of codes - `.PreviewOffers.`: * `200.PreviewOffers.001` - Successful Operation * `400.PreviewOffers.001` - Error due to invalid shape of Request body * `400.PreviewOffers.002` - Catalog Code not found * `400.PreviewOffers.003` - Offer Code absent or blank * `400.PreviewOffers.004` - Product Hierarchy Path absent or blank * `400.PreviewOffers.005` - Duplicate Product Hierarchy Path in the same offer * `400.PreviewOffers.006` - Validation Error * `400.PreviewOffers.007` - Compile job not run * `400.PreviewOffers.008` - Invalid Offer code * `400.PreviewOffers.009` - No offers passed in the input * `400.PreviewOffers.010` - Invalid attribute configuration * `413.PreviewOffers.001` - Guardrails - Too many offers * `500.PreviewOffers.001` - Unexpected Internal Server Error * `501.PreviewOffers.001` - Error while invoking PreviewOffers API with Classic DC Type: `string`. Example: `200.PreviewOffers.001`. ### ProductGroupsResponse * `attributeCategories` (_object_) * `records` (_array of AttributeCategoryRecord_) * `productCategories` (_object_) * `messages` (_integer_) * `totalSize` (_integer_) * `childProducts` (_object_) * `records` (_array of ChildProductRecord_) * `totalSize` (_integer_) * `vlocity_cmt__ParentItemId__c` (_array of BasketNodeResponse_) * `vlocity_cmt__CpqCardinalityMessage__c` (_array of BasketNodeResponse_) * `vlocity_cmt__ProductHierarchyPath__c` (_array of BasketNodeResponse_) * `vlocity_cmt__GlobalGroupKey__c` (_string_) * `vlocity_cmt__SequenceNumber__c` (_string_) * `vlocity_cmt__LineNumber__c` (_array of BasketNodeResponse_) * `vlocity_cmt__AssetReferenceId__c` (_array of BasketNodeResponse_) * `vlocity_cmt__ProductHierarchyGroupKeyPath__c` (_object_) * `records` (_array of LabelValue_) * `vlocity_cmt__RecurringPrice__c` (_string_) * `PricebookEntryId` (_array of BasketNodeResponse_) * `UnitPrice` (_array of BasketNodeResponse_) * `vlocity_cmt__InCartQuantityMap__c` (_object_) * `records` (_array of KeyValue_) * `SellingPeriod` (_string_) * `itemType` (_string_) * `lineNumber` (_string_) * `isVirtualItem` (_boolean_) * `name` (_string_) * `productId` (_string_) * `productHierarchyPath` (_string_) * `productChildItemId` (_string_) * `sequenceNumber` (_integer_) * `groupMaxQuantity` (_integer_) * `groupMinQuantity` (_integer_) * `maxQuantity` (_integer_) * `minQuantity` (_integer_) * `defaultQuantity` (_integer_) * `ProductCode` (_object_) * `records` (_array of LabelValue_) * `Product2Id` (_object_) * `records` (_array of LabelValue_) * `Name` (_object_) * `records` (_array of LabelValue_) * `Pricebook2Id` (_object_) * `records` (_array of LabelValue_) * `displaySequence` (_integer_) * `Product2` (_object_) * `productChildItemDefinition` (_object_) * `PricebookEntry` (_object_) * `messages` (_object_) ### ChildProductRecord * `actions` (_object_) * `item` (_object_) * `method` (_string_) HTTP method to use on the URL. If multiple are enabled, comma-delimit them. Allowed values: `GET`, `POST`. Example: `GET,POST`. * `link` (_string_) The assembled URL (minus the [HTTP://hostname](HTTP://hostname)). Example: `/services/apexrest/vlocity_cmt/v3/catalogs/CATALOG_CODE/offers/PRODUCTCODE?contextkey=6a8c75ba46f6bb6d529def9b992571fa`. * `addtocart` (_object_) Action to add this item to the user's cart. API -> POST /v3/carts POST BODY contains - contextkey = from previous response - cartContextkey, cartContext = MOST RECENT CARTContext, to be set by caller (NOT returned from backend) eg another Add could have happened since this getOffers call, which could've modified cartcontext. * `method` (_string_) HTTP method to use on the URL. If multiple are enabled, comma-delimit them. Allowed values: `POST`. Example: `POST`. * `link` (_string_) The assembled URL (minus the [HTTP://hostname](HTTP://hostname)). Example: `/services/apexrest/vlocity_cmt/v3/carts?contextkey=6a8c75ba46f6bb6d529def9b992571fa`. * `attributeCategories` (_object_) * `records` (_array of AttributeCategoryRecord_) * `productGroups` (_object_) * `records` (_array of ProductGroupsResponse_) * `totalSize` (_integer_) * `childProducts` (_object_) * `records` (_array of ChildProductRecord_) * `totalSize` (_integer_) * `lineItems` (_object_) * `records` (_array of JSONResultRecord_) * `totalSize` (_integer_) * `productCategories` (_object_) * `messages` (_integer_) * `totalSize` (_integer_) * `vlocity_cmt__ProductHierarchyPath__c` (_array of BasketNodeResponse_) * `vlocity_cmt__GlobalGroupKey__c` (_string_) * `vlocity_cmt__SequenceNumber__c` (_string_) * `vlocity_cmt__Product2Id__c` (_array of BasketNodeResponse_) * `vlocity_cmt__LineNumber__c` (_array of BasketNodeResponse_) * `vlocity_cmt__AssetReferenceId__c` (_array of BasketNodeResponse_) * `vlocity_cmt__ProductHierarchyGroupKeyPath__c` (_array of BasketNodeResponse_) * `vlocity_cmt__RecurringPrice__c` (_string_) * `PricebookEntryId` (_array of BasketNodeResponse_) * `UnitPrice` (_array of BasketNodeResponse_) * `SellingPeriod` (_string_) * `itemType` (_string_) * `lineNumber` (_string_) * `isVirtualItem` (_boolean_) * `name` (_string_) * `productHierarchyPath` (_string_) * `productChildItemId` (_string_) * `sequenceNumber` (_integer_) * `groupMaxQuantity` (_integer_) * `groupMinQuantity` (_integer_) * `maxQuantity` (_integer_) * `minQuantity` (_integer_) * `defaultQuantity` (_integer_) * `ProductCode` (_object_) * `records` (_array of LabelValue_) * `Product2Id` (_object_) * `records` (_array of LabelValue_) * `Name` (_object_) * `records` (_array of LabelValue_) * `Pricebook2Id` (_object_) * `records` (_array of LabelValue_) * `displaySequence` (_integer_) * `Product2` (_object_) * `productChildItemDefinition` (_object_) * `PricebookEntry` (_object_) * `messages` (_object_) ### BasketNodeResponse * `actions` (_object_) * `alternateValues` (_string_) * `dataType` (_string_) * `editable` (_boolean_) * `fieldName` (_string_) * `hidden` (_object_) * `label` (_string_) * `messages` (_object_) * `originalValue` (_integer_) * `previousValue` (_integer_) * `value` (_integer_) ### Messages Array of `object`. * `severity` (_string_) * `messageId` (_string_) * `code` (_integer (int32)_, required) * `message` (_string_, required) ### ProductAttributes * `totalSize` (_integer_, read-only) Number of records in the records array. Example: `2`. * `messages` (_Messages_) * `records` (_array of Attribute_) ### LabelValue * `label` (_string_) Example: `name`. * `value` (_string_) Example: `iPhone12Pro`. ### KeyValue * `id` (_string_) Example: `01tx0000000HLDbAAO`. * `value` (_integer_) Example: `1`. ### Attribute * `messages` (_Messages_) * `categorycode__c` (_string_) * `categoryname__c` (_string_) * `code` (_string_) Example: `Frequency`. * `dataType` (_string_) Example: `text`. * `inputType` (_string_) Example: `dropdown`. * `multiselect` (_boolean_) Example: `false`. * `required` (_boolean_) Example: `true`. * `readonly` (_boolean_) Example: `false`. * `disabled` (_boolean_) Example: `false`. * `filterable` (_boolean_) Example: `true`. * `attributeId` (_string_) Example: `a0L0E000001GTMpUAO`. * `label` (_string_) Example: `Frequency`. * `displaySequence` (_integer_) Sequence to display in the UI. Example: `1`. * `hasRules` (_boolean_) Example: `false`. * `hidden` (_boolean_) Example: `false`. * `values` (_array of AttributeValue_) * `userValues` (_string_) Example: `red,blue`. ### AttributeValue * `id` (_string_) Example: `10`. * `name` (_string_) Example: `10`. * `label` (_string_) Example: `Day`. * `readonly` (_boolean_) Example: `false`. * `disabled` (_boolean_) Example: `false`. * `value` (_string_) Example: `10`. * `defaultSelected` (_boolean_) Example: `false`. # Standard Objects Advanced Orders for Telesales uses standard and custom objects to model account-based selling, assortments and locations, inventory movement, product cataloging, and advanced order capture. The objects documented in this guide are grouped by whether they're specific to Advanced Orders or shared with other Salesforce features. For the complete Orders object domain, including the foundational platform and cross-cloud objects that link to their canonical reference, see the [Data Model](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/data-model.md). ## Orders-Specific Objects and APIs The following objects make up the Orders-specific portion of this domain — the assortment/location model, inventory and catalog objects, and the Advanced Orders feature — and aren't documented in a separate external guide. - [AssociatedLocation](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/associated-location.md) - [Assortment](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/assortment.md) - [AssortmentProduct](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/assortment-product.md) - [AssortmentSpec](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/assortment-spec.md) - [Location](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/location.md) - [LocationAssortment](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/location-assortment.md) - [Order](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/order.md) - [OrderItem](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/order-item.md) - [OrderItemSpec](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/order-item-spec.md) - [OrderItemSpecRule](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/order-item-spec-rule.md) - [OrderSpec](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/order-spec.md) - [OrderSpecOrderItemSpec](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/order-spec-order-item-spec.md) - [ProductCatalog](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/product-catalog.md) - [ProductCatalogQual](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/product-catalog-qual.md) - [ProductCategory](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/product-category.md) - [ProductCategoryProduct](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/product-category-product.md) - [ProductInternalOrgUnit](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/product-internal-org-unit.md) - [ProductUnitOfMeasure](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/product-unit-of-measure.md) - [StoreAssortment](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/store-assortment.md) - [UnitofMeasure](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/unit-of-measure.md) ## Other Shared Objects The following objects are shared with other Salesforce Industries features and have no single canonical external reference; their full documentation is provided below. - [AccountFlattenedHierarchy](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/account-flattened-hierarchy.md) - [AccountInternalOrgUnit](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/account-internal-org-unit.md) - [AccountRole](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/account-role.md) - [InternalOrgUnitUser](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/advanced-orders-for-telesales-objects/standard-objects/internal-org-unit-user.md) # Standard Objects Penny Perfect Pricing uses standard and custom objects to store the data that drives advanced (SAP-style) price calculation. The objects documented in this guide are grouped by whether they're specific to the Penny Perfect Pricing engine or shared with other Salesforce features. For the complete Pricing object domain, including the foundational platform and cross-cloud objects that link to their canonical reference, see the [Data Model](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/penny-perfect-pricing-objects/data-model.md). ## Pricing-Specific Objects and APIs The following objects are specific to the Penny Perfect Pricing engine and aren't part of any other Salesforce feature. - [ExternalPricingKeyValTier](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/penny-perfect-pricing-objects/standard-objects/external-pricing-key-val-tier.md) - [ExternalPricingKeyValue](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/penny-perfect-pricing-objects/standard-objects/external-pricing-key-value.md) - [TrdeMobPrcCalcSchm](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/penny-perfect-pricing-objects/standard-objects/trde-mob-prc-calc-schm.md) - [TrdeMobPrcCalcSchmDter](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/penny-perfect-pricing-objects/standard-objects/trde-mob-prc-calc-schm-dter.md) - [TrdeMobPrcCalcSchmStep](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/penny-perfect-pricing-objects/standard-objects/trde-mob-prc-calc-schm-step.md) - [TrdeMobPrcKeyAttribute](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/penny-perfect-pricing-objects/standard-objects/trde-mob-prc-key-attribute.md) - [TrdeMobPrcKeyType](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/penny-perfect-pricing-objects/standard-objects/trde-mob-prc-key-type.md) - [TrdeMobPrcSpec](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/penny-perfect-pricing-objects/standard-objects/trde-mob-prc-spec.md) - [TrdeMobPrcSrchStrategy](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/penny-perfect-pricing-objects/standard-objects/trde-mob-prc-srch-strategy.md) - [TrdeMobPrcSrchStrtgyStp](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/penny-perfect-pricing-objects/standard-objects/trde-mob-prc-srch-strtgy-stp.md) ## Other Shared Objects The following objects are shared with other Salesforce Industries features and have no single canonical external reference; their full documentation is provided below. - [AccountFlattenedHierarchy](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/penny-perfect-pricing-objects/standard-objects/account-flattened-hierarchy.md) - [AccountInternalOrgUnit](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/penny-perfect-pricing-objects/standard-objects/account-internal-org-unit.md) - [AccountRole](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/penny-perfect-pricing-objects/standard-objects/account-role.md) - [InternalOrgUnitUser](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/penny-perfect-pricing-objects/standard-objects/internal-org-unit-user.md) # *StandardObjectName*ChangeEvent A ChangeEvent object is available for each object that supports Change Data Capture. You can subscribe to a stream of change events using Change Data Capture to receive data tied to record changes in Salesforce. Changes include record creation, updates to an existing record, deletion of a record, and undeletion of a record. A change event isn't a Salesforce object—it doesn't support CRUD operations or queries. It's included in the object reference so you can discover which Salesforce objects support change events. The object name is variable and uses StandardObjectNameChangeEvent syntax. For example, AccountChangeEvent represents change events for an account record. For specific version information, see the documentation for the standard object. ## Supported Calls `describeSObjects()` ## Special Access Rules - All objects may not be available in your org. Some objects require specific feature settings and permissions to be enabled. - For more special access rules, if any, see the documentation for the standard object. For example, for AccountChangeEvent, see the special access rules for Account. ## Objects That Support Change Events Change events are available for the following objects: - [AccountFlattenedHierarchy](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/standard-objects/account-flattened-hierarchy.md) - [AccountInternalOrgUnit](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/standard-objects/account-internal-org-unit.md) - [AccountRole](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/standard-objects/account-role.md) - [AssociatedLocation](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/standard-objects/associated-location.md) - [Assortment](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/standard-objects/assortment.md) - [AssortmentProduct](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/standard-objects/assortment-product.md) - [AssortmentSpec](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/standard-objects/assortment-spec.md) - [InternalOrgUnitUser](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/standard-objects/internal-org-unit-user.md) - [Location](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/standard-objects/location.md) - [LocationAssortment](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/standard-objects/location-assortment.md) - [Order](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/standard-objects/order.md) - [OrderItem](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/standard-objects/order-item.md) - [OrderItemSpec](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/standard-objects/order-item-spec.md) - [OrderItemSpecRule](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/standard-objects/order-item-spec-rule.md) - [OrderSpec](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/standard-objects/order-spec.md) - [OrderSpecOrderItemSpec](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/standard-objects/order-spec-order-item-spec.md) - [ProductCatalog](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/standard-objects/product-catalog.md) - [ProductCatalogQual](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/standard-objects/product-catalog-qual.md) - [ProductCategory](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/standard-objects/product-category.md) - [ProductCategoryProduct](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/standard-objects/product-category-product.md) - [ProductInternalOrgUnit](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/standard-objects/product-internal-org-unit.md) - [ProductUnitOfMeasure](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/standard-objects/product-unit-of-measure.md) - [StoreAssortment](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/standard-objects/store-assortment.md) - [UnitofMeasure](https://developer.salesforce.com/docs/industries/advanced-orders-for-telesales/references/standard-objects/unit-of-measure.md) # *StandardObjectName*ChangeEvent A ChangeEvent object is available for each object that supports Change Data Capture. You can subscribe to a stream of change events using Change Data Capture to receive data tied to record changes in Salesforce. Changes include record creation, updates to an existing record, deletion of a record, and undeletion of a record. A change event isn't a Salesforce object—it doesn't support CRUD operations or queries. It's included in the object reference so you can discover which Salesforce objects support change events. The object name is variable and uses StandardObjectNameChangeEvent syntax. For example, AccountChangeEvent represents change events for an account record. For specific version information, see the documentation for the standard object. ## Supported Calls `describeSObjects()` ## Special Access Rules - All objects may not be available in your org. Some objects require specific feature settings and permissions to be enabled. - For more special access rules, if any, see the documentation for the standard object. For example, for AccountChangeEvent, see the special access rules for Account. ## Objects That Support Change Events Change events are available for the following objects: - [AccountFlattenedHierarchy](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/standard-objects/account-flattened-hierarchy.md) - [AccountInternalOrgUnit](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/standard-objects/account-internal-org-unit.md) - [AccountRole](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/standard-objects/account-role.md) - [ExternalPricingKeyValTier](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/standard-objects/external-pricing-key-val-tier.md) - [ExternalPricingKeyValue](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/standard-objects/external-pricing-key-value.md) - [InternalOrgUnitUser](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/standard-objects/internal-org-unit-user.md) - [TrdeMobPrcCalcSchm](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/standard-objects/trde-mob-prc-calc-schm.md) - [TrdeMobPrcCalcSchmDter](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/standard-objects/trde-mob-prc-calc-schm-dter.md) - [TrdeMobPrcCalcSchmStep](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/standard-objects/trde-mob-prc-calc-schm-step.md) - [TrdeMobPrcKeyAttribute](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/standard-objects/trde-mob-prc-key-attribute.md) - [TrdeMobPrcKeyType](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/standard-objects/trde-mob-prc-key-type.md) - [TrdeMobPrcSpec](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/standard-objects/trde-mob-prc-spec.md) - [TrdeMobPrcSrchStrategy](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/standard-objects/trde-mob-prc-srch-strategy.md) - [TrdeMobPrcSrchStrtgyStp](https://developer.salesforce.com/docs/industries/penny-perfect-pricing/references/standard-objects/trde-mob-prc-srch-strtgy-stp.md) # *StandardObjectName*Feed StandardObjectNameFeed is the model for all feed objects associated with standard objects. These objects represent the posts and feed-tracked changes of a standard object. The object name is variable and uses StandardObjectNameFeed syntax. For example, AccountFeed represents the posts and feed-tracked changes on an account record. For specific version information, see the documentation for the standard object. ## Supported Calls `delete()`, `describeSObjects()`, `getDeleted()`, `getUpdated()`, `query()`, `retrieve()` ## Special Access Rules In the internal org, users can delete all feed items they created. This rule varies in Experience Cloud sites where threaded discussions and delete-blocking are enabled. Site members can delete all feed items they created, provided the feed items don't have content nested under them—like a comment, answer, or reply. Where the feed item has nested content, only feed moderators and users with the following permissions can delete threads: - Modify All Data - Modify All Records on the parent object, like Account for AccountFeed - Moderate Chatter **note:** Users with the Moderate Chatter permission can delete only the feed items and comments they can see. Only users with this permission can delete items in unlisted groups. ## Fields ### BestCommentId **Type:** reference **Properties:** Filter, Group, Nillable, Sort **Description:** The ID of the comment marked as best answer on a question post. ### Body **Type:** textarea **Properties:** Nillable, Sort **Description:** The body of the post. Required when Type is `TextPost`. Optional when Type is `ContentPost` or `LinkPost`. ### CommentCount **Type:** int **Properties:** Filter, Group, Sort **Description:** The number of comments associated with this feed item. ### ConnectionId **Type:** reference **Properties:** Filter, Group, Nillable, Sort **Description:** When a PartnerNetworkConnection modifies a record that is tracked, the CreatedBy field contains the ID of the system administrator. The ConnectionId contains the ID of the PartnerNetworkConnection. Available if Salesforce to Salesforce is enabled for your organization. ### InsertedById **Type:** reference **Properties:** Group, Nillable, Sort **Description:** ID of the user who added this item to the feed. For example, if an application migrates posts and comments from another application into a feed, the InsertedBy value is set to the ID of the context user. ### isRichText **Type:** boolean **Properties:** Defaulted on create, Filter, Group, Sort **Description:** Indicates whether the feed item Body contains rich text. If you post a rich text feed comment using SOAP API, set IsRichText to `true` and escape HTML entities from the body. Otherwise, the post is rendered as plain text. Rich text supports the following HTML tags: - `

` - `` - `` - `` - `` - `` - `` - `