Professional Documents
Culture Documents
CME CPQ PDF-en
CME CPQ PDF-en
CME CPQ PDF-en
Copyright 2021 Vlocity LLC, a Salesforce company. All rights reserved. Information in this document is subject to change without
notice. This documentation and the software, tools, templates and other material described in this document (“Vlocity Materials”) are
furnished exclusively under a subscription services agreement or nondisclosure agreement. The Vlocity Materials may be used or
copied only in accordance with the terms of those agreements. No part of the Vlocity Materials may be reproduced, stored in a
retrieval system, or transmitted in any form or any means electronic or mechanical, including photocopying or recording for any
purpose other than the licensee’s personal use as set forth in the applicable agreement without the prior written permission of Vlocity
LLC. Vlocity is a trademark of Vlocity LLC, a Salesforce company, as are other names and marks. Other marks appearing herein may
be trademarks of their respective owners.
CME CPQ
Table of Contents
Vlocity Configure, Price, Quote (CPQ) .......................................................................................... 1
Vlocity CPQ provides extensions to native Salesforce capabilities to support Opportunity, Order, and Quote
processing.
Using asset-based ordering, you can select, price, and configure products, ensuring that the quoted
solution is right for the customer. You can assemble products based on attributes, provide opportunity
forecasting, and enable shopping cart interactions. In addition, CPQ enables you to convert opportunities to
quotes, quotes to orders, orders to assets, assets to orders, and assets to quotes.
Using Interfaces and Implementations, you can selectively use Vlocity components, services, and UI
elements. Through a unified UI, you can access data that is located in Salesforce or external systems. You
can customize the interfaces, replace them, or preserve your existing business logic. You can choose the
implementation that best fits your needs or you can create your own.
Orders are affected by availability, eligibility, compatibility, and pricing rules. Rules link qualifying criteria and
actions. A defined rule applies to an object, such as an opportunity, an order, or a quote. See Rules.
At the point in the order process when Vlocity generates the price quote for a product, bundle, or promotion,
Vlocity runs the availability interface to determine if the item is available at the customer's location. For
example, a customer could be inquiring about high-speed Internet service, but their building may not have
fiber option cabling.
Next, Vlocity runs the eligibility interface to ensure that the customer is eligible to purchase the item. For
example, an existing customer would not be eligible to purchase an item that is available only for new
customers.
Vlocity checks all products for availability and eligibility before displaying them to the customer for product
selection.
You can also configure a Vlocity compatibility or validation interface to enforce purchasing required
products or to recommend additional products on the order. You can define product relationships to relate
products to one another.
After the availability and eligibility interfaces run, Vlocity applies pricing to the entire order using flows.
Flows consist of individual pricing rules applied in sequence, which produces the specified price.
After the items in the order are priced, applicable taxes are calculated and added, and the pricing is saved
to the order. The order is ready to move through the next steps in the order management process.
• Trigger event: Initiates an interaction with the Vlocity Component Object Model (COM) functional stack. A
trigger event can be external or internal and can trigger a Vlocity interface or implementation, or a COM
class directly. Trigger events include:
• CPQ UI widgets
• Vlocity OmniScripts
• Vlocity mobile applications
• Vlocity communities
• Customer self-service websites
• Partner websites
• Custom mobile applications
• Interface/Implementation: A trigger event runs a Vlocity interface, which then calls the active interface
implementation. There may be multiple implementations for one interface, but only one implementation
can be active. See Interfaces, Implementations, and Services.
• Flow: An interface implementation initiates a workflow, which defines a sequence of events, including
rules, process logic, and custom processing options. Flows are based on Salesforce flow features.
Vlocity extends flows to support the flow of objects, such as orders and quotes, providing eligibility,
compatibility, and pricing. Flows also support branching, embedding, and flow actions. Flows are
reusable.
• Flow rule: You can create and implement rules for availability, eligibility, compatibility, and pricing. Build
rules using natural language, so you can remember what the rule does now and six months from now.
• Entity filter: Rules use entity filters to determine which items in the order are subject to the rule action.
Rules can include one or many filters, depending on the business logic the rule implements. Entity filters
are reusable. For example, as part of a promotion, you might create a filter to identify premises where the
service activation date is 45 days or less. Once created, that filter is available for use in any rule that
needs to use it.
• Conditional action: Rule actions define the changes that a rule makes on qualified objects. A rule action
can be an offering procedure, a product relationship, a calculation procedure, or another procedure, such
as a call to Apex code. Different rule types use different rule actions.
Vlocity's order-capture capabilities enable you to manage the order capture flow using Vlocity Cart and an
asset-based ordering system.
Vlocity order-capture capabilities are integral to Vlocity CPQ, which enables you to design and apply
business rules that ensure products and services are:
Customer service representatives and sales teams can perform a variety of business tasks through guided
selling to capture the perfect customer order. The product-service-resource (PSR) data from Vlocity
Enterprise Product Catalog (EPC) supports the Vlocity solution with a shared, central single point of truth
for all PSR data.
Order-Capture Flow
• B2B flow: Starts from a business account by creating an opportunity, a quote, or an order. An opportunity
becomes a quote and a quote becomes an order. When completed, the order becomes an asset. If the
customer wants to change the asset, the asset is moved to an order or a quote. A contract is often
injected after the order is created but before the asset is created, but scenarios vary.
• B2C flow: Starts from a consumer account by creating an order. When completed, the order becomes an
asset. If the customer wants to change the asset, the asset is moved to an order.
Vlocity order capture extends the native capabilities of Salesforce to provide comprehensive management
of the order-capture flow between the following standard Salesforce objects:
• Opportunity represents a sale or pending deal. Order capture uses opportunities for business accounts.
Opportunities include details about the stage of an opportunity cycle—for example, in process or
completed. If an opportunity becomes a quote or an order, information from the opportunity moves
forward. Opportunities are identified by their stage, such as prospecting, identifying decision-makers, or
negotiation/review. Opportunities also include the projected success, in percentages. Order capture fully
integrates opportunities, quotes, and orders to accommodate asset-based ordering.
See Creating an Opportunity.
• Quote represents a record that includes proposed prices for products and services. You can create
quotes from opportunities. You can email quotes as PDF files to customers. Quotes capture additional
information, such as originating source or campaign, installation ZIP code, state, associated purchase
order, and one-time or recurring charges. Order capture integrates opportunities, orders, and quotes to
accommodate asset-based ordering.
See Creating a Quote.
• Order represents an order for products or services associated with an account. Orders consist of header
information followed by line items of individually ordered products or services. Order capture fully
integrates opportunities, orders, and quotes to accommodate asset-based ordering.
See Creating an Order Using Vlocity Cart.
• Asset is a standard Salesforce object that represents an item of commercial value, such as a product or
service sold by your company or a competitor, that an account or contact owns. Order capture provides
extensions to the Asset object support discounts, special pricing, and customer preferences.
See Asset-Based Ordering.
You can modify the appearance and behavior of the cart to customize it according to your specific business
requirements. The Vlocity Cards Framework provides configurable cards, layouts, and templates, which are
UI building blocks included out-of-the-box.
Vlocity Cart is split into two parts: the list and cart panes. The list pane is on the left and the cart pane is on
the right.
There are two tabs on the left side of the cart: the Products and Promotions tabs. A Discounts tab appears
if discounts are defined.
The total bar displays the price totals of the items in the cart. By default, the total bar includes the
recurring total, one-time total, and order total.
NOTE
If a required attribute is missing, an error message appears at the top of the cart. To
fix the error, click the Details icon, which resembles an eye. For more information, see
Configure a Product Using Vlocity Cart.
You can also clone, inspect, and delete products in Vlocity Cart. See Working with Line Items in Vlocity
Cart and Deleting a Line Item From the Cart.
8. When you complete configuring line items, click Submit Order.
If you are using Vlocity CME Winter '20, a message appears that displays the result of the order
submission. The result can be a successful submission or rejection of the order or assetization of the
product based on the response from Order Management.
WARNING
Do not create an order by cloning a previous order. The Clone button in the Salesforce
Classic (Aloha) interface is not intended to work with Vlocity orders and can cause serious
errors.
See Also
• Cancel an In-Flight Order
• Amend In-Flight Orders
To go to Vlocity Cart:
1. On an Order record detail page, click the relevant button: CPQ, Configure, or
ConfigureWithNamespace.
2. To exit Vlocity Cart, click View Record, located in the upper right corner of the cart page.
WARNING
Do not create an order by cloning a previous order. The Clone button in the Salesforce
Classic (Aloha) interface is not intended to work with Vlocity orders and can cause serious
errors.
• Click the vertical ellipsis (three dots) that appears between the list and the cart.
If a required attribute is missing, an error message appears at the top of the cart and the eye icon is
highlighted. To fix the error, click the down arrow for the line item and select Configure. This feature is
called Take Me There. An error message appears at the cart level and at the line item attribute level. There
is one cart-level message per root item ID. That is, at the cart level, there is one error message per bundle.
The cart-level message can call the action getCartsItemsById, which fetches the entire hierarchy of the
root item.
1. Click the down arrow for the line item and select Configure.
The criteria you can configure depend on the line item.
3. Press Enter.
NOTE
A promotion must belong to the same price list as the order to which is it added.
Otherwise, the promotion does not appear in the Vlocity Cart Promotions list.
Just above the Promotions list or Products list are the Qualified and Disqualified tabs. The items that
appear here depend on context rules. Qualified items can be added to the cart and ordered. Disqualified
items cannot be added to the cart for this account.
The prices displayed in the Products list are the base prices for the product, service, or offer.
By default, all promotions are displayed. From the picklist in the left corner, you can select the following
options:
• Expired displays the expired promotions in the cart. Expired promotions have passed their effectivity
dates.
• Canceled displays the canceled promotions.
Click the arrow to the left of an item name to expand it and see its child items.
A blue flag indicates that the item is a draft line item. An orange flag indicates that the item is an asset.
You can click any price to adjust it and see the price details.
On the far right, click the Show Actions button to reveal actions:
• Inspect
• Clone
• Configure
• Delete
For example, a business account may be allowed to purchase up to two Complete TV products, with the
purchase of the product optional. In this case, the underlying Vlocity EPC data model defines the following
cardinality for the Complete TV product:
• Minimum: 0
• Maximum: 2
With this cardinality defined, if you try to specify a quantity of 3, the cart notifies you that you can only add
up to 2 Complete TV products.
1. To the right of the line item to delete, click the Show Actions button.
2. Select Delete.
NOTE
For details about adding pre- and post-processing logic, see Adding Pre- and Post-
Processing Logic.
This mechanism enables customers to override a function of the default JavaScript controller. The function
must meet the following criteria:
Controller Functions
CPQPromotionItemController $scope.beforeAddToCartHook(payload)
$scope.afterAddToCartHook(payload)
CPQPromotionsController $scope.beforeDeletePromotionItemHook(payload)
scope.afterDeletePromotionItemHook(payload);
CPQCartItemController $scope.beforeAddToCartHook(payload)
$scope.afterAddToCartHook(payload);
$scope.beforeDeleteItemFromCartHook(payload)
$scope.afterDeleteItemFromCartHook(payload)
TIP
Using this approach to override functions decreases maintenance and the risk of missing
functionality in future releases. It also decreases maintenance needs.
To override a controller:
CPQOverrideService.addToOverrideList('CPQCartItemController',
overrideFunctions);
}]);
Example
$scope.beforeAddToCartHook = myBeforeAddToCartHookMethod(myHookPayload)
{...logic goes here...};
CPQPromotionItemController:
• $scope.beforeAddToCartHook(payload);
• $scope.afterAddToCartHook(payload);
CPQPromotionsController:
• $scope.beforeDeletePromotionItemHook(payload);
• $scope.afterDeletePromotionItemHook(payload);
CPQProductItemController:
• $scope.beforeAddToCartHook(payload);
• $scope.afterAddToCartHook(payload);
CPQCartItemController:
• $scope.beforeAddToCartHook(payload);
• $scope.afterAddToCartHook(payload);
• $scope.beforeDeleteItemFromCartHook(payload);
• $scope.afterDeleteItemFromCartHook(payload);
• $scope.getAlternativePaymentFieldMapHook(data);
You can modify the appearance and behavior of the cart to customize it according to your specific business
requirements. The Vlocity Cards Framework provides configurable cards, layouts, and templates, which are
UI building blocks included out-of-the-box with the Vlocity Communications managed package.
Layouts can call the Vlocity omnichannel web APIs to retrieve data. Templates and cards display that data.
The cards-based CPQ user interface uses the HybridCPQ Visualforce page, not the typical Console Cards
page.
You can use Assets Visualforce pages to render assets on the Account record detail pages. You can use
the Review Order Cart read-only Visualforce page to render a read-only review cart on the Order record
detail pages. Cards, templates, and layouts control these areas as well.
Vlocity Communications, Media, and Energy uses the following Vlocity Cards, Layouts, and Templates.
NOTE
To implement Vlocity Cards for usage-based pricing for energy, see Enable Usage Pricing.
comp-assets-no-
contract-layout
comp-assets- template Provides space for assets that comp-assets- n/a
contract are listed by contract on the contract-layout
(template) cards-based Assets and
Review Cart Visualforce
pages.
comp-assets- template Renders the banner at the top comp-assets- n/a
header-card of the cards-based Assets and header (card)
(template) Review Cart Visualforce
pages. comp-assets-
header (layout)
comp-assets-no-
contract (card)
comp-assets-no-
contract-layout
comp-assets- layout Provides structure for assets comp-assets-no- Dual
no-contract- that are not associated with contract
layout contracts on the cards-based (template) getAssetsByAccount
Assets and Review Cart
Visualforce pages. comp-assets-
product-item
(card)
comp-assets- card Renders the date picker and comp-assets- Sample
no-contract other items in the header load (template)
(card) portion of the space that
displays the assets in the
cards-based Assets and
Review Cart Visualforce
pages, when assets are not
grouped by contract.
comp-assets- template Provides space for assets that comp-assets-no- n/a
no-contract are not associated with contract-layout
(template) contracts on the cards-based
Assets and Review Cart
Visualforce pages.
comp-assets-
contract-layout
comp-assets- template Provides the space for comp-assets- n/a
product-item products listed by contracts on product-item
(template) the cards-based Assets and (card)
Review Cart Visualforce
pages. comp-assets-
product-item-
child (card)
comp-assets- layout Provides the structure for the comp-assets- None
products space for assets that are not products
(layout) grouped by contract in the (template)
cards-based Assets and
Review Cart Visualforce comp-assets-
pages. contract (card)
comp-assets-no-
contract (card)
comp-assets-no-
contract-layout
comp-assets-no-
contract-layout
comp-assets- card Renders the products on the comp-assets- None
promotions- Promotions tab on the cards- promotions
card based Assets and Review Cart (layout)
Visualforce pages.
comp-assets-
promotions
(template)
cpq-card-blank
(template)
comp-assets- layout Provides the structure for the comp-assets- Dual
promotions Promotions tab on the cards- promotions
(layout) based Assets and Review Cart (template) getAppliedPromotionsByAccount
Visualforce pages.
comp-assets-
promotions-card
comp-assets- template Provides the space for the comp-assets- n/a
promotions Promotions tab on the cards- promotions
(template) based Assets and Review Cart (layout)
Visualforce pages.
comp-assets-
promotions-card
comp-assets- template Contains CSS variables used all assets n/a
theme- in other templates. templates
variables
comp-cart- layout Provides the structure for the comp-cart- None
review-base- Review Cart Visualforce page. review-base-grid
grid (layout) (template)
comp-cart- template Provides the space for the comp-cart- n/a
review-base- Review Cart Visualforce page. review-base-grid
grid (template) (layout)
comp-cart- layout Provides the structure for the comp-cart-review Dual
review (layout) main panel of the Review Cart (template)
Visualforce page. getCartsItems
comp-assets-
product-item
(card)
comp-cart- template Provides the space for the comp-cart-review n/a
review main panel of the Review Cart (layout)
(template) Visualforce page.
cpq-base-grid layout Provides the underlying cpq-base-grid None
(layout) structure for the CPQ interface. (template)
cpq-base-grid template Provides a three-column cart cpq-base-grid n/a
(template) interface with the total bar (layout)
along the bottom of the page.
cpq-base- template Provides the text and buttons cpq-header n/a
header-card and their format for the cart (card)
(template) header.
cpq-product-cart-
item (card)
comp-assets-
product-item
(card)
comp-assets-
promotions-card
comp-assets-
product-item-
child (template)
cpq-product-cart-
item-child (card)
cpq-product-cart-
item-child
(layout)
cpq-product-cart-
item-child
(template)
cpq-product-cart-
item (template)
cpq-cart-item- card Renders the information in the cpq-cart-item- None
detail (card) Line Item Details dialog box. detail (layout)
cpq-product-cart-
item (template)
cpq-cart-item- layout Provides the interface for the cpq-cart-item- getCartsItems
detail (layout) Line Item Details dialog box. details (template)
or cpq-cart-item-details card
cpq-cart-item-
detail (card)
cpq-cart-item- template Provides the structure for the cpq-cart-item- n/a
details cards in the Line Items lookup (layout)
(template) Details dialog box.
cpq-cart-item-
detail (card)
cpq-cart-item- layout Provides the Cart Item cpq-cart-item- getAvailableSites
lookup (layout) Lookup Field dialog box. lookup (template)
cpq-cart-item- template Provides the structure for the cpq-cart-item- n/a
lookup Cart Item Lookup Field dialog lookup (layout)
(template) box.
cpq-cart- card Renders each individual cpq-cart- None
promotions applied promotion in the cart. promotions
(card) (layout)
cpq-card-blank
(template)
cpq-cart- layout Renders the list of applied cpq-cart- Dual
promotions promotions in the cart. promotions
(layout) (template) getPromotionsAppliedToCart
cpq-cart-
promotions (card)
cpq-cart- template Retrieves the list of applied cpq-cart- n/a
promotions promotions in the cart. promotions
(template) (layout)
cpq-header
(layout)
cpq-header layout Provides the header for the cpq-base-header None
(layout) cart. (template)
cpq-header
(card)
cpq-input- template Sample template to show how none n/a
custom- to provide a custom template
template- for a field in the Vlocity Cart
sample information panel.
cpq-left-sidebar layout Displays the sidebar that cpq-left-sidebar None
(layout) contains the Product list and (template)
Promotions list.
cpq-left-sidebar template Provides structure for the cpq-left-sidebar n/a
(template) Product list and Promotions (layout)
list in Vlocity Cart.
cpq-mixin template Generates padding styles for All templates n/a
the product name in a
hierarchy in Vlocity Cart.
cpq-product- card Contains the editable fields cpq-product-cart- None
card-config- that the user can update on the config (template)
card product configuration panel.
cpq-product-cart-
config (layout)
cpq-product- layout Renders the configuration cpq-product-cart- None
cart-config panel in the cart. config (template)
(layout)
cpq-product- template Provides the structure for the cpq-product-cart- n/a
cart-config configuration panel in the cart. config (layout)
(template)
cpq-product- flyout Displays the Price Details cpq-product-cart- None
cart-item-cell- dialog box. item-cell-detail
detail (flyout) (template)
cpq-product- template Provides structure for the Price n/a
cart-item-cell- Details dialog box.
detail
(template)
cpq-product- template Renders the Payment Choice cpq-product-cart- n/a
cart-item-cell- drop-down list for a single line item-cell-
payment- item in Vlocity Cart. payment-choice
choice (template)
(template)
cpq-cart-item-
child-products
card
cpq-product- template Provides the structure for the cpq-product-cart- n/a
cart-item-child child-level product information item-child
(template) in Vlocity Cart. (layout)
OBSOLETE
cpq-product-
cart-item-delete
cpq-product- card Displays each line item in a cpq-product-cart None
cart-item (card) cart. (layout)
cpq-product-cart-
item (template)
cpq-product- template Provides the structure for the cpq-cart-item- n/a
cart-item Line Item Details dialog box. detail (card)
(template)
cpq-product- template Provides the structure for each cpq-product-cart- n/a
cart-item line item in the cart. Display the item (card)
(template) root level product information
in the cart.
cpq-product- layout Provides the structure for the cpq-product-cart getCartsItems
cart (layout) product cart. (template)
cpq-product-cart-
item (card)
cpq-product- template Provides the structure for the cpq-product-cart n/a
cart (template) cart. (layout)
cpq-product- layout Renders custom actions in the cpq-product- Custom
config-custom- CPQ user interface. config-custom-
action action (template)
cpq-product- template Provides a very basic structure cpq-product- n/a
config-custom- on which you can base custom config-custom-
action actions. action layout
(template)
cpq-product- card Displays the details for one cpq-product-item- None
details (card) product in the Product Details more (layout)
dialog box.
cpq-product-item-
details (template)
cpq-product-item
(template)
cpq-product-item-
more (template)
flyout
cpq-product- template Provides the structure for each cpq-product-item n/a
item (template) product in the product list in the (card)
cart.
cpq-product-list layout Renders the product list in the cpq-product-list getCartsProducts
(layout) cart, including the search box (template)
and filter.
cpq-product-item
(card)
cpq-product-list template Provides the structure for the cpq-product-list n/a
(template) product list in the cart. (layout)
cpq-promotion- card Renders each individual cpq-promotions- None
item (card) promotion line item in Vlocity list (layout)
Cart.
cpq-promotion-
item (template)
cpq-promotion- template Provides the structure for an cpq-promotion- n/a
item (template) individual promotion line item item (card)
in Vlocity Cart.
cpq- layout Renders the Promotions list in cpq-promotions- Dual
promotions-list Vlocity Cart. list (template)
(layout) getCartsPromotions
cpq-promotion-
item (card)
cpq- template Provides the structure for the cpq-promotions- n/a
promotions-list Promotions list in Vlocity Cart. list (layout)
(template)
cpq-slds- layout Provides the container for the cpq-slds-prompt n/a
prompt (layout) template to customize prompts (template)
in Vlocity Cart
cpq-total-bar
(layout)
cpq-total-bar layout Renders the total bar in the cpq-total-bar getCarts
(layout) cart. (template)
cpq-total-bar-
card
cpq-total-bar template Provides the structure for the cpq-total-bar n/a
(template) total bar in the cart. (layout)
NOTE
The following templates, layouts, and card were deleted from Vlocity Communications,
Media, and Energy Summer '17:
Figure 3. Vlocity Cart with Product List and Product Line Items
1. Click for product details. Opens the Product Details dialog box, which uses the cpq-product-details
card, cpq-product-item-more layout, and cpq-product-item-details template.
2. Click to display or hide the Products or Promotions list.
3. Click for line item details for the root item. Opens the Line Item Details dialog box.
4. Click to open the configuration panel.
5. Products and Promotions lists, cpq-left-sidebar template and cpq-left-sidebar layout
6. Child line items in Vlocity Cart, cpq-product-cart-item-child layout, cpq-product-cart-item-child template,
and cpq-product-cart-item-child card
NOTE
Configure the card to determine which details are displayed.
1. comp-assets-header
2. comp-assets-products
3. comp-assets-contract
4. comp-assets-product-item
5. comp-assets-product-item-child
6. comp-assets-product-children
7. comp-assets-base-grid
8. comp-assets-contract
9. comp-assets-header
comp-assets-base-grid (template)
The comp-assets-base-grid template provides a space for the Assets and Review Cart cards-based
Visualforce pages.
Template Type
Containers
Code
HTML, CSS/SCSS
Image
See Also
• Learning About Asset-Based Ordering Visualforce Pages
comp-assets-contract (template)
The comp-assets-contract template provides the space for assets that are listed by contract on the cards-
based Assets and Review Cart Visualforce pages. For more information about these pages, see Learning
About Asset-Based Ordering Visualforce Pages.
Template Type
Cards
Code
HTML
Image
comp-assets-contract-layout
The comp-assets-contract layout provides the structure for assets that are listed by contract on the cards-
based Assets and Review Cart Visualforce pages. For more information about these pages, see Learning
About Asset-Based Ordering Visualforce Pages.
Template
comp-assets-contract (template)
Data Source
Dual
Remote Class
CpqAppHandler
Remote Method
getAssetsByContract
Input map
Input Map Variable Value
contractId {{parent.Id.value}}
GET /services/apexrest/vlocity_cmt/v2/contracts/{{parent.Id.value}}/assets?
Cards
comp-assets-product-item (card)
Image
comp-assets-contract-load (template)
The comp-assets-contract-load template groups assets by contract IDs.
Template Type
Cards
Code
HTML
Image
None
comp-assets-header (card)
The comp-assets-header card, with the comp-assets-header-card template, renders the banner at the top
of the cards-based Assets and Review Cart Visualforce pages. For more information about these pages,
see Learning About Asset-Based Ordering Visualforce Pages.
Title
comp-assets-header
Filter
None
Data Source
No source/layout
States
Active Account
Template
comp-assets-header-card (template)
Actions
None
Flyout
None
Conditions
None
Image
comp-assets-header (layout)
The comp-assets-header layout provides the structure for the top of the cards-based Assets and Review
Cart Visualforce pages. For more information about these pages, see Learning About Asset-Based
Ordering Visualforce Pages.
Template
comp-assets-header (template)
Data Source
Dual
Remote Class
CpqAppHandler
Remote Method
getAccounts
Input map
Input Map Variable Value
id {{attrs.accountId}}
GET /services/apexrest/vlocity_cmt/v2/accounts/{{attrs.accountId}}
Cards
comp-assets-header (card)
Image
comp-assets-header (template)
The comp-assets-header template provides the space for the banner in the cards-based Assets and
Review Cart Visualforce pages. For more information about these pages, see Learning About Asset-Based
Ordering Visualforce Pages.
Template Type
Containers
Code
HTML
Image
None
comp-assets-header-card (template)
The comp-assets-header-card template renders the top of the cards-based Assets and Review Cart
Visualforce pages. For more information about these pages, see Learning About Asset-Based Ordering
Visualforce Pages.
Template Type
Cards
Code
HTML, CSS/SCSS
Image
comp-assets-info-panel (layout)
The comp-assets-info-panel layout provides the structure for the info panel in the cards-based Assets and
Review Cart Visualforce pages. For more information about these Visualforce pages, see Learning About
Asset-Based Ordering Visualforce Pages
Template
comp-assets-info-panel (template)
Data Source
None
Cards
Empty
Image
comp-assets-info-panel (template)
The comp-assets-info-panel template renders the information panel in the cards-based Assets and Review
Cart Visualforce pages. For more information about these Visualforce pages, see Learning About Asset-
Based Ordering Visualforce Pages.
The comp-assets-info-panel template provides multi-language support translation for Attribute Category
Name, Attribute Name, and Attribute Value for attribute types.
Template Type
Containers
Code
HTML, CSS/SCSS
Image
Upgrade from Vlocity CME Winter '18 to Vlocity CME Summer '18
When upgrading from Vlocity Communications, Media, and Energy Winter '18 to Vlocity Communications,
Media, and Energy Summer '18, you must make the following changes to the HTML in the Card Designer.
First Change
In CME Winter '18, keep the following:
<h3>{{attributeObj.Name}}</h3>
In CME Summer '18, replace the HTML above with the following HTML to use translation features:
<h3 cpq-translate="AttributeCategory.Name">{{attributeObj.Name}}</h3>
Second Change
In CME Winter '18, keep the following:
In CME Summer '18, replace the above HTML with the following HTML to use translation features:
Third Change
In CME Winter '18, keep the following:
In CME Summer '18, replace the above HTML with the following HTML to use translation features:
Fourth Change
In CME Winter '18, keep the following:
In CME Summer '18, replace the above HTML with the following HTML to use translation features:
Fifth Change
In CME Winter '18, keep the following:
In CME Summer '18, replace the above HTML with the following HTML to use translation features:
Sixth Change
In CME Winter '18, keep the following:
In CME Summer '18, replace the above HTML with the following HTML to use translation features:
Seventh Change
In CME Winter '18, keep the following:
In CME Summer '18, replace the above HTML with the following HTML to use translation features:
comp-assets-load (template)
The comp-assets-load template renders the space for assets that are not grouped by contract in the cards-
based Assets and Review Cart Visualforce pages. For more information about these Visualforce pages,
see Learning About Asset-Based Ordering Visualforce Pages
Template Type
Cards
Code
HTML
Image
comp-assets-no-contract (card)
The comp-assets-no-contract card renders the date picker and other items in the header portion of the
space that displays the assets on the cards-based Assets and Review Cart Visualforce pages, when the
assets are not grouped by contract. For more information about these pages, see Learning About Asset-
Based Ordering Visualforce Pages.
Title
No Contract Assets
Filter
None
Data Source
Sample
Remote Class
None
Remote Method
None
States
No Contract Assets
Template
comp-assets-load (template)
Actions
None
Flyout
comp-assets-no-contract-layout
Conditions
None
Image
comp-assets-no-contract-layout
The comp-assets-no-contract-layout provides structure for assets that aren't associated with contracts on
the cards-based Assets and Review Cart Visualforce pages.
Template
comp-assets-no-contract
Data Source
Dual
Remote Class
CpqAppHandler
Remote Method
getAssetsByAccount
Input map
Input Map Variable V
accountId {{attrs.accountId}}
GET /services/apexrest/vlocity_cmt/v2/accounts/{{attrs.accountId}}/assets?
includes={{attrs.assetIncludeType}}&effectiveAssetsDateFilter={{attrs.effective
Date}}&priceDetailsFields=vlocity_cmt__OneTimeCharge__c,vlocity_cmt__OneTimeCal
culatedPrice__c,vlocity_cmt__OneTimeTotal__c,vlocity_cmt__RecurringCharge__c,vl
ocity_cmt__RecurringCalculatedPrice__c,vlocity_cmt__RecurringTotal__c&pagesize=
10
Cards
comp-assets-product-item (card)
Image
See Also
• Learning About Asset-Based Ordering Visualforce Pages
comp-assets-base-grid (layout)
The comp-assets-base-grid layout provides the underlying structure for the Assets and Review Cart cards-
based Visualforce pages.
Template
comp-assets-base-grid (template)
Data Source
No source
Cards
None
Image
See Also
• Learning About Asset-Based Ordering Visualforce Pages
comp-assets-product-children (layout)
The comp-assets-product-children layout provides the structure for each child product item on the cards-
based Assets and Review Cart Visualforce pages. For more information about these Visualforce pages,
see Learning About Asset-Based Ordering Visualforce Pages.
Template
comp-assets-product-children (template)
Data Source
Parent
Cards
comp-assets-product-item-child (card)
Image
None
comp-assets-product-children (template)
The comp-assets-product-children template provides the space for each child product item on the cards-
based Assets and Review Cart Visualforce pages. For more information about these Visualforce pages,
see Learning About Asset-Based Ordering Visualforce Pages.
Template Type
Containers
Code
HTML
Image
None
comp-assets-product-item (card)
comp-assets-product-item (card)
comp-cart-review-product-item (card)
The comp-assets-product-item card renders the space for products listed by contracts on the cards-based
Assets and Review Cart Visualforce pages. For more information about these Visualforce pages, see
Learning About Asset-Based Ordering Visualforce Pages.
In Vlocity Communications, Media, and Energy Summer '18, the comp-assets-product-item card has been
renamed comp-cart-review-product-item.
Title
Asset Product Item
Filter
None
Data Source
No source/layout
States
Templates
• comp-assets-product-item (template)
• cpq-card-blank (template)
Actions
None
Flyout
None
Conditions
None
Image
comp-assets-product-item (template)
The comp-assets-product-item template provides the space for products listed by contracts on the cards-
based Assets and Review Cart Visualforce pages. For more information about these Visualforce pages,
see Learning About Asset-Based Ordering Visualforce Pages.
In Vlocity Communications, Media, and Energy Summer '18, comp-assets-product-item has been changed
to provide multi-language support to translate Product Name and Promotion Name.
Template Type
Cards
Code
HTML, CSS/SCSS
Image
Upgrade from Vlocity CME Winter '18 to Vlocity CME Summer '18
When upgrading from Vlocity Communications, Media, and Energy Winter '18 to Vlocity Communications,
Media, and Energy Summer '18, you must make the following changes to the HTML in the Card Designer.
First Change
<button ng-click="childProdState.show = !childProdState.show" class="slds-
button assets-item-has-children" aria-controls="tree0-node1" ng-hide="!
(obj.childAssets.records || obj.lineItems.records ||
obj.productGroups.records)">
<slds-button-svg-icon sprite="'utility'" size="'small'" icon="'switch'"
extra-classes="'slds-button__icon_left slds-float_left'" ng-class="{'assets-
fix-slds-close-switch' : !childProdState.show}"></slds-button-svg-icon>
<span class="slds-assistive-text">Toggle</span>
<span class="assets-product-name" cpq-
translate="Product2.Name">{{obj[customField.fieldName]}}</span>
</button>
<button ng-click="childProdState.show = !childProdState.show" class="slds-
button assets-item-has-children" aria-controls="tree0-node1" ng-hide="!
(obj.childAssets.records || obj.lineItems.records ||
obj.productGroups.records)">
<slds-button-svg-icon sprite="'utility'" size="'small'" icon="'switch'"
extra-classes="'slds-button__icon_left'" ng-class="{'assets-fix-slds-close-
switch' : !childProdState.show}"></slds-button-svg-icon>
<span class="slds-assistive-text">Toggle</span>
<span class="assets-product-name">{{obj[customField.fieldName]}}</span>
</button>
Second Change
<span class="assets-item-no-children" ng-show="!(obj.childAssets.records ||
obj.lineItems.records || obj.productGroups.records)">
{{ obj[customField.fieldName]}}
</span>
<span class="assets-item-no-children" ng-show="!(obj.childAssets.records ||
obj.lineItems.records || obj.productGroups.records)" cpq-
translate="Product2.Name">
{{ obj[customField.fieldName]}}
</span>
Third Change
{{promoItem.Name}}{{$last ? '' : ', '}}
<span cpq-translate=""Promotion.Name"">{{promoItem.Name}}</span>
{{$last ? '' : ', '}}
comp-assets-product-item-child (card)
The comp-assets-product-item-child card renders each child product on the cards-based Assets and
Review Cart Visualforce pages. For more information about these Visualforce pages, see Learning About
Asset-Based Ordering Visualforce Pages.
Title
Assets Product Children Item
Filter
None
Data Source
None
States
Assets Product Children Item
Template
comp-assets-product-item-child
Actions
None
Flyout
None
Conditions
None
Image
comp-assets-product-item-child (template)
The comp-assets-product-item-child template displays the details of the child element in an asset bundle in
the cards-based Assets and Review Cart Visualforce pages. For more information about these Visualforce
pages, see Learning About Asset-Based Ordering Visualforce Pages.
In Vlocity Communications, Media, and Energy Summer '18, comp-assets-product-item child has been
changed to provide multi-language support to translate Product Name and Promotion Name.In addition,
only part of the template appears if a line item is inside a product group.
Template Type
Cards
Code
HTML, CSS/SCSS
Image
Upgrade from Vlocity CME Winter '18 to Vlocity CME Summer '18
When upgrading from Vlocity Communications, Media, and Energy Winter '18 to Vlocity Communications,
Media, and Energy Summer '18, you must make the following changes to the HTML in the Card Designer.
First Change
In CME Winter '18, keep the following:
<div class="slds-is-relative">
In CME Summer '18, replace the HTML above with the following HTML:
Second Change
In CME Winter '18, keep the following:
In CME Summer '18, replace the above HTML with the following HTML:
Third Change
In CME Winter '18, keep the following:
<span class="assets-product-name">
In CME Summer '18, replace the above HTML with the following HTML:
Fourth Change
In CME Summer '18, add the following HTML:
Fifth Change
In CME Winter '18, keep the following:
In CME Summer '18, replace the above HTML with the following HTML:
Sixth Change
In Winter '18, keep the following:
In CME Summer '18, replace the above HTML with the following HTML:
comp-assets-products (layout)
The comp-assets-products layout provides the structure for the space for assets that are in the cards-based
Assets and Review Cart Visualforce pages. For more information about these pages, see Learning About
Asset-Based Ordering Visualforce Pages
Template
comp-assets-products (template)
Data Source
None
Cards
• comp-assets-contract (card)
• comp-assets-no-contract (card)
Image
comp-assets-products (template)
The comp-assets-products template renders the For more information about these Visualforce pages, see
Learning About Asset-Based Ordering Visualforce Pages.
In Vlocity Communications, Media, and Energy Summer '18, the comp-assets-products template was
modified.
• changeCustomView() now takes a second parameter, tabChanged, which clears selected assets
when a tab changes.
• Removed rootScope to use importedScope to store indicators when changeToQuote,
changeToOrder, and moveAssets buttons are enabled.
Template Type
Containers
Code
HTML, CSS/SCSS
Image
Upgrade from Vlocity CME Winter '18 to Vlocity CME Summer '18
When upgrading from Vlocity Communications, Media, and Energy Winter '18 to Vlocity Communications,
Media, and Energy Summer '18, you must make the following change to the HTML in the Card Designer.
First Change
In CME Winter '18, keep the following:
In CME Summer '18, replace the HTML above with the following HTML:
Second Change
In CME Winter '18, keep the following:
In CME Summer '18, replace the above HTML with the following HTML:
Third Change
In CME Winter '18, keep the following:
In CME Summer '18, replace the above HTML with the following HTML:
Fourth Change
In CME Winter '18, keep the following:
In CME Summer '18, replace the above HTML with the following HTML:
Fifth Change
In CME Winter '18, keep the following:
In CME Summer '18, replace the above HTML with the following HTML:
Sixth Change
In CME Winter '18, keep the following:
In CME Summer '18, replace the above HTML with the following HTML:
comp-assets-promotions (layout)
The comp-assets-promotions layout provides the structure for the Promotions tab on the cards-based
Assets and Review Cart Visualforce pages. For more information about these Visualforce pages, see
Learning About Asset-Based Ordering Visualforce Pages.
Template
comp-assets-promotions (template)
Data Source
Dual
Remote Class
CpqAppHandler
Remote Method
getAppliedPromotionsByAccount
Input map
Input Map Variable Value
accountId {{attrs.accountId}}
GET /services/apexrest/vlocity_cmt/v2/accounts/{{attrs.accountId}}/promotions
Cards
comp-assets-promotions-card
Image
comp-assets-promotions (template)
The comp-assets-promotions template provides the space for the Promotions tab on the cards-based
Assets and Review Cart Visualforce pages. For more information about these Visualforce pages, see
Learning About Asset-Based Ordering Visualforce Pages.
In Vlocity Communications, Media, and Energy Summer '18, comp-assets-promotions has been changed to
provide multi-language support to translate Promotion Name.
Template Type
Containers
Code
HTML, CSS/SCSS
Image
Upgrade from Vlocity CME Winter '18 to Vlocity CME Summer '18
When upgrading from Vlocity Communications, Media, and Energy Winter '18 to Vlocity Communications,
Media, and Energy Summer '18, you must make the following changes to the HTML in the Card Designer.
comp-assets-promotions-card
The comp-assets-promotions-card Renders the products on the Promotions tab on the cards-based
Assets and Review Cart Visualforce pages. For more information about these Visualforce pages, see
Learning About Asset-Based Ordering Visualforce Pages.
Title
Assets Applied Promotion Card
Filter
None
Data Source
None
path
States
CustomView_Basic
Template
cpq-card-blank (template)
Actions
None
Flyout
None
Conditions
None
Image
comp-assets-theme-variables (template)
The comp-assets-theme-variables template contains CSS variables that are used in other templates for the
Assets and Review Cart Visualforce pages. For more information about these Visualforce pages, see
Learning About Asset-Based Ordering Visualforce Pages.
Template Type
Mixin
Code
CSS/SCSS
Image
n/a
/***
***** ASSETS THEME VARIABLES ****
Add only the theme file here. Don't add any code here.
It's easier to swap the theme here rather than swapping in every other
template.
If you swap the theme here, all templates will automatically get the latest.
NOTE
Note: You need to re save all the templates once you change the
theme. Also, if you change theme files, refresh the browser and
then save the templates.
***/
@import "cpq-base-theme-variables";
comp-cart-review (layout)
The comp-cart-review layout provides the structure for the main panel of the Review Cart Visualforce page.
For more information about these Visualforce pages, see Learning About Asset-Based Ordering Visualforce
Pages.
In Vlocity Communications, Media, and Energy Summer '18, comp-cart-review has been changed. The
comp-assets-product-item card has been renamed comp-cart-review-product-item.
Template
comp-cart-review (template)
Data Source
Dual
Remote Class
CpqAppHandler
Remote Method
getCartsItems
Input map
Input Map
Variable
cartId {{attrs.cartId}}
fields vlocity_cmt__BillingAccountId__c,vlocity_cmt__ServiceAccountId__c,Quantity,vlocity_cmt__RecurringTotal__c,vlocity_cmt__OneTimeTota
pagesize 10
priceDetailsFields vlocity_cmt__OneTimeCharge__c,vlocity_cmt__OneTimeCalculatedPrice__c,vlocity_cmt__OneTimeTotal__c,vlocity_cmt__RecurringCha
validate false
GET /services/apexrest/vlocity_cmt/v2/cpq/carts/{{attrs.cartId}}/items?
pagesize=10&price=false&validate=false&fields=vlocity_cmt__BillingAccountId__c,
vlocity_cmt__ServiceAccountId__c,Quantity,vlocity_cmt__RecurringTotal__c,vlocit
y_cmt__OneTimeTotal__c,vlocity_cmt__OneTimeManualDiscount__c,vlocity_cmt__Recur
ringManualDiscount__c,vlocity_cmt__ProvisioningStatus__c,vlocity_cmt__Recurring
Charge__c,vlocity_cmt__OneTimeCharge__c,ListPrice,vlocity_cmt__ParentItemId__c,
vlocity_cmt__BillingAccountId__r.Name,vlocity_cmt__ServiceAccountId__r.Name,vlo
city_cmt__PremisesId__r.Name,vlocity_cmt__InCartQuantityMap__c&priceDetailsFiel
ds=vlocity_cmt__OneTimeCharge__c,vlocity_cmt__OneTimeCalculatedPrice__c,vlocity
_cmt__OneTimeTotal__c,vlocity_cmt__RecurringCharge__c,vlocity_cmt__RecurringCal
culatedPrice__c,vlocity_cmt__RecurringTotal__c
Cards
comp-assets-product-item (card)
comp-cart-review-product-item (card)
Image
comp-cart-review (template)
The comp-cart-review template provides the space for the main panel of the Review Cart Visualforce page.
For more information about these Visualforce pages, see Learning About Asset-Based Ordering Visualforce
Pages.
Template Type
Containers
Code
HTML, CSS/SCSS
Image
comp-assets-no-contract (template)
The comp-assets-no-contract template provides space for assets that are not associated with contracts on
the cards-based Assets and Review Cart Visualforce pages.
In Vlocity Communications, Media, and Energy Summer '18, the comp-assets-no-contract template was
modified to show assets only after the data source has loaded.
Template Type
Cards
Code
HTML
Image
None
Upgrade from Vlocity CME Winter '18 to Vlocity CME Summer '18
When upgrading from Vlocity Communications, Media, and Energy Winter '18 to Vlocity Communications,
Media, and Energy Summer '18, you must make the following change to the HTML in the Card Designer.
In CME Summer '18, replace the above HTML with the following HTML to use translation features:
See Also
• Learning About Asset-Based Ordering Visualforce Pages
comp-cart-review-base-grid (layout)
The comp-cart-review-base-grid layout provides the structure for the Review Cart Visualforce page. For
more information about these Visualforce pages, see Learning About Asset-Based Ordering Visualforce
Pages.
Template
comp-cart-review-base-grid (template)
Data Source
None
Cards
None
Image
comp-cart-review-base-grid (template)
The comp-cart-review-base-grid template provides the space for the Review Cart Visualforce page. For
more information about these Visualforce pages, see Learning About Asset-Based Ordering Visualforce
Pages.
Template Type
Containers
Code
HTML, CSS/SCSS
Image
cpq-base-grid (layout)
The cpq-base-grid layout provides the underlying structure for the CPQ interface. The template provides a
three-column interface with the header bar at the top of the page and a total bar at the bottom of the page.
Template
cpq-base-grid (template)
Data Source
None
Cards
Empty
Image
cpq-base-grid (template)
The cpq-base-grid template provides a three-column cart interface with the header bar at the top of the
page and the total bar at the bottom of the page.
In Vlocity Communications, Media, and Energy Summer '18, cpq-base-grid has its own controller,
CPQHeaderController.
Template Type
Containers
Code
HTML, CSS/SCSS
Image
Upgrade from Vlocity CME Winter '18 to Vlocity CME Summer '18
When upgrading from Vlocity Communications, Media, and Energy Winter '18 to Vlocity Communications,
Media, and Energy Summer '18, you must make the following change to the HTML in the Card Designer.
cpq-base-header (template)
The cpq-base-header template provides the structure of the cart header.
In Vlocity Communications, Media, and Energy Summer '18, cpq-base-header passes the
CPQHeaderController to the card.
Template Type
Containers
Code
HTML
Image
Upgrade from Vlocity CME Winter '18 to Vlocity CME Summer '18
When upgrading from Vlocity Communications, Media, and Energy Winter '18 to Vlocity Communications,
Media, and Energy Summer '18, you must make the following change to the HTML in the Card Designer.
cpq-base-header-card (template)
The cpq-base-header-card template provides the structure for the cart header.
In Vlocity Communications, Media, and Energy Summer '18, cpq-base-header-card includes the following
changes:
• Replaced using the native field Order.status with the custom field OrderStatus__c.
• Created the Cancel Order button. It is enabled only when an order has a prevalidate action.
• Displays the batch Cancel Order Locked when IsChangesAllowed__c is false when the order reaches
the point of no return.
• Created class for batch Cancel Order Locked in SCSS.
Template Type
Cards
Code
HTML, CSS/SCSS
Image
Upgrade from Vlocity CME Winter '18 to Vlocity CME Summer '18
When upgrading from Vlocity Communications, Media, and Energy Winter '18 to Vlocity Communications,
Media, and Energy Summer '18, you must make the following change to the HTML in the Card Designer.
First Change
{{::obj.Status}}
{{::obj.OrderStatus__c | uppercase}}
Second Change
In CME Summer '18, add the following new code:
Third Change
<button cpq-dropdown-handler="isOpen = false" class="slds-button slds-
button_icon-border-filled" aria-haspopup="true" ng-click="isOpen = !isOpen"
id="{{idPrefix}}-toggle" title="Show More">
<slds-button-svg-icon size="type === 'button-group' ? null : 'small'"
sprite="'utility'" icon="'down'"></slds-button-svg-icon>
<span class="slds-assistive-text">Show More</span>
</button>
<button cpq-dropdown-handler="isOpen = false" class="slds-button slds-
button_icon-border-filled" aria-haspopup="true" ng-click="isOpen = !
isOpen" id="{{idPrefix}}-toggle"
title="{{::importedScope.customLabels.CPQShowMore}}">
<slds-button-svg-icon size="type === 'button-group' ? null : 'small'"
sprite="'utility'" icon="'down'"></slds-button-svg-icon>
<span class="slds-assistive-
text">{{::importedScope.customLabels.CPQShowMore}}</span>
</button>
Fourth Change
In CME Summer '18, add the following :
.#{$namespace}-base-header-badge {
padding: 5px 15px;
margin: auto;
margin-right: 5px;
} "
cpq-base-header-payment-choice (layout)
The cpq-base-header-payment-choice layout calls the getListsOfValues API to provide the user payment
choices in Vlocity Cart.
Template
cpq-base-header-payment-choice (template)
Data Source
Dual
Remote Class
CpqAppHandler
Remote Method
getListsOfValues
Input map
Input Map Variable Value
cartId {{params.id}}
listkeys PaymentChoice
Cards
None
Image
cpq-base-header-pricelist (layout)
The cpq-base-header-pricelist layout renders the picklist that displays the price lists in the upper left corner
of Vlocity Cart.
Template
cpq-base-header-pricelist (template)
Data Source
Dual
Remote Class
CpqAppHandler
Remote Method
getPriceLists
Input map
Input Map Variable Value
cartId {{params.id}}
GET /services/apexrest/vlocity_cmt/v2/cpq/carts/{{params.id}}/pricelists
Cards
None
Image
cpq-base-header-pricelist (template)
The cpq-base-header-pricelist template calls changePricelist to assign the price list the agent selects.
In Vlocity Communications, Media, and Energy Summer '18, cpq-base-header-pricelist supports multi-
language translation for the Price List Name.
Template Type
Containers
Code
HTML
Image
Upgrade from Vlocity CME Winter '18 to Vlocity CME Summer '18
When upgrading from Vlocity Communications, Media, and Energy Winter '18 to Vlocity Communications,
Media, and Energy Summer '18, you must make the following change to the HTML in the Card Designer.
First Change
<div class="slds-text-
body_small">{{::importedScope.customLabels.CPQPriceList}}</div>
<div class="slds-text-body_small">{{::importedScope.customLabels.CPQPriceList
| CPQTranslateFilter:'PriceList.Name'}}</div>
Second Change
{{importedScope.currentPricelist.Name ||
importedScope.customLabels.CPQSelectPriceList}}
<span>{{importedScope.currentPricelist.Name ||
importedScope.customLabels.CPQSelectPriceList |
CPQTranslateFilter:'PriceList.Name'}}</span>
Third Change
<span class="slds-truncate">{{pricelist.Name}}</span>
<span class="slds-truncate">{{pricelist.Name |
CPQTranslateFilter:'PriceList.Name'}}</span>
cpq-base-theme-variables (template)
The cpq-base-theme variables template contains CSS variables that are used in other templates.
Template Type
Mixin
Code
CSS/SCSS
Image
n/a
$cpq-cart-total-bar-bg-color: #14315D;
$cpq-product-cart-items-bg-color: $white;
$cpq-product-cart-items-attr-value-color: $dark-gray;
$cpq-product-cart-item-selected-border-color: #FDB734;
$cpq-product-cart-order-bg-color: $mid-gray;
$cpq-product-cart-config-error-font-size: .75rem;
$cpq-product-cart-config-error-margin-top: .5rem;
$cpq-product-cart-discount-price: #97C077;
$cpq-cart-item-attr-label-font-size: 11px;
$cpq-cart-item-product-group-label-color: $black;
$cpq-cart-section-title-font-size: 15px;
$cpq-cart-item-product-messages-padding: 28px;
$cpq-cart-item-product-details-padding: 20px;
$cpq-cart-item-product-cfg-attr-font-size: 13px;
$cpq-cart-promo-item-bg-color: #F9FCF3;
$cpq-cart-promo-button-bg-color: #9ECC3B;
$cpq-cart-promo-item-border-color: #CCE29C;
$cpq-cart-promo-item-border-width: 2px;
$cpq-cart-promo-item-border-radius: 5px;
$cpq-loyalty-points-color: #061C3F;
$cpq-product-link-color: #0070d2;
$cpq-offers-count-bg-color: #FDB734;
$cpq-product-cart-item-popover-top: -3.5rem;
$cpq-product-cart-item-popover-left: -0.5rem;
$product-item-bookmark-red: #f65327;
$product-item-bookmark-blue: #0058C6;
$product-item-bookmark-green: #13834D;
$product-item-bookmark-yellow: #FFB75D;
$product-item-bookmark-grayish-blue: #54698D;
cpq-base-variables (template)
The cpq-base-variables template contains CSS variables used in other templates and themes.
Template Type
Mixin
Code
CSS/SCSS
Image
n/a
$notify-default: #54698d;
// Neutrals
$neutral-lightest: #EEF1F6;
$neutral-light: #CFD7E6;
$neutral-medium: #A7B8D1;
$neutral-dark: #4F6A92;
// Modals
$modal-overlay: #7e8c99;
// Primary Colors
$primary-alternative: #4A90E2;
$primary-lightest: #0C8EFF;
$primary-light: #0070D2;
$primary-medium: #005FB2;
$primary-dark: #00396B;
// Secondary Colors
$secondary-pink: #EF7EAD;
$secondary-green: #4BC076;
$secondary-aqua: #50E3C2;
$secondary-purple: #7F8DE1;
$secondary-orange: #F88962;
// Other Colors
$slds-red: #ef6e64;
// Fonts
$slds-font: "Salesforce Sans", Arial, sans-serif;
// Namespace
$cpq-namespace: 'cpq';
$assets-namespace: 'assets'
cpq-card-blank (template)
The cpq-card-blank template is an empty template. You can use cpq-card-blank to create a custom view in
the cpq-product-cart-item card state.
Template Type
Cards
Code
None
Image
None
cpq-card-mixin (template)
The cpq-card-mixin template displays the bundle hierarchy in Vlocity Cart.
In Vlocity Communications, Media, and Energy Summer '18, cpq-card-mixin includes the
#{$namespace}-product-name-block.
Template Type
Mixin
Code
CSS/SCSS
Image
Upgrade from Vlocity CME Winter '18 to Vlocity CME Summer '18
When upgrading from Vlocity Communications, Media, and Energy Winter '18 to Vlocity Communications,
Media, and Energy Summer '18, you must make the following changes to the CSS in the Card Designer.
First Change
In CME Winter '18, keep the following in the CSS:
.comp-#{$namespace}-product-item-child, .comp-#{$namespace}-product-item {
position:relative; /* needed for selected border */
input.ng-invalid {
In CME Summer '18, replace the CSS statements above with the following CSS statements:
.comp-#{$namespace}-product-item-child, .comp-#{$namespace}-product-item {
position:relative; /* needed for selected border */
padding-top: 20px;
input.ng-invalid {
Second Change
.slds-button__icon {
float: left;
margin: 0.3rem 0.5rem 0 0;
.slds-button__icon {
margin: 0.3rem 0.5rem 0 0;
Third Change
In CME Summer '18 , add the following :
.#{$namespace}-product-name-block {
display: inline-flex;
.#{$namespace}-product-icon-block {
display: inherit;
div {
margin: auto
}
}
} "
cpq-cart-item-detail (card)
The cpq-cart-item-detail card renders the information in the Line Item Details dialog box. Each card
contains the information for one product, or line item, in the cart. Use the line item details to modify the
attributes of any item inline.
Title
Line Item Detail
Filter
None
Data Source
None
States
Active
Template
cpq-product-cart-item (template)
Actions
None
Flyout
None
Conditions
None
Use
cpq-cart-item-detail (layout)
Image
cpq-cart-item-detail (layout)
The cpq-cart-item detail layout provides the interface for the Line Item Details dialog box.
Template
cpq-cart-item-details (template)
Name Value
messages payload.messages
Data Source
Dual
Remote Class
CpqAppHandler
Remote Method
getCartsItemsById
Input Map
Input
Map
Variable
cartId {{params.id}}
fields Quantity,vlocity_cmt__RecurringTotal__c,vlocity_cmt__OneTimeTotal__c,vlocity_cmt__OneTimeManualDiscount__c,vlocity_cmt__RecurringManua
id {{attrs.lineItemIds}}
GET /vlocity_cmt/v2/cpq/carts/{{params.id}}/items?
id={{attrs.lineItemIds}}&fields=Quantity,vlocity_cmt__RecurringTotal__c,vlocity
_cmt__OneTimeTotal__c,vlocity_cmt__OneTimeManualDiscount__c,vlocity_cmt__Recurr
ingManualDiscount__c,vlocity_cmt__ProvisioningStatus__c,vlocity_cmt__RecurringC
harge__c,vlocity_cmt__OneTimeCharge__c,ListPrice,vlocity_cmt__ParentItemId__c,v
locity_cmt__BillingAccountId__r.Name,vlocity_cmt__ServiceAccountId__r.Name,vloc
ity_cmt__PremisesId__r.Name,vlocity_cmt__InCartQuantityMap__c
Cards
cpq-cart-item-detail (card)
Image
comp-assets-contract (card)
The comp-assets-contract card renders the date picker and other items in the header portion of the space
that displays the assets on the cards-based Assets and Review Cart Visualforce pages, when the assets
are grouped by contract. For more information about these pages, see Learning About Asset-Based
Ordering Visualforce Pages.
Title
Contract Assets
Filter
None
Data Source
Dual
Remote Class
CpqAppHandler
Remote Method
getContracts
Input map
Input Map Variable Value
accountId {{attrs.accountId}}
records
/services/apexrest/vlocity_cmt/v2/accounts/{{attrs.accountId}}/contracts
States
Contract Assets
Template
comp-assets-contract-load (template)
Actions
None
Flyout
comp-assets-contract-layout
Conditions
None
Image
cpq-cart-item-details (template)
The cpq-cart-items-details template provides the structure for the cards in the Line Items Details dialog
box.
Template Type
Cards
Code
HTML, CSS/SCSS
Image
cpq-cart-item-lookup (layout)
The cpq-cart-item-lookup layout renders the Cart Item Lookup Field dialog box.
Template
cpq-cart-item-lookup (layout)
Data Source
Dual
Remote Class
CpqAppHandler
Remote Method
getAvailableSites
Input Map
Input Map Variable Value
cartId {{params.id}}
id {{params.lineItemId}}
lookupField {{params.fieldName}}
GET /vlocity_cmt/v2/cpq/carts/{{params.id}}/sites?
id={{params.lineItemId}}&lookupField={{params.fieldName}}
Cards
Empty
Image
cpq-cart-item-lookup (template)
The cpq-cart-item-lookup template provides the structure and user interface elements for the Cart Item
Lookup Field dialog box.
Template Type
Containers
Code
HTML
Image
cpq-cart-promotions (card)
The cpq-cart-promotions card renders each individual applied promotion in the cart.
NOTE
In Vlocity CMT Summer '17, Major release, Version 100.0.900.60, the card is cpq-cart-
applied-promotions-card. In Vlocity CMT Summer '17, Minor release, 100.1.900.72-73 and
later, the card is cpq-cart-promotions.
Title
Cpq Applied Promotion Card
Filter
None
Data Source
None
Remote Class
None
Remote Method
None
Input map
None
States
• CustomView_Basic
• BasicView_Basic
Template
cpq-card-blank (template)
Actions
None
Flyout
None
Conditions
None
Image
cpq-cart-promotions (layout)
The cpq-cart-promotions layout renders the list of applied promotions in the cart.
NOTE
In Vlocity CMT Summer '17, Major release, Version 100.0.900.60, the layout is cpq-cart-
applied-promotions-view. In Vlocity CMT Summer '17, Minor release, 100.1.900.72-73 and
later, the layout is cpq-cart-promotions.
Template
cpq-cart-promotions (template)
Data Source
Dual
Remote Class
CpqAppHandler
Remote Method
getPromotionsAppliedToCart
Input map
Input Map Variable Value
cartId {{params.id}}
pagesize 10
GET /services/apexrest/vlocity_cmt/v2/cpq/carts/{{params.id}}/promotions?
subaction=getPromotionsAppliedToCart&pagesize=10
Cards
cpq-cart-promotions (card)
Image
cpq-cart-promotions (template)
The cpq-cart-promotions template retrieves the list of applied promotions in the cart.
In Vlocity Communications, Media, and Energy Summer '18, cpq-cart-promotions has been changed to
provide multi-language support to translate Promotion Name.
NOTE
In Vlocity Communications, Media, and Energy Summer '17, Major release, Version
100.0.900.60, the template is cpq-cart-applied-promotions-view. In Vlocity
Communications, Media, and Energy Summer '17, Minor release, 100.1.900.72-73 and
later, the template is cpq-cart-promotions.
Template Type
Containers
Code
HTML, CSS/SCSS
Image
Upgrade from Vlocity CME Winter '18 to Vlocity CME Summer '18
When upgrading from Vlocity Communications, Media, and Energy Winter '18 to Vlocity Communications,
Media, and Energy Summer '18, you must make the following changes to the HTML in the Card Designer.
Template Type
Cards
Code
HTML, CSS/SCSS
Image
Upgrade from Vlocity CME Winter '18 to Vlocity CME Summer '18
When upgrading from Vlocity Communications, Media, and Energy Winter '18 to Vlocity Communications,
Media, and Energy Summer '18, you must make the following changes to the JavaScript in the Card
Designer.
cpq-config-attr-custom-action-template1
modalScope.customActionIframeSrc = '/apex/CustomActionThirdPartyTest?
targetOrigin=' + targetOrigin + '&messageType=' + messageType +
'&attributeId=' + attributeId;
In CME Summer '18, replace the JavaScript above with the following JavaScript:
modalScope.customActionIframeSrc = '/apex/c__CustomActionThirdPartyTest?
targetOrigin=' + targetOrigin + '&messageType=' + messageType +
'&attributeId=' + attributeId;"
cpq-config-attr-custom-action-template12
modalScope.customActionIframeSrc = '/apex/CustomActionThirdPartyTest?
targetOrigin=' + targetOrigin + '&messageType=' + messageType +
'&attributeId=' + attributeId;
In CME Summer '18, replace the JavaScript above with the following JavaScript:
modalScope.customActionIframeSrc = '/apex/c__CustomActionThirdPartyTest?
targetOrigin=' + targetOrigin + '&messageType=' + messageType +
'&attributeId=' + attributeId;
cpq-header (card)
The cpq-header-card displays the content of the cart header. This card has three states.
Title
cpq-header
Filter
None
Data Source
Dual
Remote Class
CpqAppHandler
Remote Method
getCarts
Input Map
Input Map Variable Value
cartId {{params.id}}
price false
validate false
GET /services/apexrest/vlocity_cmt/v2/cpq/carts/{{params.id}}?
validate=false&price=false
States
• Active Opportunity
• Active Quote
• Active Order
Template
cpq-base-header-card (template)
Actions
All three states:
• View Record
• Edit Record
Flyout
None
Conditions
• Active Opportunity: ['ObjectType'] = 'Opportunity'
• Active Quote: ['ObjectType'] = 'Quote'
• Active Order: ['ObjectType'] ='Order'
Image
cpq-header (layout)
The cpq-header layout provides the header for the cart.
Template
cpq-base-header (template)
Data Source
No source/layout
Cards
cpq-header (card)
Image
cpq-base-header-payment-choice (template)
The cpq-base-header-payment-choice template renders the Payment Choice drop-down list in Vlocity
Cart.
Template Type
Containers
Code
CSS/SCSS
Image
cpq-input-custom-template-sample
The cpq-input-custom-template-sample template is an example of a custom template for a field.
Template Type
Cards
Code
HTML, CSS/SCSS
Image
cpq-left-sidebar (layout)
The cpq-left-sidebar layout displays the Products list and Promotions list in Vlocity Cart.
Template
cpq-left-sidebar (template)
Data Source
None
Remote Class
None
Remote Method
None
Input map
None
Cards
None
Image
cpq-left-sidebar (template)
The cpq-left-sidebar template is a wrapper for the cpq-product-list and cpq-promotions-list cards and
layouts.
In Vlocity Communications, Media, and Energy Summer '18, cpq-left-sidebar has been changed to pass
userLocale to both the Product List and Promotion List.
Template Type
Containers
Code
HTML, CSS/SCSS
Image
Upgrade from Vlocity CME Winter '18 to Vlocity CME Summer '18
When upgrading from Vlocity Communications, Media, and Energy Winter '18 to Vlocity Communications,
Media, and Energy Summer '18, you must make the following changes to the HTML in the Card Designer.
First Change
Second Change
cpq-product-addon (layout)
The cpq-product-addon layout provides the information necessary when a product includes additional
items.
Template
cpq-product-addon (template)
Data Source
Parent
Cards
cpq-product-addon-item (card)
Image
cpq-product-addon (template)
The cpq-product-addon template provides the structure necessary to display information when a product
includes additional items.
Template Type
Containers
Code
HTML, CSS/SCSS
Image
cpq-product-addon-item (card)
The cpq-product-addon-item displays the information necessary when a product includes additional items,
including the line items, child products, promotions, and grouping items.
Title
Add On
Filter
None
Data Source
None
States
Add-on
Template
cpq-product-addon-item-separate-section
Actions
None
Flyout
None
Conditions
None
Image
cpq-product-addon-item-separate-section (template)
The cpq-product-addon-item-separate-section template provides the structure for the line items in a cart
when some products include additional items.
Template Type
Cards
Code
HTML, CSS/SCSS
Image
cpq-product-cart (layout)
The cpq-product-cart layout renders the cart, including any relevant error messages.
Template
cpq-product-cart (template)
Name Value
nextProducts payload.actions.nextproducts
messages payload.messages
Data Source
Dual
Remote Class
CpqAppHandler
Remote Method
getCartsItems
Input Map
Input Value
Map
Variable
cartId {{params.id}}
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.Na
vlocity_cmt__ServiceAccountId__r.Name,vlocity_cmt__PremisesId__r.Name,vlocity_cmt__InCartQuantityMap__c
pagesize 10
NOTE
The pagesize must be greater than one. If the pagesize is set to one, when loading
more line items or deleting a product, Vlocity Cart may stop responding.
GET /services/apexrest/vlocity_cmt/v2/cpq/carts/{{params.id}}/items?
pagesize=10&fields=vlocity_cmt__BillingAccountId__c,vlocity_cmt__ServiceAccount
Id__c,Quantity,vlocity_cmt__RecurringTotal__c,vlocity_cmt__OneTimeTotal__c,vloc
ity_cmt__OneTimeManualDiscount__c,vlocity_cmt__RecurringManualDiscount__c,vloci
ty_cmt__ProvisioningStatus__c,vlocity_cmt__RecurringCharge__c,vlocity_cmt__OneT
imeCharge__c,ListPrice,vlocity_cmt__ParentItemId__c,vlocity_cmt__BillingAccount
Id__r.Name,vlocity_cmt__ServiceAccountId__r.Name,vlocity_cmt__PremisesId__r.Nam
e,vlocity_cmt__InCartQuantityMap__c
Cards
cpq-product-cart-item (card)
Image
cpq-product-cart (template)
The cpq-product-cart template provides the structure for the cart.
In Vlocity Communications, Media, and Energy Summer '18, cpq-product-cart has been changed to use a
custom label that matches the custom view name.
Template Type
Containers
Code
HTML, CSS/SCSS
Image
Upgrade from Vlocity CME Winter '18 to Vlocity CME Summer '18
When upgrading from Vlocity Communications, Media, and Energy Winter '18 to Vlocity Communications,
Media, and Energy Summer '18, you must make the following changes to the HTML in the Card Designer.
cpq-product-cart-config (layout)
The cpq-product-cart-config layout renders the configuration panel in the cart, including only the close and
Save buttons.
Template
cpq-product-cart-config
Cards
Empty
Image
cpq-product-cart-config (template)
The cpq-product-cart-config template provides the structure for the configuration panel in the cart.
In Vlocity Communications, Media, and Energy Summer '18, cpq-product-cart-config has been changed.
Template Type
Containers
Code
HTML, CSS/SCSS
Image
Upgrade from Vlocity CME Winter '18 to Vlocity CME Summer '18
When upgrading from Vlocity Communications, Media, and Energy Winter '18 to Vlocity Communications,
Media, and Energy Summer '18, you must make the following changes to the HTML or CSS in the Card
Designer.
HTML Change
In Winter '18, keep the following HTML:
disabled="importedScope.isAsset(importedScope.configItemObject,editableItem.fie
ldName)"
ng-change="importedScope.refreshEditableField(editableItem, true);"
ng-keydown="importedScope.checkQuantityField(editableItem.fieldName,
$event.key)"/>
<span class="cpq-error-msg">{{editableItem.qtyValidationMessage}}</span>
</div>undefined</div>
CSS Change
#{$namespace}-error-msg {
In Summer '18, replace the CSS statement above with the following CSS statements:
.#{$namespace}-error-msg {
color: $error;"
cpq-product-cart-item (card)
The cpq-product-cart-item card displays each line item in a cart.
Title
Cart Item
Filter
None
Data Source
None
States
cart Item
Template
cpq-product-cart-item (template)
Actions
None
Flyout
None
Conditions
None
Image
cpq-product-cart-item (template)
The cpq-product-cart-item template provides the structure for the Line Item Details dialog box.
The cpq-product-cart-item template also provides the structure for each root-level line item in the cart.
In Vlocity Communications, Media, and Energy Summer '18, cpq-product-cart-item has been changed:
Template Type
Cards
Code
HTML, CSS/SCSS
Image
Upgrade from Vlocity CME Winter '18 to Vlocity CME Summer '18
When upgrading from Vlocity Communications, Media, and Energy Winter '18 to Vlocity Communications,
Media, and Energy Summer '18, you must make the following changes to the HTML in the Card Designer.
First Change
<!-- Name -->
<div ng-if="customField.name === 'Name'">
<slds-button-svg-icon sprite="'utility'" size="'small'" icon="'switch'"
extra-classes="'slds-button__icon_left'"
ng-class="{'cpq-fix-slds-close-switch' : !childProdState.show}"></slds-button-
svg-icon>
<span class="slds-assistive-text">Toggle</span>
<span class="cpq-product-name">{{obj.PricebookEntry.Product2.Name}}</span>
<span title="{{obj[$root.nsPrefix+'Action__c'].value}}">
<slds-button-svg-icon sprite="'utility'" size="'small'" icon="'bookmark'"
extra-classes="'slds-button__icon_left'" class="cpq-product-item-bookmark-
{{obj[$root.nsPrefix+'Action__c'].value.toLowerCase() || 'null'}}"></slds-
button-svg-icon>
</span>
<span class="cpq-product-name" cpq-
translate="Product2.Name">{{obj.PricebookEntry.Product2.Name}}</span>
</button>
<div class="cpq-item-no-children" ng-show="!(obj.lineItems.records ||
obj.childProducts.records || obj.productGroups.records || (attrs.lineItemModal
&& obj.attributeCategories.records.length > 0))">
<span>{{obj.PricebookEntry.Product2.Name}}</span>
<span title="{{obj[$root.nsPrefix+'Action__c'].value}}">
<slds-button-svg-icon sprite="'utility'" size="'small'" icon="'bookmark'"
extra-classes="'slds-button__icon_left'" class="cpq-product-item-bookmark-
{{obj[$root.nsPrefix+'Action__c'].value.toLowerCase() || 'null'}}"
title="Hooray"></slds-button-svg-icon>
</span>
</div>undefined</div>undefined<!— Name -->undefined<div ng-
if="customField.name === 'Name'" class="cpq-product-name-block">
<button class="slds-button cpq-item-has-children" aria-controls="tree0-node1"
ng-click="childProdState.show = !childProdState.show"
ng-hide="!(obj.lineItems.records || obj.childProducts.records ||
obj.productGroups.records || (attrs.lineItemModal &&
obj.attributeCategories.records.length > 0))">
<slds-button-svg-icon sprite="'utility'" size="'small'" icon="'switch'"
extra-classes="'slds-button__icon_left slds-float_left'" ng-class="{'cpq-fix-
slds-close-switch' : !childProdState.show}"></slds-button-svg-icon>
<span class="slds-assistive-text">Toggle</span>
<span class="cpq-product-name" cpq-
translate="Product2.Name">{{obj.PricebookEntry.Product2.Name}} </span>
</button>
<div class="cpq-item-no-children"
ng-show="!(obj.lineItems.records || obj.childProducts.records ||
obj.productGroups.records || (attrs.lineItemModal &&
obj.attributeCategories.records.length > 0))"
cpq-translate="Product2.Name">
{{obj.PricebookEntry.Product2.Name}}
</div>
<!-- Icons -->
<div class="cpq-product-icon-block">
<div title="{{obj[$root.nsPrefix+'Action__c'].value}}">
<slds-button-svg-icon sprite="'utility'" size="'small'" icon="'bookmark'"
class="cpq-product-item-bookmark- {{obj[$root.nsPrefix
+'Action__c'].value.toLowerCase() || 'null'}}"></slds-button-svg-icon>
</div>
</div>undefined</div>
Second Change
<button class="slds-button slds-button_icon-border" aria-haspopup="true"
title="{{::importedScope.customLabels.CPQPaymentChoice}}"
ng-if="obj[customField.fieldName]['actions']['switchpaymentmode']"
Third Change
<div class="slds-button-group" role="group">
<button class="slds-button slds-button_icon-border" ng-
disabled="obj.orderActive"
<button class="slds-button slds-button_icon-border"
title="{{::importedScope.customLabels.CPQChangePrice}}"
ng-if="obj[customField.fieldName]['actions']['applyadjustment']"
<div class="slds-popover__body cpq-price-actions-popover__body">
<div class="slds-button-group" role="group">
<button class="slds-button slds-button_icon-border"
title="{{::importedScope.customLabels.CPQChangePrice}}"
ng-if="obj[customField.fieldName]['actions']['applyadjustment']"
ng-disabled="obj.orderActive"
Fourth Change
<div ng-repeat="promoItem in obj[customField.fieldName].records" ng-attr-
title="{{promoItem.Name}}" class="cpq-promo-text-wrap" ng-class="{'cpq-promo-
name-strike': importedScope.isPromoActionDisconnect(promoItem)}">
{{promoItem.Name}}{{$last ? '' : ', '}}
<div ng-repeat="promoItem in obj[customField.fieldName].records" ng-attr-
title="{{promoItem.Name}}" class="cpq-promo-text-wrap" ng-class="{'cpq-promo-
name-strike': importedScope.isPromoActionDisconnect(promoItem)}">
<span cpq-translate="Promotion.Name">{{promoItem.Name}}</span>
{{$last ? '' : ', '}}
</div>
cpq-product-cart-item-cell-detail (flyout)
The cpq-product-cart-item-cell-detail flyout displays the Price Details dialog box.
Template
cpq-product-cart-item-cell-detail (template)
Data Source
None
Remote Class
None
Remote Method
None
Input map
None
Cards
None
Image
cpq-product-cart-item-cell-detail (template)
The cpq-product-cart-item-cell-detail template provides the structure for the Price Details dialog box.
Template Type
Cards
Code
HTML, CSS/SCSS
Image
Upgrade from Vlocity CME Winter '18 to Vlocity CME Summer '18
When upgrading from Vlocity Communications, Media, and Energy Winter '18 to Vlocity Communications,
Media, and Energy Summer '18, you must make the following changes to the HTML in the Card Designer.
cpq-product-cart-item-cell-payment-choice (template)
The cpq-product-cart-item-cell-payment-choice template renders the Payment Choice drop-down list for a
single line item in Vlocity Cart.
Template Type
Cards
Code
HTML
Images
Payment Choice Icon
Upgrade from Vlocity CME Winter '18 to Vlocity CME Summer '18
When upgrading from Vlocity Communications, Media, and Energy Winter '18 to Vlocity Communications,
Media, and Energy Summer '18, you must make the following changes to the HTML in the Card Designer.
<div class="slds-form-element__control">
<span class="slds-form-element__static slds-text-heading_small">
<strong>{{parent.Product2.Name}}</strong>
</span>
</div>
<div class="slds-form-element__control">
<span class="slds-form-element__static slds-text-heading_small">
<strong cpq-translate="Product2.Name">{{parent.Product2.Name}}</strong>
</span>
</div>
cpq-product-cart-item-cell-pricing (flyout)
The cpq-product-cart-item-cell-pricing flyout displays the Apply Adjustment dialog box.
Template
cpq-product-cart-item-cell-pricing (template)
Data Source
None
Remote Class
None
Remote Method
None
Input map
None
Cards
None
Image
cpq-product-cart-item-cell-pricing (template)
The cpq-product-cart-item-cell-pricing template provides the structure for the Apply Adjustment dialog
box.
In Vlocity Communications, Media, and Energy Summer '18, cpq-product-cart-item-cell-pricing reuses the
adjustment plan and policy area in the template for both adjustment by values and adjustment by code.
Template Type
Cards
Code
HTML, CSS/SCSS
Image
Upgrade from Vlocity CME Winter '18 to Vlocity CME Summer '18
When upgrading from Vlocity Communications, Media, and Energy Winter '18 to Vlocity Communications,
Media, and Energy Summer '18, you must make the following changes to the HTML in the Card Designer.
<!-- Adjustment Plan and Policy Block --> code after <!-- End Adjustment Code
-->
cpq-product-cart-item-child (card)
The cpq-product-cart-item-child card displays each child-level product line item in Vlocity Cart.
Title
Child Products
Filter
None
Data Source
None
Remote Class
None
Remote Method
None
Input map
None
States
Child Products
Template
None
Actions
None
Flyout
None
Conditions
None
Image
cpq-product-cart-item-child (layout)
The cpq-product-cart-item-child layout displays child-level product information in Vlocity Cart.
NOTE
The cpq-product-cart-item-child layout was once named cpq-product-cart-item-child.
Template
cpq-product-cart-item-child (template)
Data Source
Parent
Remote Class
None
Remote Method
None
Input map
None
Cards
cpq-cart-item-child-products
Image
cpq-product-cart-item-child (template)
The cpq-product-cart-item-child template provides the structure for the child-level product information in the
cart.
NOTE
The cpq-product-cart-item-child template was once named cpq-cart-item-product-children.
In Vlocity Communications, Media, and Energy Summer '18, cpq-product-cart-item-child has been
changed:
Template Type
Layout
Code
Parent
Image
Upgrade from Vlocity CME Winter '18 to Vlocity CME Summer '18
When upgrading from Vlocity Communications, Media, and Energy Winter '18 to Vlocity Communications,
Media, and Energy Summer '18, you must make the following changes to the HTML in the Card Designer.
First Change
<div ng-if="customField.name === 'Name'" class="cpq-item-child-product-name-
wrapper">
<button ng-click="childProdState.show =
importedScope.determineChildProdOpenOrCloseAfterClick(childProd,
childProdState.show); importedScope.fullScreen(attrs.ariaLevel,
childProdState.show)" class="slds-button cpq-item-has-children" aria-
controls="tree0-node1" ng-
hide="importedScope.determineIfChildProdOpenOrCloseIconShouldBeHidden(childProd
)" ng-init="childProdState.show =
importedScope.determineChildProdOpenOrCloseInitially(childProd)">
<slds-button-svg-icon sprite="'utility'" size="'small'" icon="'switch'"
extra-classes="'slds-button__icon_left'" ng-class="{'cpq-fix-slds-close-
switch' : !childProdState.show}"></slds-button-svg-icon>
<span class="slds-assistive-text">Toggle</span>
<span class="cpq-product-name js-cpq-cart-product-hierarchy-path-
{{childProd.productHierarchyPath}}">{{(childProd.PricebookEntry.Product2.Name
|| childProd.Product2.Name)}}</span>
<span title="{{childProd[$root.nsPrefix+'Action__c'].value}}">
<slds-button-svg-icon sprite="'utility'" size="'small'"
icon="'bookmark'" extra-classes="'slds-button__icon_left'" class="cpq-product-
item-bookmark-{{childProd[$root.nsPrefix+'Action__c'].value.toLowerCase() ||
'null'}}"></slds-button-svg-icon>
</span>
</button>
<div class="cpq-item-no-children" ng-show="!
importedScope.checkIfChildProdHasChildren(childProd)">
{{(childProd.PricebookEntry.Product2.Name || childProd.Product2.Name)}}
<span title="{{childProd[$root.nsPrefix+'Action__c'].value}}">
<slds-button-svg-icon sprite="'utility'" size="'small'"
icon="'bookmark'" extra-classes="'slds-button__icon_left'" class="cpq-product-
item-bookmark-{{childProd[$root.nsPrefix+'Action__c'].value.toLowerCase() ||
'null'}}"></slds-button-svg-icon>
</span>
</div>
</div>
<div ng-if="customField.name === 'Name'" class="cpq-product-name-block cpq-
item-child-product-name-wrapper">
<button ng-click="childProdState.show =
importedScope.determineChildProdOpenOrCloseAfterClick(childProd,
childProdState.show); importedScope.fullScreen(attrs.ariaLevel,
childProdState.show)" class="slds-button cpq-item-has-children" aria-
controls="tree0-node1" ng-
hide="importedScope.determineIfChildProdOpenOrCloseIconShouldBeHidden(childProd
)" ng-init="childProdState.show =
importedScope.determineChildProdOpenOrCloseInitially(childProd)">
<slds-button-svg-icon sprite="'utility'" size="'small'" icon="'switch'"
extra-classes="'slds-button__icon_left slds-float_left'" ng-class="{'cpq-fix-
slds-close-switch' : !childProdState.show}"></slds-button-svg-icon>
<span class="slds-assistive-text">Toggle</span>
<span class="cpq-product-name js-cpq-cart-product-hierarchy-path-
{{childProd.productHierarchyPath}}" cpq-
translate="Product2.Name">{{(childProd.PricebookEntry.Product2.Name ||
childProd.Product2.Name)}}</span>
</button>
<div class="cpq-item-no-children" ng-show="!
importedScope.checkIfChildProdHasChildren(childProd)" cpq-
translate="Product2.Name">
{{(childProd.PricebookEntry.Product2.Name || childProd.Product2.Name)}}
</div>
<!-- Icons -->
<div class="cpq-product-icon-block">
<div title="{{childProd[$root.nsPrefix+'Action__c'].value}}">
<slds-button-svg-icon sprite="'utility'" size="'small'"
icon="'bookmark'" class="cpq-product-item-bookmark-{{childProd[$root.nsPrefix
+'Action__c'].value.toLowerCase() || 'null'}}"></slds-button-svg-icon>
</div>
</div>
</div>
Second Change
<button class="slds-button slds-button_icon-border" aria-haspopup="true"
title="{{::importedScope.customLabels.CPQPaymentChoice}}"
ng-if="childProd[customField.fieldName]['actions']['switchpaymentmode']"
Third Change
<div class="slds-popover__body cpq-price-actions-popover__body">
<div class="slds-button-group" role="group">
<button class="slds-button slds-button_icon-border" ng-
disabled="obj.orderActive"
title="{{::importedScope.customLabels.CPQChangePrice}}"
ng-if="childProd[customField.fieldName]['actions']['applyadjustment']"
ng-click="importedScope.openAdjustmentModal(childProd[customField.fieldName],
'applyadjustment', childProd)">
<div class="slds-popover__body cpq-price-actions-popover__body">
<div class="slds-button-group" role="group">
<button class="slds-button slds-button_icon-border"
title="{{::importedScope.customLabels.CPQChangePrice}}"
ng-if="childProd[customField.fieldName]['actions']['applyadjustment']"
ng-disabled="obj.orderActive"
Fourth Change
<button class="slds-button slds-button_icon-border" aria-haspopup="true"
title="{{::importedScope.customLabels.CPQPaymentChoice}}"
ng-if="childProd[customField.fieldName]['actions']['switchpaymentmode']"
title="{{::importedScope.customLabels.CPQPaymentChoice}}"
ng-if="childProd[customField.fieldName]['actions']['switchpaymentmode']"
ng-disabled="obj.orderActive"
Fifth Change
<div ng-repeat="promoItem in childProd[customField.fieldName].records" ng-attr-
title="{{promoItem.Name}}" class="cpq-promo-text-wrap"
ng-class="{'cpq-promo-name-strike':
importedScope.isPromoActionDisconnect(promoItem)}">
{{promoItem.Name}}{{$last ? '' : ', '}}
Sixth Change
<button cpq-dropdown-handler="lineActions.show = false" aria-haspopup="true"
class="slds-button slds-button_icon-border-filled cpq-item-actions-dropdown-
button"
title="{{::importedScope.customLabels.CPQShowActions}}"
ng-if="(childProd.actions.updateitems && !attrs.lineItemModal) ||
(childProd.actions.addtocart && importedScope.checkCardinalityForAdd(obj,
childProd)) || (childProd.actions.cloneitem &&
importedScope.checkCardinalityForClone(obj, childProd)) ||
importedScope.checkCardinalityForDelete(obj, childProd)"
Seventh Change
<button ng-click="childProdState.show = !childProdState.show;
importedScope.fullScreen(attrs.ariaLevel, childProdState.show)" class="slds-
button cpq-item-has-children" aria-controls="tree0-node1" ng-hide="!
(childProd.lineItems.records || childProd.childProducts.records ||
childProd.productGroups.records)">
Eighth Change
<span ng-class="{'cpq-item-no-children' : !
importedScope.checkIfChildProdHasChildren(childProd)}">{{::
(childProd.PricebookEntry.Product2.Name || childProd.Product2.Name)}}</span>
<span ng-class="{'cpq-item-no-children' : !
importedScope.checkIfChildProdHasChildren(childProd)}"
cpq-translate="Product2.Name">{{::(childProd.PricebookEntry.Product2.Name ||
childProd.Product2.Name)}}</span>
cpq-product-config-custom-action (layout)
The cpq-product-config-custom-action layout can render custom actions in the CPQ user interface. You can
use the cpq-product-config-custom-action layout when you must customize the default look and feel of a
field, or when you must add your own custom implementation. You can also use this layout when an
attribute requires an external data source to populate it. For example, for a telephone reservation, you can
call out to an external system.
Template
cpq-product-config-custom-action
Cards
Empty
Image
cpq-product-config-custom-action (template)
The cpq-product-config-custom-action template is associated with the cpq-product-config-custom-action
layout. It provides a very basic structure on which you can base custom actions.
In the example provided, any attribute in the Cat3 category uses the custom action to automatically
generate a phone number or to look phone numbers up using a custom Visualforce page.
Type
Containers
Code
HTML, CSS/SCSS
Example HTML
<div class="slds-grid slds-grid--vertical cpq-product-cart-config">
<div class="slds-col slds-no-flex cpq-product-cart-config-header">
<div class="slds-grid slds-grid--align-end">
<button class="slds-button slds-button--icon" ng-
click="importedScope.close()">
<slds-button-svg-icon sprite="'utility'" size="'large'"
icon="'close'"></slds-button-svg-icon>
<span class="slds-assistive-text">Close</span>
</button>
</div>
</div>
<!-- scroll class is added for ionic scroll-->
<div class="slds-col cpq-product-cart-config-form scroll">
<div>
<div ng-if="importedScope.attributesObj &&
importedScope.attributesObj.length > 0 && !
importedScope.reRenderAttributesForm">
<vlocity-dynamic-form name="productconfig" form-on-
change="importedScope.getModifiedAttributes(e, null, true);"
ng-model="importedScope.attributesObj" map-
object="{{importedScope.mapObject()}}" class="slds-form--stacked" form-auto-
save="true">
</vlocity-dynamic-form>
</div>
<div ng-if="importedScope.attributesObj &&
importedScope.attributesObj.length === 0">
No configurable attributes for this item.
</div>
</div>
<div class="slds-m-top--x-large" ng-init="showInfo = true">
<div class="slds-section" ng-class="{'slds-is-open': showInfo, 'slds-is-
closed': !showInfo}">
<h3 href="javascript:void(0);" class="slds-section__title" ng-
click="showInfo = !showInfo">
<button type="button" class="slds-button slds-section__title-
action">
<slds-button-svg-icon sprite="'utility'" icon="'switch'" extra-
classes="'slds-section__title-action-icon slds-button__icon--left'"></slds-
button-svg-icon>
Additional Setting
</button>
</h3>
<div class="slds-section__content">
<div class="slds-form--stacked">
<div class="slds-form-element" ng-repeat="lookupItem in
importedScope.lookupItemList">
<span class="slds-form-element__label slds-text-body--
regular">{{::lookupItem.label}}</span>
<div class="slds-form-element__control slds-input-has-fixed-
addon">
<span class="slds-form-
element__static">{{lookupItem.displayValue}}</span>
<span class="slds-form-element__addon">
<button type="button" class="slds-button slds-p-
horizontal--xx-small" ng-
click="importedScope.launchLineItemLookup(lookupItem)">
<slds-button-svg-icon sprite="'utility'" icon="'edit'"></
slds-button-svg-icon>
<span class="slds-assistive-text">Display Lookup Values</
span>
</button>
</span>
</div>
</div>
<div class="slds-form-element" ng-repeat="editableItem in
importedScope.editableItemList">
<label class="slds-form-
element__label">{{::editableItem.label}}<span ng-if="editableItem.dataType ===
'PERCENT'"> %</span></label>
<div class="slds-form-element__control">
<input ng-if="::editableItem.dataType === 'STRING'" type='text'
class="slds-input" ng-model='editableItem.value' ng-model-options="{ updateOn:
'default blur', debounce: { 'default': 800, 'blur': 0 } }"
ng-change="importedScope.refreshEditableField(editableItem ,
true);"/>
<input ng-if="::(editableItem.fieldName === 'Quantity' ||
editableItem.dataType === 'CURRENCY' || editableItem.dataType === 'PERCENT')"
type='number' step='any' class="slds-input" ng-model='editableItem.value' ng-
model-options="{ updateOn: 'default blur', debounce: { 'default': 800, 'blur':
0 } }"
ng-change="importedScope.refreshEditableField(editableItem,
true);"/>
<span class="error-msg">{{editableItem.qtyValidationMessage}}</
span>
</div>
</div>
</div>
</div>
</div>
</div>
<!--Display save button only when editable fields are available-->
<div class="slds-form-element cpq-product-cart-config-form-savebar" ng-
if="importedScope.attributesObj && importedScope.attributesObj.length >0 ||
importedScope.lookupItemList && importedScope.lookupItemList.length >0 ||
importedScope.editableItemList && importedScope.editableItemList.length >0">
<div class="slds-spinner_container" ng-show="importedScope.isConfigSubmit">
<div class="slds-spinner--brand slds-spinner slds-spinner--small" aria-
hidden="false" role="alert">
<div class="slds-spinner__dot-a"></div>
<div class="slds-spinner__dot-b"></div>
</div>
</div>
</div>
</div>
Example CSS
/*** CPQ Theme VARIABLES ***/
@import "cpq-theme-variables";
/*** MIXINS ***/
@import "cpq-mixin";
/*** STYLES ***/
.vlocity {
.cpq-product-cart-config {
background-color: $cpq-product-container-bg-color;
position: absolute;
top: $cpq-cart-container-tabs-height + $cpq-cart-container-tabs-top-
margin;
right: $cpq-padding-large-horizontal/2;
bottom: 0;
left: $cpq-padding-large-horizontal/2;
.cpq-product-cart-config-header {
padding: $cpq-padding-large-vertical $cpq-padding-large-horizontal;
}
.cpq-product-cart-config-form {
margin-bottom: 60px;
overflow-y: scroll;
margin-top: -$cpq-padding-large-vertical;
padding: 0px $cpq-padding-large-horizontal $cpq-padding-large-
vertical*2;
.cpq-product-cart-config-form-savebar {
position: absolute;
bottom: 0px;
left: 0px;
right: 0px;
padding: 15px 15px 18px;
background: $white;
}
.error-msg {
color: $error;
font-size: $cpq-product-cart-config-error-font-size;
margin-top: $cpq-product-cart-config-error-margin-top;
}
}
}
}
Image
cpq-product-details (card)
The cpq-product-details card displays the details for one product in the Product Details dialog box.
Title
Product details
Filter
None
Data Source
None
States
Product details
Template
cpq-product-item-details (template)
Actions
None
Flyout
None
Conditions
None
Image
cpq-product-filters (layout)
The cpq-product-filters layout renders the filterable attributes list panel, including the Reset and Apply
buttons.
Template
cpq-product-filters (template)
Data Source
Dual
Remote Class
CpqAppHandler
Remote Method
getCartsAttributes
Input Map
Input Map Variable Value
cartId {{params.id}}
GET /services/apexrest/vlocity_cmt/v2/cpq/carts/{{params.id}}/attributes
Cards
Empty
Image
cpq-product-filters (template)
The cpq-product-filters template provides the structure for the filterable attributes list panel, including the
Reset and Apply buttons.
Template Type
Containers
Code
HTML, CSS/SCSS
Image
cpq-product-item (card)
The cpq-product-item card displays each product in the product list the cart.
Title
ProductItem
Filter
None
Data Source
None
States
active
Template
cpq-product-item (template)
Actions
None
Flyout
cpq-product-item-more (layout)
Conditions
None
Image
cpq-product-item (template)
The cpq-product-item template provides the structure for each product in the product list in the cart.
In Vlocity Communications, Media, and Energy Summer '18,cpq-product-item has been changed:
Template Type
Cards
Code
HTML, CSS/SCSS
Image
Upgrade from Vlocity CME Winter '18 to Vlocity CME Summer '18
When upgrading from Vlocity Communications, Media, and Energy Winter '18 to Vlocity Communications,
Media, and Energy Summer '18, you must make the following changes to the HTML in the Card Designer.
First Change
<div class="slds-col slds-small-size_10-of-12 slds-medium-size_10-of-12 slds-
large-size_10-of-12">
<p class="slds-tile__title slds-truncate cpq-product-name">
{{::obj.Name.value}}</p>
</div>
<div class="slds-col slds-small-size_10-of-12 slds-medium-size_10-of-12 slds-
large-size_10-of-12">
<p class="slds-tile__title slds-truncate cpq-product-name" cpq-
translate="Product2.Name">{{::obj.Name.value}}</p>
</div>
Second Change
<span class=""slds-text-body_small"">
{{::importedScope.getPriceValue(obj, importedScope.nsPrefix
+'RecurringPrice__c')}}
</span>
<span class=""slds-text-body_small"" cpq-
translate=""PriceListEntry.DisplayText"">
{{::importedScope.getPriceValue(obj, importedScope.nsPrefix
+'RecurringPrice__c')}}
</span>
Third Change
<span class="slds-text-body_small">
{{::importedScope.getPriceValue(obj, 'UnitPrice')}}
</span>
<span class="slds-text-body_small" cpq-translate="PriceListEntry.DisplayText">
{{::importedScope.getPriceValue(obj, 'UnitPrice')}}
</span>
Fourth Change
<span ng-if="::obj[$root.nsPrefix + 'OneTimeLoyaltyPrice__c']">
<span class="slds-text-body_small">
{{::importedScope.customLabels.CPQOr}}</span>
<span class="slds-text-body_small cpq-loyalty-points">
{{::obj[$root.nsPrefix + 'OneTimeLoyaltyPrice__c'].value}}</span>
<span class="slds-text-body_small cpq-loyalty-points">{{::obj.LoyaltyCode}}</
span>
</span>
<span ng-if="::(obj[$root.nsPrefix + 'OneTimeLoyaltyPrice__c'].value ||
obj.LoyaltyCode)">
<span class="slds-text-body_small">
{{::importedScope.customLabels.CPQOr}} </span>
<span class="slds-text-body_small cpq-loyalty-points" cpq-
translate="PriceListEntry.DisplayText">{{::(obj[$root.nsPrefix +
'OneTimeLoyaltyPrice__c'].value || obj.LoyaltyCode) }}</span>
</span>
Fifth Change
<span class="slds-text-body_small cpq-loyalty-points">
{{::obj.LoyaltyCode}}
</span>
<span class="slds-text-body_small cpq-loyalty-points" cpq-
translate="PriceListEntry.DisplayText">
{{::(obj[$root.nsPrefix + 'OneTimeLoyaltyPrice__c'].value ||
obj.LoyaltyCode) }}
</span>
Sixth Change
<li ng-repeat="msg in obj.messages" class="slds-p-vertical_xx-small">
<span class="cpq-error-msg" ng-if="msg.severity ===
'ERROR'">{{msg.message}}</span>
<span class="cpq-warning-msg" ng-if="msg.severity !==
'ERROR'">{{msg.message}}</span>
</li>
<li ng-repeat="msg in obj.messages" class="slds-p-vertical_xx-small">
<span class="cpq-error-msg" ng-if="msg.severity === 'ERROR'" cpq-
translate="Product2.Name">{{msg.message}</span>
<span class="cpq-warning-msg" ng-if="msg.severity !== 'ERROR'" cpq-
translate="Product2.Name">{msg.message}</span>
</li>
cpq-product-item-details (template)
The cpq-product-item-details template provides the structure for each product in the Product Details dialog
box.
In Vlocity Communications, Media, and Energy Summer '18, cpq-product-item-details has been changed:
Template Type
Cards
Code
HTML, CSS/SCSS
Image
Upgrade from Vlocity CME Winter '18 to Vlocity CME Summer '18
When upgrading from Vlocity Communications, Media, and Energy Winter '18 to Vlocity Communications,
Media, and Energy Summer '18, you must make the following changes to the HTML in the Card Designer.
First Change
Second Change
<div class="cpq-product-item-table-row-item cpq-product-item-table-flex-recur
cpq-cart-item-attr-value">
{{::importedScope.getPriceValue(obj, importedScope.nsPrefix
+'RecurringPrice__c')}}
</div>
<div class="cpq-product-item-table-row-item cpq-product-item-table-flex-recur
cpq-cart-item-attr-value"
cpq-translate="PriceListEntry.DisplayText">
{{::importedScope.getPriceValue(obj, importedScope.nsPrefix
+'RecurringPrice__c')}}
</div>
Third Change
<div class="cpq-product-item-table-row-item cpq-product-item-table-flex-
onetime cpq-cart-item-attr-value">
{{::importedScope.getPriceValue(obj, 'UnitPrice')}}
<span ng-if="::obj[$root.nsPrefix + 'OneTimeLoyaltyPrice__c']">
{{::importedScope.customLabels.CPQOr}}
<span class="cpq-loyalty-points"> {{::obj[$root.nsPrefix +
'OneTimeLoyaltyPrice__c'].value}}</span>
<div class="cpq-product-item-table-row-item cpq-product-item-table-flex-
onetime cpq-cart-item-attr-value">
{{::importedScope.getPriceValue(obj, 'UnitPrice') |
CPQTranslateFilter:'PriceListEntry.DisplayText'}}
<span ng-if="::obj[$root.nsPrefix + 'OneTimeLoyaltyPrice__c']">  
{{::importedScope.customLabels.CPQOr}}
<span class="cpq-loyalty-points" cpq-
translate="PriceListEntry.DisplayText"> {{::obj[$root.nsPrefix +
'OneTimeLoyaltyPrice__c'].value}}</span>
Fourth Change
<div class="slds-tile__detail slds-text-body_small">
{{::obj.Product2.Description}}
</div>
<div class="slds-tile__detail slds-text-body_small" cpq-
translate="Product2.Description">
{{::obj.Product2.Description}}
</div>
Fifth Change
<ul class="scroll">
<!--Supporting only images as of now-->
SCSS Change
.#{$namespace}-product-item-table-row-item {
display: flex;
flex-flow: row nowrap;
flex: 1 0 auto;
In Summer '18, replace the CSS statements above with the following:
.#{$namespace}-product-item-table-row-item {
display: flex;
flex-flow: row nowrap;
flex: 1 0 33%;
cpq-product-item-more (layout)
The cpq-product-item-more layout renders the Product Details dialog box.
Template
cpq-product-item-more (template)
Data Source
Dual
Remote Class
CpqAppHandler
Remote Method
getCartsProductsById
Input Map
Input Map Variable Value
cartId {{params.id}}
id {{parent.Id.value}}
includeAttachment true
GET /vlocity_cmt/v2/cpq/carts/{{params.id}}/products?
id={{parent.Id.value}}&includeAttachment=true
Cards
cpq-product-details (card)
Image
cpq-product-item-more (template)
The cpq-product-item-more template provides the base structure for the Product Details dialog box.
Template Type
Flyout
Code
HTML, CSS/SCSS
Image
cpq-product-list (layout)
The cpq-product-list layout renders the product list in the cart.
In Vlocity Communications, Media, and Energy Summer '18, cpq-product-list has been changed—
localeCode is passed as a parameter to the data source for multi-language support.
Template
cpq-product-list (layout)
Name Value
totalSize payload.totalSize
nextProducts payload.actions.nextproducts
Data Source
Dual
Remote Class
CpqAppHandler
Remote Method
getCartsProducts
Input Map
GET /vlocity_cmt/v2/cpq/carts/{{params.id}}/products?
hierarchy=2&pagesize=10&fields=IsActive,Id,Name,UnitPrice,ProductCode,vlocity_c
mt__RecurringPrice__c
Cards
cpq-product-item (card)
Image
cpq-product-list (template)
The cpq-product-list template provides the structure for the product list in the cart.
Template Type
Containers
Code
HTML, CSS/SCSS
Image
cpq-promotion-item (card)
The cpq-promotion-item card renders each individual promotion line item in Vlocity Cart.
Title
promotionItem
Filter
None
Data Source
None
Remote Class
None
Remote Method
None
Input map
None
States
active
Template
cpq-promotion-item
Actions
None
Flyout
None
Conditions
None
Image
cpq-promotion-item (template)
The cpq-promotion-item template provides the structure for an individual promotion line item in Vlocity Cart.
In Vlocity Communications, Media, and Energy Summer '18, cpq-promotion-item has been changed to
provide multi-language support to translate Promotion Name, Promotion Code, and Promotion Description.
Template Type
Cards
Code
HTML, CSS/SCSS
Image
Upgrade from Vlocity CME Winter '18 to Vlocity CME Summer '18
When upgrading from Vlocity Communications, Media, and Energy Winter '18 to Vlocity Communications,
Media, and Energy Summer '18, you must make the following changes to the HTML in the Card Designer.
First Change
<div class="slds-col slds-small-size_10-of-12 slds-medium-size_10-of-12 slds-
large-size_10-of-12">
<p class="slds-tile__title slds-truncate cpq-promotion-
name">{{::obj.Name}}</p>
</div>
<div class="slds-col slds-small-size_10-of-12 slds-medium-size_10-of-12 slds-
large-size_10-of-12">
<p class="slds-tile__title slds-truncate cpq-promotion-name" cpq-
translate="Promotion.Name">{{::obj.Name}}</p>
</div>
Second Change
<div>
<span class="cpq-promotion-
label">{{::importedScope.customLabels.CPQPromoCode | uppercase}}: </span>
<span class="slds-text-body_small"> {{::obj[$root.nsPrefix+'Code__c']}}</
span>
</div>
<div>
<span class="cpq-promotion-
label">{{::importedScope.customLabels.CPQPromoCode | uppercase}}: </span>
<span class="slds-text-body_small" cpq-translate="Promotion.Code">
{{::obj[$root.nsPrefix+'Code__c']}}</span>
</div>
Third Change
<div>{{::obj.Description__c}}</div>
<div cpq-translate="Promotion.Description">{{::obj.description}}</div>
Fourth Change
cpq-promotions-list (layout)
The cpq-promotions-list layout renders the Promotions list in Vlocity Cart.
In Vlocity Communications, Media, and Energy Summer '18 and later releases, localeCode is passed as a
parameter to the data source for multi-language support.
Template
cpq-promotions-list (template)
Name Value
totalSize payload.totalSize
nextPromotion payload.actions.nextpromotions
Data Source
Dual
Remote Class
CpqAppHandler
Remote Method
getCartsPromotions
Input map
Input Map Variable Value
cartId {{params.id}}
includeIneligible {{attrs.includeIneligible}}
localeCode {{attrs.cpqUserLocale}}
Cards
cpq-promotion-item (card)
Image
cpq-promotions-list (template)
The cpq-promotions-list template provides the structure for the Promotions list in Vlocity Cart.
Template Type
Containers
Code
HTML, CSS/SCSS
Image
cpq-slds-prompt (layout)
The cpq-slds-prompt layout contains the cpq-slds-prompt template, which can be customized to create
prompts in Vlocity Cart.
Template
cpq-slds-prompt (template)
Data Source
No source
Cards
None
Image
None
cpq-slds-prompt (template)
The cpq-slds-prompt template enables you to customize prompts in Vlocity Cart.
Template Type
Containers
Code
HTML
Image
cpq-theme-variables (template)
The cpq-theme-variables template contains variables used in other templates.
Template Type
Mixin
Code
CSS/SCSS
Image
n/a
/***
***** CPQ THEME VARIABLES ****
Add only the theme file here. Don't add any code here.
It's easier to swap the theme here rather than swapping in every other
template.
If you swap the theme here, all templates will automatically get the latest.
NOTE
Note: You need to re save all the templates once you change the
theme. Also, if you change theme files, refresh the browser and
then save the templates.
***/
@import "cpq-base-theme-variables";
cpq-total-bar (layout)
The cpq-total-bar layout renders the total bar in the cart.
Template
cpq-total-card (template)
Data Source
Dual
Remote Class
CpqAppHandler
Remote Method
getCarts
Input Map
Input Map Variable Value
cartId {{params.id}}
price true
validate true
GET /services/apexrest/vlocity_cmt/v2/cpq/carts/{{params.id}}?
validate=true&price=true
Cards
cpq-total-bar-card
Image
cpq-total-bar (template)
The cpq-total-bar template provides the structure for the total bar in the cart.
In Vlocity Communications, Media, and Energy Summer '18, cpq-total-bar has had alignment changes to
one action, displayName, removed.
Template Type
Containers
Code
HTML, CSS/SCSS
Image
Upgrade from Vlocity CME Winter '18 to Vlocity CME Summer '18
When upgrading from Vlocity Communications, Media, and Energy Winter '18 to Vlocity Communications,
Media, and Energy Summer '18, you must make the following changes to the HTML in the Card Designer.
cpq-total-bar-card
The cpq-total-bar-card card renders the total bar in the cart.
Title
Total Card
Filter
None
Data Source
None
States
• Active Opportunity
• Active Quote
• Active Order
Template
cpq-total-card (template)
Actions
Flyout
None
Conditions
• ['ObjectType'] = 'Opportunity'
• ['ObjectType'] = 'Quote'
• ['ObjectType'] = 'Order'
Image
cpq-total-card (template)
The cpq-total-card template provides the text and buttons, as well as their styling, for the total bar in the
cart.
Template Type
Cards
Code
HTML, CSS/SCSS
Image
Asset-Based Ordering
An asset is a standard Salesforce object that represents an item of commercial value, such as a product or
service sold by your company or a competitor, that an account or contact owns. Vlocity extensions to the
Asset object support special features such as discounts, bundle pricing, cancellation fees, and customer
preferences.
Asset-based ordering is based on a customer's existing products and services. Assets are subscribed to
services and products.
Assets are created during the CPQ order management process. Whether an asset is created right away
depends on the product or service.
The asset provisioning status indicates the current state of the product or service:
• New: The order has been placed, but it has not been provisioned or activated.
• Active: The customer currently enjoys the asset. Until a service starts, an asset is not active.
• Deleted: The product or service is no longer available to the customer.
Many customer orders impact the products and services that the customer has already purchased. A
customer may want to modify their assets by:
Vlocity supports the creation of quotes and orders against a set of customer assets. In the first stage of
order capture, an opportunity moves to a quote and then to an order. With the completion of the order, the
order becomes an asset. If the customer wants to change the asset, revert the asset back to order status.
• A quote, and once the quote is complete, move the quote to an order, and then an asset
• An order, and once the order is complete, move the order to an asset.
Vlocity provides the ability to work across line items (XLI). Using Field Mapper, you map fields in the
Opportunity, Order, Quote, and Asset objects. For more information, see Map Fields for Asset-Based
Ordering.
Using Object Mapper, you can move data to and from any object. For more information, see Map Objects
for Asset-Based Ordering.
The customer sets the move in and move out dates, selects the move location, and generates an order to
disconnect assets from the original location and connect them to the new location.
Asset-based ordering ensures that data is accurately captured through any channel or device. You can add
first-level assets using a new opportunity to quote to order to asset cycle.
Each line item in an order has an asset reference ID. If the assets are created or mastered in Salesforce,
Vlocity populates the asset reference ID with a Global Unique Identifier (GUID). If the assets are created or
mastered in an external system, Vlocity populates the asset reference ID with the external reference ID.
The typical order flow includes a quote. The quote line item has an ID, such as Q001. When the quote
becomes an order, the order line item has an ID, such as O001. When the order becomes an asset, the
asset reference ID is based on the order line item ID (O001).
When the asset is used to create a quote, the quote line item ID changes, such as Q002. The asset
reference ID remains the same: O001. When that quote becomes an order, the order line item ID changes,
such as O002. The asset reference ID remains the same: O001. When you use the
RetireABOAssetImplementation, a new asset is created. When you use the
DefaultABOAssetImplementation, the old asset is updated. Either way, the asset reference ID remains the
same, O001.
See Also
• ABOAssetInterface
• DefaultABOAssetImplementation
• RetireABOAssetImplementation
• UseAssetReferenceIdForParentAndRoot
TIP
The FieldMapperInterface is triggered when copying a set of fields on one object to a
mapped set of fields on another object. Field Mapper is central to the asset-based ordering
process. See Map Fields for Asset-Based Ordering.
4. Click ABOAssetInterface.
5. Next to the appropriate implementation, click Edit.
You can also create your own implementation. See Interfaces, Implementations, and Services.
You begin the ordering process by creating an opportunity or a quote. The opportunity becomes a quote,
and the quote becomes an order. Each line item in an object has an ID. When the order is converted to an
asset, the provisioning status becomes active and the asset reference ID is set, based on the Order Line
Item object ID. See Asset Reference IDs.
After the first order and first asset have been created, you can change the asset to a quote or an order. As
the process continues, the provisioning status changes. When that order becomes a subsequent asset,
what happens to the asset depends on the ABOAssetInterface implementation. See Select the Asset-
Based Ordering Implementation.
When using asset-based ordering, the following fields must be populated on an OrderItem:
• Name
• AccountId
• Price
• Product2Id
• Quantity
• vlocity_cmt_LineNumber_c
• vlocity_cmt_OneTimeTotal_c
• vlocity_cmt_RecurringTotal_c
• vlocity_cmt_ProvisioningStatus_c
• vlocity_cmt_PricebookEntryId_c
• vlocity_cmt_ServiceAccountId_c
• vlocity_cmt_BillingAccountId_c
To submit an order and create assets using Vlocity Cart, make any necessary changes and click Create
Assets.
In all cases of asset-based ordering, you change an existing asset by moving it to:
• A quote, and once the quote is complete, you move the quote to an order
• An order
NOTE
If the Asset is part of a bundle or hierarchy, all of the Assets in that bundle or hierarchy
are selected.
When changing an asset to a quote or order, the line item quantities are disabled. This is because it is not
possible to change the line item quantities while converting an asset to a quote or an order.
TIP
Vlocity recommends using the cards-based Visualforce pages. The standard Visualforce
pages only list an account's assets, individually, without any indication of product hierarchy.
The cards-based Visualforce pages include product hierarchy.
Asset-based ordering uses three Visualforce pages, which appear on the Account object:
The following cards-based Visualforce pages appear on the Account, Opportunity, Order, or Quote objects:
To see the entire page name, you may need to hover over the page name in the object palette.
NOTE
As the names imply, the Review Order Cart readonly, Review Opportunity Cart readonly,
and Review Quote Cart readonly pages are read only. You cannot change the assets from
these Visualforce pages.
Assets with the provisioning status deleted are not displayed on the Asset Visualforce pages.
By default, the service account and billing account are the same as the asset's account. However, accounts
can be related to one another, so the billing account and service account may be different from one
another.
Multiple assets may have the same billing account, but different service accounts.
Field Mapper maps fields from one object to another to move it between objects. Vlocity provides a base
set of field mappings as part of the Vlocity Communications, Media, and Energy package. You must map
any additional fields to and from the following objects, as required:
• Opportunity to Quote
• Quote to Order
• Order to Asset
You can reset default field mappings by running the Field Maps Maintenance job.
Object Mapper moves data from one object to another. The Object Mapper can take more objects through
the asset-based ordering process. Object Mapper maps child line items and their related objects and fields.
For example, you may have created an object Subsidiary as a child of the line item object. You can specify
that Subsidiary is moved with the line item objects.
By default, asset-based ordering takes quotes, orders, assets, and their associated line items through the
process. You can add more objects using Object Mapper. If you do not specify an object mapping, only the
header and header line items are moved. If you specify an object map but the field mappings do not exist,
the process will not fail. However, a log entry notes this issue.
TIP
You can reset the object maps using the Object Maps Maintenance job under Vlocity CMT
Administration → Maintenance Jobs → Object Maps Maintenance job.
Object Mapper uses the custom object Custom Object Map (CustomObjectMap__c) to store the object
mapping, which has the following custom fields:
SourceParentObject__c
Destination Parent Object Stores the destination parent object name. Quote
DestinationParentObject__c
Source Child Object Stores the source child object name OpportunityLineItem
SourceChildObject__c
Destination Child Object Stores the destination child object name. QuoteLineItem
DestinationChildObject__c
Parent Source Reference Field Stores parent source reference field OpportunityId in OpportunityLineItem
PartentSourceReferenceField__c
Parent Destination Reference Field Stores child target reference field QuoteId in QuoteLineItem
ParentDestinationreferenceField__c
NOTE
Vlocity cannot create objects related to the OpportunityLineItem object. This is a
Salesforce limitation. See Child Object to Opportunity Product in the Salesforce Help.
To map objects:
1. Go to the Object Mapper tab.
NOTE
If you click Add in error, to delete the mapping, click the trash icon to the right of the
picklists. When the message opens, click Delete.
Vlocity Communications, Media, and Energy supports cross-line item (XLI) actions, in which line items
move from an opportunity to a quote to an order to an asset and then back again. The actions move order
information between objects and support moving data to or from any object.
Field Mapper supports the CPQ process to enable data movement between objects. You can move order
information between objects. You can move additional fields to each object by mapping fields from one
object to fields on another object. Using Field Mapper, you can move any field from any source object to
any field of the same type in any destination object.
From the Service Assets related list on an Account record, you can change one or more assets back to an
order or a quote.
When an order is complete, you can create assets from the products within an order.
For information on resetting the mappings to the out of box defaults and picking up any new fields that have
been added to the data model, see Field Maps Maintenance.
6. Click Select.
7. Select the new field on the source object.
NOTE
You can also select a relational field on the source object—for example,
Product2.Name.
8. The option you select in the first column may expose more columns. If so, select the appropriate
option.
9. Repeat steps 5 through 8 for each field to map.
NOTE
Except for ID fields, which can be mapped to fields of type reference, fields can only
be mapped to fields of the same type.
13. To add filters to mapped fields, go to Add a Filter to the Field Mapper.
Filters are inclusive and the conditions can be defined in a formula expression. If a formula is not indicated,
the filters will be joined through an and statement.
For example, the following image shows the filters to map fields from an opportunity to a quote if Status ≠
"active" and SLA = "Low".
Field Mapper creates entries in the Custom Field Map custom setting. However, to edit field mappings, you
go back into Field Mapper and select field mappings to edit such as for the Opportunity object and the
Contract object.
In-Flight Amendments
When you create and submit an order, the order status changes to in-progress, and Vlocity Order
Management (OM) processes it and fulfills the order. An in-flight order is an order (an original or
supplemental order) that is submitted and is not fulfilled. In Winter '20 and later, the In-Flight Amendments
feature enables you to amend or cancel your order by using supplemental or follow-on orders. If the order
or order items you submitted is still in progress and if the order or order items have not passed the point of
no return (PONR), Vlocity CPQ allows you to amend or cancel the order by creating a supplemental order.
If OM has fulfilled the order, you can amend the order by creating a follow-on order and submit the changes
to be queued until OM fulfills the original order. See Supplemental Orders and Follow-On Orders. Your
organization defines the PONR, as explained in Configuring the Point of No Return (PONR).
Supplemental Orders
A supplemental order is an order that Vlocity CPQcreates when you amend or cancel an in-flight order that
has not passed PONR. For example, when you submit an order in the Vlocity Cart, the order status
changes to in-progress for OM to process it further. However, if you want to make changes to the order you
submitted, such as change the color of the iPhone you selected or add a product, Vlocity CPQ creates a
supplemental order. You can amend, discard, or cancel a supplemental order. A supplemental order
replaces the original in-flight order, and Vlocity CPQ stops processing the original order after the
supplemental order is submitted. See Amend In-Flight Orders.
Vlocity CPQ creates a supplemental order only if an in-flight order has not passed PONR. When an order
passes PONR, you can neither modify nor cancel the order. See Follow-On Orders.
The In-Flight Order Amendment feature allows you to amend an in-flight supplemental order. A
supplemental order is said to be in-flight when you submit the supplemental order to OM but want to amend
the order before the order is fulfilled.
• You want to revise a submitted order. When you amend the order, Vlocity CPQ creates a supplemental
order and its status is set to Ready-to-submit. When you submit the order after making changes, the
original in-flight order is superseded, and the supplemental order is activated in Vlocity Order
Management.
• You want to revise a submitted order but later decided not to do so. When you amend the order, Vlocity
CPQ creates a supplemental order and its status is set to Ready-to-submit. After you submit it, you can
discard the supplemental order if needed. After you discard a supplemental order, the original order
status changes back to In-Progress.
• You created an order but want to cancel that order after you submitted it. When you cancel the order,
Vlocity CPQ creates a supplemental order with a cancel-request in progress. When you confirm the
cancellation, the original in-flight order is superseded and the original order is canceled. See Cancel an
In-Flight Order.
Follow-On Orders
When an in-flight order or order items have passed PONR, you can no longer modify the order or order
items. After an order line item passes PONR, it is grayed out, and you cannot change that order line item.
In such a scenario, Vlocity CPQ creates a follow-on order. A follow-on order captures the changes that you
want to submit after the original order is fulfilled. When you submit a follow-on order, it is queued in CPQ
until the original order is fulfilled and is then processed by Order Management. See Amend In-Flight
Orders.
See Also
If you want to cancel the original order, see Cancel an In-Flight Order.
1. From the App Launcher, search for Orders and open it.
2. From the orders list, select an order to amend.
3. In the tab for the order, select Amend from the menu.
You can also select Amend from the Vlocity Cart for the order.
CPQ creates a supplemental order with the order status set to Ready to Submit. The original order
status changes to Amend Requested.
4. As required, add, modify, or delete the cart line items. You can also modify, add, or cancel a promotion
and discount that applies to a line item.
You can modify a line item only if it has not passed the point of no return (PONR). PONR is a state in
the order fulfillment process after which you cannot modify an order, including a promotion or discount
that applies.
See In-Flight Amendments.
NOTE
After you complete amending the supplemental order, you can also discard the
changes before you submit the order for fulfillment.
To discard the changes you made to the order, from the cart actions, click the arrow
and then click Discard. CPQdiscards the supplemental order and the original order is
activated for order fulfillment. See Order Statuses in CPQ.
5. When you complete amending the supplemental order, click Submit order.
After you submit an amended order, the following status changes occur on the supplemental and the
original orders:
• OM accepts the order: The supplemental order status changes to In-Progress and the original order
is superseded.
• OM rejects the order: The supplemental order is rejected and the original order is activated.
• OM provisionally accepts the order: The supplemental order is provisionally accepted, its status is
set to In-progress, and the original order status changes to superseded. OM validates the submitted
order before accepting the order.
• OM provisionally accepts then rejects the order: The supplemental order is provisionally accepted.
However, OM rejects the supplemental order as it cannot process it for fulfillment. The original order
is activated.
NOTE
If the order is a follow-on order, the order is queued until the original order is fulfilled
by OM. See In-Flight Amendments.
See Also
• Cancel an In-Flight Order
• View Status Notifications for In-Flight Orders
• View Amendment History for In-Flight Orders
You submitted an order and Order Management (OM) accepted it for order fulfillment. If you want to cancel
the whole order or a few order line items within the order, you can send a cancellation request to the order
management system if the order or order items have not passed PONR. CPQ system creates a
supplemental order for canceling the order. When the cancellation is accepted by OM, the original order is
superseded, and the supplemental order is canceled.
You can also select Cancel from the Vlocity Cart for the order.
4. In the cancellation request window, click Next.
The system submits the cancellation request to OM. When OM accepts the cancellation, the original
order is canceled.
See Also
• In-Flight Amendments
For Winter '20 and later, the system creates a supplemental order with the intent of canceling the original order.
When the supplemental order is canceled the original order is superseded.
Queued The order is submitted and queued for order fulfillment.
Amend The original order was submitted to order management and accepted for fulfillment. You then amend the in-flight
Requested order. A supplemental order with an intent to amend is created and is submitted to order management.
Superseded The supplemental order is fulfilled successfully. When an order has a supplemental order that order management
accepts for the fulfillment, the original order is assigned a status of Superseded.
Results
The Order Amendment History opens for the selected order.
See Also
• In-Flight Amendments
• View Status Notifications for In-Flight Orders
• Order Statuses in CPQ
• Cancel an In-Flight Order
• Amend In-Flight Orders
Vlocity CPQ provides notification messages after you submit a supplemental order:
• Whether the order management system rejected or accepted an order item or supplemental order.
• What the status of an order or order item is, such as Activated or In Progress.
• Whether a supplemental order was converted to a follow-on order.
Results
The Order Management Notifications page shows the following information:
• The order ID, which includes a link to the Order Details page
• The message type, such as Order Activated
• The message content
• The date and time when the message was created
• The account associated with the order
• The account status, such as Activated
For descriptions of the different states, see Order Statuses in CPQ.
See Also
Prior to Fall '20, you had to cancel an in-flight order from the Cart.
See Also
• In-Flight Amendments
NOTE
This topic covers order cancellation for Vlocity releases Summer '18 through Fall '19. For
Winter '20 and later releases, see Cancel an In-Flight Order.
When Vlocity CPQ contacts the order management system and initiates the cancel request, it determines
whether the order has passed the point of no return (PONR) and updates the PONR fields on the order
header.
The CPQ interface expects a success or failure status on the supplemental order back from the order
management system. CPQ then processes the success or failure response and updates the status of the
supplemental order to, for example, Canceled.
When canceling a submitted order, the first few steps in the process are:
The order cancellation is then processed according to one of the following scenarios:
Cancel Success:
1. The order management system returns a status indicating that the original order has been canceled
successfully.
2. The original order is canceled, and the supplemental order is completed with a status of Activated.
Cancel Failed:
1. The order management system returns a status indicating that the original order cannot be canceled.
Therefore, the cancellation has failed.
2. The original order continues to progress with a status of In Progress. The supplemental order is not
processed by the order management system and is deleted.
1. CPQ waits for the order management system to return a synchronous call with a Success status. CPQ
does this by listening on the Streaming channel. The Streaming channel is a Salesforce feature that
monitors changes to Salesforce data. CPQ uses the Streaming channel for long-running cancel order
requests. The CPQ interface listens on the Streaming channel to check with the order management
system for the status of the supplemental order. The server is responsible for telling the client, which
has subscribed to Streaming Channel, when the request is complete, so the client does not have to
keep trying to contact the server. The server posts the response on the Streaming channel.
2. The original order is canceled, and the supplemental order is completed with a status of Activated.
1. The order management system may require more time to process and complete the cancellation
request before returning a synchronous call with a failed status. During this time, the order in CPQ
remains In Progress. Once the Failed status is returned, the supplemental order is deleted.
2. The original order continues to progress, with a status of Draft. The supplemental order is not
processed by the order management system and is deleted.
NOTE
This section covers the Order Management Interface for Vlocity CME releases Summer
'18 through Fall '19. For CME Winter '20 and later releases, see Order Management
Integration.
Ensure you have installed the latest package and performed the required post-installation steps, including:
Cancellation Process
Prior to CME Winter '20, when canceling an order, the following methods are invoked:
1. preValidate
Once Vlocity Cart's Cancel Order button is clicked, the UI calls the
SupplementalOrderService.preValidate interface, which then calls
XOMSuccessSupplementalOrderLifeCycle.preValidate to get a response from the order management
system. XOMSuccessSupplementalOrderLifeCycle.preValidate retrieves order status and changes
allowed from the order and returns true or false based on whether cancel order is allowed on the order.
This process checks whether the PONR for an order has been reached. PONR is evaluated based on
the order status and changes allowed field on the header. If the order status is In Progress and
changes allowed is true, PONR is returned as true. Otherwise, it is false.
In case PONR has not been reached for the order requested for cancellation, the order is canceled and
a supplemental order is created and submitted to the order management system.
preValidate has the following parameters:
• Input parameter: cartId = ID of the original order
• Output parameter: PONRStatus = true/false
The preValidate API determines if an order can be canceled. The API calls the Order Management
(XOM) system to retrieve the real-time PONR status.
• Action URL: /services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/prevalidate
• HTTP method: POST
• Method name: preValidate
• REST handler: APIPrevalidateCartsCPQV2
• Apex remote service: CpqAppHandler
• Response format: JSON
Sample Request
POST /services/apexrest/vlocity_cmt/v2/cpq/carts/8011I000000KnqDQAS/
prevalidate
Sample Response
{
"totalSize": 1,
"records": [
{
"actions": {
"cancelcart": {
"rest": {
"params": {},
"method": "POST",
"link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/
8011I000000KqTPQA0/cancel"
},
"remote": {
"params": {
"cartId": "8011I000000KqTPQA0",
"methodName": "cancelCart"
}
},
"client": {
"params": {}
}
}
},
"displaySequence": -1,
"user_vlocity_cmt__IsChangesAllowed__c": true,
"user_vlocity_cmt__OrderStatus__c": "In Progress"
}
]
}
2. submitCancelOrder
Once you click the Cancel Order confirmation button, the UI calls the CPQ interface
SupplementalOrderService.createAndSubmitCancelOrder. This interface calls
XOMSuccessSupplementalOrderLifeCycle.submitCancelOrder.
XOMSuccessSupplementalOrderLifeCycle.submitCancelOrder creates the second order (supplemental
order), appends the order ID of the original order, submits the supplemental order to the order
management systems, and returns the supplemental order ID in the response.
submitCancelOrder has the following parameters:
• Input parameter: cartId = ID of the supplemental order
• Output parameters:
• cancelOrderId = ID of the supplemental order
• submitStatus = complete/failed
The Cancel Order API cancels an order, creates a supplemental order, and submits it to the order
management (XOM) system. Once the order management system processes the supplemental order,
the API updates the original order to Canceled.
• Action URL: /services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/cancel
• HTTP method: POST
• Method name: cancelCart
• REST handler: APICancelCartsCPQV2
• Apex remote service: CpqAppHandler
• Apex remote input map: {}
• Response format: JSON
Sample Request
POST /services/apexrest/vlocity_cmt/v2/cpq/carts/8011I000000KnqDQAS/cancel
BODY {}
Sample Response
{
"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
}
]
}
3. submit
XOMSupplementalOrderLifeCycle.submit submits the order to the order management system.
submit has the following parameters:
• Input parameter: cartId = ID of the order
• Output parameter: submitStatus = Complete/Failed
The Cancel Requested status appears on the Cart:
4. createSupplementalOrder
Call this method if you want the ability to cancel the original request. For releases prior to CME Winter
'20, any supplemental order is treated as an order cancellation.
• Changes Accepted: The order management system acknowledges changes requested have been
accepted.
• Changes Allowed: The order management system notifies CPQ if the order has passed PONR. If so,
changes are not allowed. Changes Allowed enables the Cancel Order button on the Vlocity Cart.
Changes Accepted and Changes Allowed can both be left unchecked, but only one can be checked.
• Superseded Order: Links to the original order from which the request was initiated, and holds the
reference to the original order on the supplemental order.
• Order Status: Vlocity CPQ order status, which can be Ready To Submit, In Progress, Activated, Cancel
Requested, Cancelled and Completed. The status is automatically set to Ready To Submit for a new
order.
See Also
• Cancel Order
• Cancel a Submitted Order
• Create Supplemental Order
• Freeze Order
• Submit a Cancel Order Request
For example, a user is about to move from one home to another and wants to transfer the existing cable TV
service to the new home. However, the user plans to move within three days and requests the move of the
cable TV service to be completed after three days, that is, if today is Dec 1st, the user wants the move to
be completed on Dec 3rd.
Using the Future-Dated Orders feature, you can create a new order or modify an existing order that can be
submitted in the future. You can create a new order with the requested start date in the future or change an
existing order and set the requested start date in the future. When you submit a future-dated order, the
order moves into the queued order list.
NOTE
An order is queued only when the requested start date is in the future.
2. Using the Lightning App Launcher , search for Vlocity CMT Administration and open it.
3. Click Enable Features under Custom Settings.
4. Enable the Future-Dated Order queue option.
It is disabled by default. Click OK when prompted.
2. Create a future-dated order.
a. Using the Lightning App Launcher , search for Orders and open it.
The Orders page opens.
b. Click New to create a new order.
See Creating an Order Using Vlocity Cart.
2. It is possible to submit a queued future-dated order before its requested start date by clicking the
Force Submit action. A confirmation message appears stating that the assigned requested start
date will be ignored and the order will be submitted. The order is then removed from the queued
order list.
You can submit all orders at a time by clicking Submit All on the Queued Orders page. This
triggers a batch job schedule to submit all orders. You can use this option in case a batch job
submission is missed.
See Scheduling a Submit-Batch Job for Queued Orders.
NOTE
You can search for queued orders by the order number, order id, or account name
using the search option on the Queued Orders page.
1. Go to Vlocity App Launcher, search for Queued Orders and open it.
2. On the Queued Orders tab, select the future-dated queued order for which you want to schedule a
submit job.
3. Click Schedule Submit Job.
The Queued order dialog box is displayed.
4. Enter a Cron expression. A Cron expression is a time-based job scheduler typically used to execute
some routine. Cron expressions allow you to configure the frequency in which a batch job should run.
A default Cron value, 0 0 * * * ? is configured that runs the batch job every hour.
To change an order:
You can see existing promotions on the Promotions tab. From there, you can cancel promotions and search
the Promotions list for more promotions to update or add.
NOTICE
This topic applies to releases prior to Winter '20. For the current cancellation instructions,
see Cancel an In-Flight Order.
During the order cancellation process, CPQ consults with the order management system to check whether
PONR is reached for requested changes, and checks if order cancellation is completed successfully.
When you click Submit Order, CPQ invokes a Vlocity Action upon successful return, Vlocity Cart is
refreshed, the order status changes to In Progress, and the Submit button in the Total bar, along with the
entire Vlocity Cart, is read-only (grayed out). The Cancel Order button is shown in the Order Header
section.
• After submitting an order, click the Cancel Order button, which is available on the hybrid CPQ page.
Results
The following events occur:
• A synchronous API call returns an error if the order has reached PONR. The error is displayed on the UI
indicating it is too late to cancel the order.
• If PONR has not been reached, the API returns a new order ID. This new order is in Pending
Cancellation status while the order on which the Cancel request was initiated is in Superseded status.
• The page reloads and Vlocity Cart is refreshed. The order status shows Canceled upon successful
cancellation. The newly created supplemental order is read-only. All the buttons, including Submit Order,
are grayed out and not clickable.
If the order cancellation failed, you receive an error message similar to that shown in the following
example:
See Also
Configuring the Cancel Order Feature.
• Field sets are available for opportunity and quote line items but not for order line items.
• Custom settings are available for all objects.
If neither fieldsets nor custom settings are present for the object, then the user sees the default set of
columns:
• Product Name
• Quantity
• One Time List
• One Time Discount
• One Time Total
• Monthly List
• Monthly Discount
• Monthly Total
• Provisioning Status
• Premises
• Service Location
• Billing Account
NOTE
The Opportunity, Order, and Quote Managers are being deprecated in favor of the Vlocity
Cards-based user interface, also known as Vlocity Cart.
• Field Set Name is the name of the field set on the Visualforce page.
• Where is this used? provides a description of which Visualforce pages use the field set and for
what purpose.
5. Click Save.
6. Drag each field to include in the Opportunity Manager from the palette into the In the Field Set list.
The list sequence is the sequence in which the field sets will appear in the review cart.
7. Click Save.
8. From Setup, in the Quick Find box, enter Custom Settings.
9. Click Custom Settings.
10. Next to FieldsConfiguration, click Manage.
11. Click New.
12. On the FieldsConfiguration Edit page, enter the following information:
NOTE
The Opportunity, Order, and Quote Managers are deprecated. Use the Vlocity Cards-
based user interface, also known as Vlocity Cart.
1. In your org, go to Setup, search for Custom Settings, and then click Custom Settings.
2. Click the Manage link on Next to Field Settings.
The Field Settings Detail page appears.
3. Click New.
4. Enter the details for the following:
• Name: Enter a name for your field with a maximum of 38 characters. This value must be unique
across objects because Salesforce will not allow you to save duplicate custom settings. As a best
practice, add a short prefix to the API name of your field. For example, use the OI prefix for
OrderItem, QLI for QuoteLineItem, and OLI for OpportunityLineItem.
6. Update the line item. If you have attribute-based pricing with outputs to custom fields, you must
implement the following CpqAppHandler hook or the custom fields will not populate:
/
***************************************************************************
*****************************
* @description This is a hook implementation of the open Vlocity
interface. It acts like a trigger handler for the Vlocity CPQ API.
* @group Vlocity Interface implementations
***************************************************************************
******************************/
@TestVisible
global with sharing class CpqAppHandlerHookImplementation implements
vlocity_cmt.VlocityOpenInterface {
public Boolean InvokeMethod(String methodName, Map <String, Object>
input, Map<String, Object> output, Map <String,Object> options) {
if (methodName.equalsIgnoreCase('putCartsItems.postInvoke')) {
System.debug('######## putCartsItems.postInvoke #########' );
putCartsItems_postInvoke(methodname, input, output, options);
return true;
}
return false;
}
private void putCartsItems_postInvoke(String methodName, Map <String,
Object> input, Map<String, Object> output, Map <String,Object> options){
//System.debug('######## inside putCartsItems_postInvoke #########' );
Vlocity_cmt.JSONResult res = (Vlocity_cmt.JSONResult)
output.get('result');
//System.debug('res-->'+res);
vlocity_cmt.JSONAction priceAction =
res.actions.get('itempricesupdated');
//system.debug('$$$$$before: priceAction-->'+priceAction);
//system.debug('$$$$$before: priceAction.remote.params--
>'+priceAction.remote.params);
String fields =
'vlocity_cmt__BillingAccountId__c,vlocity_cmt__ServiceAccountId__c,Quantity
,vlocity_cmt__RecurringTotal__c,vlocity_cmt__OneTimeTotal__c,vlocity_cmt__O
neTimeManualDiscount__c,vlocity_cmt__RecurringManualDiscount__c,vlocity_cmt
__ProvisioningStatus__c,vlocity_cmt__RecurringCharge__c,vlocity_cmt__OneTim
eCharge__c,ListPrice,vlocity_cmt__ParentItemId__c,vlocity_cmt__BillingAccou
ntId__r.Name,vlocity_cmt__ServiceAccountId__r.Name,vlocity_cmt__PremisesId_
_r.Name,vlocity_cmt__InCartQuantityMap__c,vlocity_cmt__EffectiveQuantity__c
,customer_Ceiling_Price__c,customer_Discount_Percentage__c,customer_Floor_P
rice__c,customer_Floor_Percentage__c,customer_Customer_Requested_Percentage
__c,customer_Customer_Requested_Price__c,customer_Approved_Price__c,custome
r_Approved__c,customer_Flag__c,customer_ProductType__c,customer_Quote_Recor
dType__c';
string
priceDetailsfields='vlocity_cmt__RecurringTotal__c,vlocity_cmt__OneTimeTota
l__c,vlocity_cmt__OneTimeManualDiscount__c,vlocity_cmt__RecurringManualDisc
ount__c,vlocity_cmt__RecurringCharge__c,vlocity_cmt__OneTimeCharge__c,ListP
rice,customer_Ceiling_Price__c,customer_Floor_Price__c,customer_Customer_Re
quested_Price__c,customer_Approved_Price__c,customer_Flag__c';
priceAction.remote.params.put('fields', fields);
priceAction.remote.params.put('priceDetailsFields', priceDetailsfields);
//system.debug('$$$$$after: priceAction-->'+priceAction);
//system.debug('$$$$$after: priceAction.remote.params--
>'+priceAction.remote.params);
}
global class CpqHookException extends Exception{}
}
7. Make sure to update the following lines:
• String fields = '...';: Comma-separated list of all your custom fields to display on the cart.
Have this query the Field Settings custom setting and populate from there.
• String priceDetailsfields = '...';: Comma-separated list of only pricing-related fields.
These are typically currency or number fields and not lookup fields. You might have unexpected
behavior if you add non-pricing fields. Add your custom fields one at a time and test after you add
each field.
IMPORTANT
For price-related fields, use currency fields and calculate their value as part of a
pricing plan step. Do not use formula fields for pricing.
System.debug(ex.getMessage());
doQuery = true;
}
if (!doQuery) return;
//test it
try {
for (String customField: customFields) {
Object val = itemList[0].get(customField);
System.debug('***' + customField + ' ' + val);
}
} catch (Exception ex) {
System.debug(ex.getMessage());
}
}
}
// Create products
Product2 prod1 = new Product2(Name = 'Product 1', ProductCode = 'PROD1');
sObjList.add(prod1);
insert sObjList;
sObjList.clear();
insert sObjList;
sObjList.clear();
orderItem2.vlocity_cmt__Action__c = 'Add';
orderItem2.vlocity_cmt__ProvisioningStatus__c = 'New';
orderItem.TestCustom__c = 'Good';
orderItem.TestCustom2__c = 'Morning';
sObjList.add(orderItem2);
insert sObjList;
sObjList.clear();
Test.startTest();
List<SObject> itemList = [SELECT Id, PricebookEntry.Id,
PricebookEntry.Product2.Name, Quantity, vlocity_cmt__LineNumber__c,
vlocity_cmt__Action__c, vlocity_cmt__ProvisioningStatus__c from OrderItem
where OrderId =: testOrder.Id
];
Map <String, Object> input = new Map<String, Object>();
Map <String, Object> output = new Map<String, Object>();
Map <String, Object> options = new Map<String, Object>();
CustomAddFieldsPricingPlanStepImpl pStep = new
CustomAddFieldsPricingPlanStepImpl();
vlocity_cmt.PricingPlanService.putInPricingContext('LineItemList',
itemList);
Test.stopTest();
} catch (Exception e) {
System.debug('Exception: ' + e.getMessage());
throw e;
}
}
}
See Also
The cards contained in a layout and template are responsible for rendering the cart and tailoring the cart to
your needs, such as hiding columns and adding new columns. By examining the data source configured on
the card layout, you can see that it calls a CPQ API named CpqAppHandler.getCartsItems(). This
returns all the products currently in Vlocity Cart. The API takes several arguments, including the fields
parameter that controls which fields are returned in the API for each product.
cpq-getCartsItems-sample.json is an example of the data pulled back from the API. A subset of
the response is presented to the cards through the Result JSON Path = records configured in
the layout.
3. Click Clone. This creates a new layout that you can customize.
4. Open the active card within the layout and deactivate it. You need to clone this card to customize it.
5. Click Clone. If you are using the CME VDO instance, do not clone the card that indicates Version
Legacy because this card is no longer used and will cause issues in Vlocity Cart, such as opening a
blank page.
After cloning the card layout, it should contain an active card named cpq-product-cart-item. You can
ignore any inactive versions of this card that appear.
6. Set the card name to cpq-product-cart-item and update the card author.
1. Clone the cpq-product-cart layout and its cpq-product-cart-item card as detailed above so you can
make changes to it.
2. If necessary, deactivate the layout and the card.
3. On the Layout, locate the fields parameter. This is a comma-separated list of product fields that are
queried as part of the API call to getCartsItems().
• If the field you want to add to your cart is being queried, you can add it to the card state. Examine
the fields parameter to see if the field you want appears. The following is an example from a CME
org but it may differ based on vertical or version:
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_c
mt__ProvisioningStatus__c,vlocity_cmt__RecurringCharge__c,vlocity_cmt__One
TimeCharge__c,ListPrice,vlocity_cmt__ParentItemId__c,vlocity_cmt__BillingA
ccountId__r.Name,vlocity_cmt__ServiceAccountId__r.Name,vlocity_cmt__Premis
esId__r.Name,vlocity_cmt__InCartQuantityMap__c,vlocity_cmt__EffectiveQuant
ity__c
• If the field does not appear in the list, you can append it to the list. The following example shows how
to add a custom field named vlocity_cmt__LineNumber__c.
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_c
mt__ProvisioningStatus__c,vlocity_cmt__RecurringCharge__c,vlocity_cmt__One
TimeCharge__c,ListPrice,vlocity_cmt__ParentItemId__c,vlocity_cmt__BillingA
ccountId__r.Name,vlocity_cmt__ServiceAccountId__r.Name,vlocity_cmt__Premis
esId__r.Name,vlocity_cmt__InCartQuantityMap__c,vlocity_cmt__EffectiveQuant
ity__c,vlocity_cmt__LineNumber__c
To see which fields are available, navigate to Setup > Object Manager > Order Product, Quote Line
Item, or Opportunity Product.
The data source for this layout is of type Dual. This means the API query is performed using Apex
when running on a desktop computer, while a REST call is performed while running on a mobile
device. If you want your new columns to be available on both desktop and mobile versions of Vlocity
Cart, then add the fields to the endpoint under the Mobile Hybrid ApexRest configuration section:
5. Add the new column to the card state. Each regular field is presented to the cards using the JSON
object.
6. Within the card state, configure the entry as shown in the example diagram.
Rather than obtaining the label used in the cart from the JSON data, you can hard-code the label to
something more suitable.
After activating the card and layout, the resulting cart page should look as shown in the following example:
1. Clone the cpq-product-cart layout and cpq-product-cart-item card so you can make changes to
them.
2. Deactivate the layout and the card.
3. On the layout, locate the fields parameter. This is a comma-separated list of product fields that are
queried as part of the API call to getCartsItems(). These fields contain the ID of another object within
the Salesforce data model. Instead of displaying the raw ID of that object, you can display a user-
friendly value, such as the object's name.
To query the appropriate field, add the lookup field name (replace __c with __r) and the name of the
field on the lookup object in which you are interested. You may see some examples of this already
configured, such as:
vlocity_cmt__BillingAccountId__r.Name,vlocity_cmt__ServiceAccountId__r.Name
,vlocity_cmt__PremisesId__r.Name
If you want another field, such as the type of service account, you can add it using the same syntax:
vlocity_cmt__BillingAccountId__c,vlocity_cmt__ServiceAccountId__c,Quantity,
vlocity_cmt__RecurringTotal__c,vlocity_cmt__OneTimeTotal__c,vlocity_cmt__On
eTimeManualDiscount__c,vlocity_cmt__RecurringManualDiscount__c,vlocity_cmt_
_ProvisioningStatus__c,vlocity_cmt__RecurringCharge__c,vlocity_cmt__OneTime
Charge__c,ListPrice,vlocity_cmt__ParentItemId__c,vlocity_cmt__BillingAccoun
tId__r.Name,vlocity_cmt__ServiceAccountId__r.Name,vlocity_cmt__PremisesId__
r.Name,vlocity_cmt__InCartQuantityMap__c,vlocity_cmt__EffectiveQuantity__c,
vlocity_cmt__LineNumber__c,vlocity_cmt__ServiceAccountId__r.Type
The data source for this layout is of type Dual. This means the API query is performed using Apex
when running on a desktop computer, while a REST call is performed while running on a Mobile
device. To make your new columns available on both desktop and mobile versions of Vlocity Cart, add
the fields to the endpoint under the Mobile Hybrid ApexRest configuration section. Ensure the fields
are not already present:
To work around this limitation, add the lookup field within the card state.
6. Locate the card state named cart Item that uses a template named cpq-product-cart-item. This
template renders the top-level cart items. There a separate, similar template for rendering child-level
cart items that you will need to update later.
7. From the card state, click the template to open it.
8. Clone the template and ensure you keep the same template name, cpq-product-cart-item, but
change the Author.
9. Within the template's HTML section, scroll down until you find the following section:
If the new columns do not appear, try clearing your browser cache.
The Service Account Name is only displayed for the top-level items in the cart because child-level
items use a separate template. Therefore, you need to update child-level items as well.
1. Locate the active template named cpq-product-cart-item-child. Clone this template. Keep the name
as-is, but change the Author.
2. Within the template's HTML section, scroll down until you find the following section:
[customField.name.subst ring(customField.name.lastIndexOf('[\'') + 2,
customField.name.lastIndexOf('\']'))]}}</div>
4. Activate the cpq-product-cart-item-child template.
After activating the Card and Layout, the resulting Cart page should look as follows.
If the new columns do not appear, try clearing your browser cache.
To add fields to the Order Manager review cart using custom settings:
The sequence in which you create the custom settings determines the sequence in which the columns
appear in the Review Cart.
NOTE
The Opportunity, Order, and Quote Managers are being deprecated in favor of the Vlocity
Cards-based user interface, also known as Vlocity Cart.
Customize the Summary Header for the Opportunity, Order, and Quote
Managers
You can configure the Opportunity, Order, and Quote Manager Visualforce components to include a
summary header. You can also customize the fields that appear in the summary header.
The steps in this exercise are for the Order Manager, but the same steps apply to the Opportunity and
Quote Managers.
NOTE
To disable the Summary Header, change the Setup Value to False or delete this record for
the custom setting.
The steps in this exercise are for the Opportunity Manager, but the same steps apply to the Quote
Manager.
1. Enable the summary header in the user interface. For more information, see Enable the Summary
Header Using Custom Settings.
2. From Setup, click Customize, and then click Opportunities, and then click Field Sets.
3. Click New.
4. Create a new field set by providing a name and label, for example, OpportunityConf.
5. Select any of the fields in the sequence in which to display them:
NOTE
You must select the fields in the sequence in which to display them. You cannot
rearrange the fields later.
6. Click Save.
7. From Setup, click Develop, and then click Custom Settings.
8. Next to FieldsConfiguration, click Manage.
9. Create a new record by clicking New.
10. Enter the values as shown in the screenshot.
This example uses a name in the format Feature.Object—for example, Application.Opportunity—
which tells us that this configuration is for an Opportunity object that the Application user interface
uses. However, the format for this name is not constrained. You can enter any unique name.
11. Select IsActive.
You can have many field sets for the same object and feature. The API uses the active field set.
12. Click Save.
13. Go to any Opportunity and you can see the header with the fields that you added to the field set.
For more information about header summary Visualforce page fields, see Header Summary, Mini-Cart, and
Review Cart Fields.
1. Enable the summary header. For more information, see Enable the Summary Header Using Custom
Settings or Enable the Summary Header Using Field Sets.
2. From Setup, click Develop, and then click Custom Settings.
3. Next to Field Settings, click Manage.
This is the custom setting that enables you to define fields to use for objects.
4. Click New.
5. Enter the values as shown in the screenshot.
This example uses a name in the format Feature.Object.FieldName —
Application.Order.AccountName—which will add Account Name as one of the fields to show for the
Order Summary, which the application user interface uses. However, the format for this name is not
constrained. You can enter any unique name.
6. Using these steps, configure all fields that you want on the layout.
NOTE
You cannot customize the sequence of these fields. The fields are displayed in the
sequence in which you insert them in the custom setting.
NOTE
The fields in the Mini-Cart or Preview Cart cannot be customized.
Do not use the Salesforce Sync Quote button to sync a quote with an opportunity. Doing so will result in an
error such as the following:
Vlocity recommends removing the standard Salesforce Sync Quote button to avoid confusion. For more
information, see Page Layouts in the Salesforce Help.
1. On the Quote record detail page, in the Quote Manager, click Review Cart.
2. Click Sync to Opportunity.
NOTE
The Opportunity, Order, and Quote Managers are deprecated. Use the Vlocity Cards-
based user interface, also known as Vlocity Cart.
The Salesforce Help contains several topics about orders, including the following:
• Orders
• Guidelines for Creating Orders
• Order Fields
You can create an order from a quote or create a new order on its own.
WARNING
Do not create an order by cloning a previous order. The Clone button in the Salesforce
Classic (Aloha) interface is not intended to work with Vlocity orders and can cause serious
errors.
3. Click Save.
4. On the Order record detail page, use the Order Manager to add products and services to the order.
• The Filter list provides a list of defined categories you can use to find specific products and services.
Expand any list heading and select the appropriate options.
• The Products list provides a list of products and services that correspond to the options you
selected in the Filter list. To add a product to the cart, click Add to Cart. To configure a product, click
Configure Product. See Configure a Product.
• The Preview list displays the products in the cart. To see the cart contents, click Review Cart. To
submit the order, click Submit Order. If compatibility rules require or recommend other products or
services, an error message appears in the preview.
When using asset-based ordering, the following fields must be populated on an order:
• Name
• AccountId
• Price
• Product2Id
• Quantity
• vlocity_cmt_LineNumber_c
• vlocity_cmt_OneTimeTotal_c
• vlocity_cmt_RecurringTotal_c
• vlocity_cmt_ProvisioningStatus_c
• vlocity_cmt_PricebookEntryId_c
• vlocity_cmt_ServiceAccountId_c
• vlocity_cmt_BillingAccountId_c
Configuring a Product
You can configure a product in the Opportunity Manager, Order Manager, Opportunity Manager, or review
cart. You configure a product that has already been added to the catalog. For more information about
setting up products, see Creating a New Product.
To configure a product from the Opportunity Manager, Order Manager, or Quote Manager:
1. In the Opportunity Manager, Order Manager, or Quote Manager, find the product to configure.
2. Click Configure Product.
The Configure Product Visualforce page opens. The criteria you can configure depends on the product
you chose.
3. When you are finished configuring the product, click Add to Cart.
1. In the Opportunity Manager, Order Manager, or Quote Manager, add the product to the cart.
2. In the Preview list, next to the product to configure, click the Configure Product icon, which
resembles a cog.
3. The Configure Product Visualforce page opens. The criteria you can configure depends on the product
you chose.
4. When you are finished configuring the product, click Save.
NOTE
The Opportunity, Order, and Quote Managers are being deprecated in favor of the Vlocity
Cards-based user interface, also known as Vlocity Cart.
NOTE
The Opportunity, Order, and Quote Managers are being deprecated in favor of the Vlocity
Cards-based user interface, also known as Vlocity Cart.
NOTE
For details about adding pre- and post-processing logic, see Adding Pre- and Post-
Processing Logic.
This mechanism enables customers to override a function of the default JavaScript controller. The function
must meet the following criteria:
Controller Functions
CPQPromotionItemController $scope.beforeAddToCartHook(payload)
$scope.afterAddToCartHook(payload)
CPQPromotionsController $scope.beforeDeletePromotionItemHook(payload)
scope.afterDeletePromotionItemHook(payload);
CPQCartItemController $scope.beforeAddToCartHook(payload)
$scope.afterAddToCartHook(payload);
$scope.beforeDeleteItemFromCartHook(payload)
$scope.afterDeleteItemFromCartHook(payload)
TIP
Using this approach to override functions decreases maintenance and the risk of missing
functionality in future releases. It also decreases maintenance needs.
To override a controller:
CPQOverrideService.addToOverrideList('CPQCartItemController',
overrideFunctions);
}]);
Example
$scope.beforeAddToCartHook = myBeforeAddToCartHookMethod(myHookPayload)
{...logic goes here...};
CPQPromotionItemController:
• $scope.beforeAddToCartHook(payload);
• $scope.afterAddToCartHook(payload);
CPQPromotionsController:
• $scope.beforeDeletePromotionItemHook(payload);
• $scope.afterDeletePromotionItemHook(payload);
CPQProductItemController:
• $scope.beforeAddToCartHook(payload);
• $scope.afterAddToCartHook(payload);
CPQCartItemController:
• $scope.beforeAddToCartHook(payload);
• $scope.afterAddToCartHook(payload);
• $scope.beforeDeleteItemFromCartHook(payload);
• $scope.afterDeleteItemFromCartHook(payload);
• $scope.getAlternativePaymentFieldMapHook(data);
Creating an Opportunity
Opportunity represents a sale or pending deal. Order capture uses opportunities for business accounts.
Opportunities include details about the stage of an opportunity cycle—for example, in process or
completed. If an opportunity becomes a quote or an order, information from the opportunity moves forward.
Opportunities are identified by their stage, such as prospecting, identifying decision-makers, or negotiation/
review. Opportunities also include the projected success, in percentages. Order capture fully integrates
opportunities, quotes, and orders to accommodate asset-based ordering.
To create an opportunity:
1. On the Opportunities tab, click New.
2. Enter the following required information:
• Opportunity Name is a name for the opportunity.
• Account Name is a lookup to the account with which the opportunity is associated.
• Close Date is the date on which you plan to close the opportunity,
• Stage is the current stage of the opportunity.
See Opportunity Fields in the Salesforce Help.
3. Click Save.
4. On the Opportunity record detail page, use the Opportunity Manager to add products and services to
the opportunity.
• The Filter list provides a list of defined categories you can use to find specific products and services.
Expand any list heading and select the appropriate options.
• The Products list provides a list of products and services that correspond to the options you
selected in the Filter list. To add a product to the cart, click Add to Cart. To configure a product, click
Configure Product. For more information about configuring products, see Configure a Product.
• The Preview list displays the products in the cart. To see the cart contents, click Review Cart. To
create a quote based on the items in the cart, click Create Quote.
NOTE
If compatibility rules require or recommend other products or services, an error
message appears in the preview. See Compatibility Rules.
Cloning an Opportunity
You can create an opportunity to use as a template for other opportunities and clone it.
See Also
See the following topics about opportunities in the Salesforce Help:
• Opportunities
• Guidelines for Creating Opportunities
• Opportunity Fields
Creating a Quote
The Quote object represents a quote, which is a record that includes proposed prices for products and
services. You can create quotes from and sync them with opportunities. You can email quotes as PDF files
to customers. Vlocity Communications, Media, and Energy captures additional information, such as
originating source or campaign, installation ZIP code, state, associated purchase order, and one-time or
recurring charges. Vlocity Communications, Media, and Energy integrates opportunities, orders, and quotes
to accommodate asset-based ordering.
• Quotes
• Quotes Fields
To set up a quote:
1. Create an opportunity.
2. In the Opportunity Manager, click Create Quote.
All quotes must be associated with opportunities. When you create a quote from an opportunity, you can
change the quote and sync a quote with its opportunity. For more information, see Synchronizing a Quote
with an Opportunity.
Pricing Definition
Vlocity enables you to price products and promotions according to your business requirements. You have
the flexibility to adjust prices, use loyalty points, or change prices over time.
• Reusability: A component-oriented system with reusable items that are independent from products
• Pricing types: Categories of pricing such as penalties, charges, and adjustments to existing charges
• Frequency: Settings that determine the frequency of the charge
• Updates: Transition from previous prices to updated prices for less expense and disruption
Pricing Components
In order to price a product, you must create price lists, pricing variables, and pricing elements. You can also
create time plans and time policies as needed.
• Price lists contain the price list entries and pricing elements.
• Pricing variables indicate the type of price.
• Pricing elements contain the amount.
Price Lists
You can assign more than one base price to a product by creating price list entries stored in different price
lists. Each price list must be associated with a price book.
Using multiple price lists, you can assign more than one base price to a product by creating price list entries
stored in different price lists.
For example, you may want to separate customer pricing from wholesale and employee pricing by creating
price lists for each of these categories. You can apply context rules to determine which price list applies.
You can use one price list that contains more than one base price list entry for a single product.
Salesforce requires a price book. Every price list must be associated with a price book. Typically, only one
price book is required. You can associate multiple price lists to one price book.
For more information about price books, see Products Concepts in the Salesforce Help.
A child price list inherits all the pricing from its parent price list. You can include exceptions to the parent
price list in the child price list.
You can use multiple price lists. For example, you can separate wholesale pricing from retail pricing by
creating a wholesale price list and a retail price list. You can apply a context rule to a price list so that an
order for a wholesale account always uses the wholesale price list.
1. Go to the Product Console. For more information, see Navigating to the Vlocity Product Console.
2. Next to Price List, click Create .
3. On the New Price List page, complete the General Properties section.
• Name is a name for the price list.
• Code is a unique code.
• Description is a description for the price list.
• In the Price Book field, search for and select the price book to associate with the price list.
• In the Parent Price List field, if this price list is a child price list, search for and select the parent
price list.
• Sequence specifies a sequence in the list of price lists.
• Currency Code is the currency code used in the price list.
• Loyalty Code is the indicator for loyalty points.
4. Complete the Effectivity section.
• To use the price list , select Is Active .
• Click the Effective From field and select a date the price list becomes effective and available for
use.
5. Click Save.
The following tables explain the fields to complete for a price list.
You can change the price of a product over time with multiple price list entries that have different, non-
overlapping effectivity date ranges. For example, to reduce the base price of a product by 10% each month,
you can create multiple base price list entries as shown in the following table.
You can also use effectivity date ranges to reprice products. As shown in the following table, one product
has multiple base price list entries. When one price list entry expires, the next price list entry becomes
effective.
If effectivity date ranges overlap, you can use context rules to determine which price list entry applies.
Although effectivity date ranges work with the product life cycle, neither is dependent on the other.
Pricing Elements
A pricing element consists of a pricing variable, an amount, and a payment type. Pricing elements can be
either charges or adjustments.
When you create a price list entry and you don’t see the price you need in the list of prices with their
currency and types, you must create a new pricing element.
NOTE
If you need to set up pricing elements for usage-based pricing for energy, see Enable
Usage Pricing. To enable usage-based pricing, you must complete a set of steps in a
specific order.
1. Go to the Product Console. For more information, see Navigating to the Vlocity Product Console.
2. Find and open the price list where you want to create the pricing element charge.
3. Click Standalone Pricing Elements.
4. Click New.
5. In the configuration panel in the Pricing Variable section, enter the search criteria to find the
appropriate pricing variable to associate with the pricing element charge.
• From the Charge Type picklist, select whether the amount is charged once or on a recurring basis.
• If you selected the recurring charge type, from the Frequency picklist, select the frequency of the
recurrence.
• From the Sub-Type picklist, select whether the charge is a standard charge or a penalty fee.
• From the Type picklist, select whether the charge is a price or a cost.
6. Click Search.
7. In the search results, select the pricing variable to assign to the pricing element. If you do not see the
pricing variable you want, you must create it. See Creating a Pricing Variable.
The following tables explain the fields to complete for creating a pricing element charge.
1. Go to the Product Console. For more information, see Navigating to the Vlocity Product Console.
2. Find and open the price list in which to create the pricing element charge.
3. Click Standalone Pricing Elements.
4. Click New.
5. In the Pricing Variable area, enter the search criteria to find the appropriate pricing variable to
associate with the pricing element adjustment.
• From the Charge Type picklist, select whether the adjustment is applied once or on a recurring
basis.
• If you have chosen the recurring charge type, from the Frequency picklist, select the frequency of
the recurrence.
• From the Sub-Type picklist, select whether the charge is a standard adjustment or a penalty fee.
• From the Type picklist, choose whether the adjustment is a price or a cost.
6. Click Search.
7. In the search results, click the pricing variable to assign to the pricing element adjustment. If you do not
see the pricing variable, you must create it. See Creating a Pricing Variable.
8. Complete the General Properties section.
• Name the pricing element adjustment. Make sure the pricing element name indicates as much
information about the adjustment as possible, such as the currency or percentage, amount, and how
often it recurs, if applicable.
• Enter a unique code. This code identifies the individual pricing element. Make sure there are no
spaces or special characters. Hyphens (-) and underscores (_) are allowed.
• In the Display Text field, enter the amount, currency, or percentage, and whether the adjustment is
a price increase or decrease.
9. Complete the Currency Value section.
a. The Calculation Type and Adjustment Method are pre-populated.
b. In the Adjustment field, enter the amount or percentage. If the adjustment is a price decrease,
enter the minus sign (-) before the amount or percentage.
10. Complete the Effectivity section.
• Click the Effective From field and select the date the pricing element is available for use.
• Select Active to make the pricing element active and available for use.
11. Click Save.
The following tables explain the fields to complete when creating a pricing element adjustment.
decimal separator based on the customer location and currency. It displays the appropriate decimal
separator when calculating the Monthly Recurring Charges (MRC) and Non-Recurring Charges (NRC).
For calculating charges on products, typically, two decimal places are used in the calculations. However,
Vlocity Cart allows you to use additional decimal places for calculating one-time and recurring charges of
your products in usage-based pricing. This feature is useful in calculating the prices of products marked
with four decimal places.
For example, a customer wants to purchase 10 GB Internet data for which you apply charges based on per-
unit price. If the per-unit charge is .0020 Cents per MB, you can calculate the data charges accurately using
the additional decimal places.
1. On the Vlocity App Launcher, search for Vlocity Cards and open it.
The Vlocity Layouts & Cards page opens.
2. Search for cpq-base-grid and click on the arrow to expand it.
3. Click on a cpq-base-grid layout version.
The cpq-base-grid layout page opens.
4. Click Clone.
The Clone Layout dialog box is displayed.
a. Enter a name in the Layout Name field, for example, cpq-base-grid currency filter.
b. Select Layout in the Layout Type field.
1. Go to Setup.
2. In the Quick Find box, enter Visualforce.
3. Click Visualforce Pages in the search results.
4. Find the HybridCPQ page. To narrow down your search, click on the alphabet 'H'.
5. Click HybridCPQ.
The Visualforce HybridCPQ page opens.
6. To update the layout name, replace cpq-base-grid with the layout name you cloned for the currency
filter, for example, cpq-base-grid-currency-filter.
7. Click Save.
The following sample code shows how to inject the fields and priceDetailsFields parameters in the
postCartsItems, postCartsPromoItems, putCartsItems, applyAdjustment, and
deleteAdjustment CpqAppHandler remote action methods. If you have used field names other than
RecurringCharge2 and OneTimeCharge2, you need to adjust the code accordingly. The following
image shows the Price Details link.
The following sample code shows how to inject the fields and priceDetailsFields parameters in the
postCartsItems, postCartsPromoItems, putCartsItems, applyAdjustment, and
deleteAdjustment CpqAppHandler remote action methods.
'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__PremisesId__c',
'vlocity_cmt__InCartQuantityMap__c',
'vlocity_cmt__EffectiveQuantity__c',
'RecurringCharge2__c',
'OneTimeCharge2__c'
};
','));
}
if (!input.containsKey('priceDetailsFields') && !
priceDetailsFieldsResult.isEmpty()) {
input.put('priceDetailsFields', String.join(new List<String>
(priceDetailsFieldsResult), ','));
}
}
}
}
return true;
} catch (Exception ex) {
System.debug('--- Exception: ' + ex.getMessage());
System.debug('--- Stack Trace: ' + ex.getStackTraceString());
throw ex;
}
}
}
}
Pricing Variables
Pricing variables contain metadata that defines the pricing type. When you create a price list entry, you
choose a pricing variable to be part of the price.
In addition to the built-in pricing variables, you can create custom pricing variables.
NOTE
If the default pricing variables are not enabled in your environment, a System Administrator
can enable them by running the EPC Create Default Pricing Variables and Bindings job
in Vlocity CMT Administration. For more information, see Understanding Vlocity EPC
Jobs.
If you need to set up pricing elements for usage-based pricing, see Enable Usage Pricing.
To enable usage-based pricing, you must complete a set of steps in a specific order.
Some pricing variables are linked with pricing elements. When you create a pricing element, you choose
the pricing variable that indicates the price type. See Creating a Pricing Element Charge.
You can bind pricing variables to a field for price calculation. For more information, see Pricing Variable
Bindings.
You can apply one pricing variable to another. For example, the pricing variable to adjust a one-time
standard price applies to the pricing variable One Time Std Price, as shown in the last field of the following
image:
When you create a pricing element adjustment, you choose the pricing variable adjustment to use. For
more information, see Creating a Pricing Element Adjustment.
1. Go to the Product Console. For more information, see Navigating to the Vlocity Product Console.
2. Next to Pricing Variable, click Create .
3. On the New Pricing Variable page, complete the General Properties section.
The following tables explain the fields to complete when creating a pricing variable.
Field Description
Currency Type The payment type. Options include
• Currency
• Loyalty Points.
Sub-Type Options include:
• Daily
• Weekly
• Monthly
• Yearly
Type Options include:
• Calculated: Select this option if the pricing variable is used in a calculation, for example, to calculate a line
item.
• Pricing Element: Select this option if the pricing variable is associated with a pricing element used in creating
a price list entry.
Scope If you selected the calculated value type, select one of the following options:
• Line Item: The pricing variable will be used in calculating a line item, including a line item total.
• Rollup: The pricing variable is used in calculating a rollup total.
Aggregation If you chose the calculated value type, select one of the following options:
• Unit: Select this option if the calculation is used for a line item.
• Quantity: Select this option if the calculation is used for a rollup or a line item total.
Applies to If you chose the adjustment charge type, select the pricing variable to which this pricing variable applies. For
Variable example, if you are creating a pricing variable to adjust a yearly recurring standard price, apply it to the pricing
variable created for yearly recurring standard price.
See Also
• Pricing Variables
For example, the following image of the pricing variable One Time Std Price shows a list of its pricing
variable bindings.
Not all pricing variables require binding to an object. The need for binding depends on the pricing variable's
function.
For example, a 2-year subscription to cellular service has a 24-month time plan. Settings for a time plan
include the total duration of time and the unit of measure for the duration of time, such as monthly or yearly.
To create a time plan to use when creating a price list entry for a product:
1. Go to the Product Console. For more information, see Navigating to the Vlocity Product Console.
2. Next to Time Plan, click Create .
3. Click Standalone Pricing Elements.
4. Complete the General Properties section.
• In the Name field, enter a name for the time plan and include the duration.
• In the Description field, enter a description for the time plan.
The following tables explain the fields to complete when creating a time plan.
• Day
• Week
• Month
• Year
• Quarter
For example, you can determine that the pricing starts at the beginning of the month or cycle, or when the
product is purchased. In the same way, you can set the pricing to end the last day of the month or at the
end of the cycle.
For the dates to be correctly calculated, a time policy must have a corresponding time plan.
• Base price
• An adjustment to a recurring base price in a product bundle or promotion
• An override of a recurring base price in a product bundle or promotion
To create a time policy to use when creating a price list entry for a product:
The following tables explain the fields to complete when creating a time policy.
• Purchase Date: Typically, the date on which the customer submits payment and signs the agreement
• Cycle Start Date: The same as Purchase Date. This can be overridden.
• First Day of Month: First day of the month
• Activation Start: Reserved for future use
End Determines the method used to calculate the end date for the record
Policy
Options include:
• End of Plan Duration: The end date equals the start date plus the duration defined in the time plan.
• Cycle End Date: The same as End of Plan Duration. This can be overridden.
• Set by Order Management: Reserved for future use.
• Last Day of Month: The end date equals the start date, plus the duration defined in the time plan, plus any additional
days required to move the result to the end of the corresponding month.
For example, if the start date is March 15 and the duration is six months, the policy ends on September 30.
Product Pricing
Pricing of products includes creating pricing list entries and assigning prices. You use pricing components
to define the price aspects and then assign them to the product.
When you create a price list entry for a product, you answer questions about the:
• An assigned price
• An active status
• An orderable status
1. In the Pricing Variable section, complete the search criteria and click Search. A results list of
available pricing variables appears.
2. In the pricing variable results list, click the appropriate pricing variable. A results list of available pricing
elements appears.
3. In the results list in the Pricing Element section, click the appropriate pricing element.
4. In the Time Plan/Policy section, choose the appropriate time plan and time policy, if applicable.
5. Complete the Effectivity section.
a. In the Effective From field, select a date the price becomes effective.
b. To use the price list entry, select Active to make the price status active.
6. Click Save.
The following tables explain the fields to complete for a price list entry.
Field Description
Time Policy The time policy that indicates when the pricing starts and ends, where appropriate.
Product pricing models can be designed to change over time, rising or falling as dictated by business or
marketing plans.
In this example, there are four price list entries on the B2C Price List, which will enable the price to fall
according to the schedule specified by the product marketing plan.
If there is a gap in between the effectivity dates of your price list entries, the product will not display in the
product list of Vlocity Cart during that time period.
Price Assignment
Before you can view a product or promotion in the Product or Promotion lists of Vlocity Cart, you must
assign it with a price. To assign a price, you create a price list entry in a price list. The price list entry
combines a pricing variable with the appropriate pricing element to form the price.
When you view the product in the product list in Vlocity Cart, the product list displays the price list entry that
is flagged as the base price. Then, when the product is added to the cart, the pricing service will select the
"tightest match" price list entry and apply it to the line item. The price that is applied could be:
If a product does not have a price list entry marked as a base price, the product's price appears as zero in
the product list in Vlocity Cart. However, after you add the product to the cart, the assigned price appears
either in the Recurring Charge column or the One Time Charge column. As a best practice, always assign
at least one base price to each product.
Multiple Prices
You can assign more than one price to a product by:
• Creating a price in one price list and another price in another price list.
• Creating more than one price in the same price list, and assigning each price an effectivity date range
that does not overlap with any other price list entry date ranges. For more information, see Multiple Price
List Entries.
Examples: 20% off monthly for six months with the Mobile Plan bundle or $5 off
with the Mobile Plan bundle
Bundle Price • The currency symbol In the Products list in
• The amount the cart
• If the bundle contains products that are optional for purchase, wording that
includes "minimum" or "starting price"
• The parent product has a price other than zero. The parent product price is added to the child product
price.
For example, the parent product of the bundle can be priced at $49.99. It is combined with the child
products to make up the total price.
• The parent product has a price of zero. The final bundle price is the total of the price of the child
products.
When bundles contain optional products, the display text may show the total price if all the products are
purchased. However, unless all products are added to the cart, the price in the Products list in the cart won’t
match what you see in the cart. You can change the display text to indicate a range or a starting price for
these types of bundles.
To change the price of a child product in a bundle without changing the base price, you use:
Adjustments use the base price to calculate the new price. Overrides do not use any calculations.
Overrides simply replace the base price.
When you create an adjustment or an override to the product base price, you create a price list entry that is
stored in the same price list as the base price. As a result, the system will display a message to remind you
there are multiple price list entries in the price list for this product.
When you create product adjustments and overrides for child products, you do so in the bundle's Product
Structure facet.
Overriding the base price doesn't require the base price for calculation, it simply replaces the base price.
The base price, however, remains unchanged. For more information, see Overriding the Base Price for a
Product in a Bundle.
Adjustment Records
For any order, quote, opportunity, or asset, you can review adjustments or overrides made to each line
item's price in Order Pricing, Quote Pricing, Opportunity Pricing , and Account Pricing records. The
adjustments that are recorded could be the result of an applied promotion, a manual adjustment made by
an agent, or an adjustment or override made in the context of a product bundle. Possible sources of
adjustment records are described below.
Source Description
Agent An adjustment record created when a user applied a manual pricing adjustment in Vlocity Cart
Offer An adjustment record created from an adjustment or override applied in the context of a product bundle
Promotion An adjustment record created from an applied promotion
By default, adjustment records do not record base prices. If you need to record base prices for reporting or
downstream system requirements, you can optionally enable it using Pricing Plans starting in the Fall '18
release. For more information, see Base Pricing Adjustments.
10. In the pricing variable results list, click the appropriate pricing variable. A results list of available pricing
elements appears. You can choose to adjust the price by a percentage or an amount. For more
information, see Creating a Pricing Element Adjustment.
11. In the results list in the Pricing Element section, click the appropriate pricing element.
12. In the Time Plan/Policy section, choose the appropriate time plan and time policy if applicable.
13. Complete the Effectivity section.
• Click the Effective From field and select the date the adjustment becomes effective for use.
• Select Active to make the price adjustment available for use.
14. Click Save.
The following tables explain the fields to complete when creating an adjustment price list entry.
As a best practice, clearly describe the adjustment and any duration limit on it.
Base Price Do not select Base Price.
Virtual Price If checked, the parent product’s final price with the total price of all the child products.
You can assign a time plan to limit the override duration and a time policy to determine when the override
begins and ends. A product must be contained in a product bundle before you can override its base price.
The following tables explain the fields to complete for an adjustment price list entry.
As a best practice, clearly describe the adjustment and any duration limit on it.
Base Price Do not select Base Price.
Virtual Price If checked, the parent product’s final price with the total price of all the child products.
This includes any price that has already been changed as a result of a promotion.
When you discount a recurring charge, you can also assign a time plan to limit the discount duration, or a
time policy to determine how the discount begins and ends.
You can also delete any manual changes you have made to prices in the cart. For more information, see
Delete Manual Adjustments and Overrides in the Cart.
NOTE
You cannot make manual changes to prices appearing in the Recurring Total or One Time
Total columns.
NOTE
If you create an order, add a product to the cart, or change an asset to an order, and
then you apply a manual adjustment to the line item, the dropdown adjustment will
appear when you refresh the page.
NOTE
If you create an order, add a product to the cart or change asset to order, and apply a
manual adjustment to the line item, the dropdown adjustment will appear when you
refresh the page.
1. In the cart, click the price that has been adjusted or overridden.
After you enable the usage pricing feature, the following options are available in Vlocity Cart.
NOTE
If you do not enable the Cost and Margin feature, Usage Pricing is only available in
the drop-down menu of Vlocity Cart.
For example, you can record the average quarterly usage of electricity at a service point in one custom field
and the average annual usage of electricity in another custom field. You can then set up a calculation
matrix to specify which custom field should be used to source the usage quantity in usage pricing
calculations at runtime.
1. Log in to Salesforce.
2. On the App Launcher, search for Vlocity Calculation Matrices, and open it.
The Vlocity Calculation Matrices page opens.
3. Click New.
The New Vlocity Calculation Matrix dialog box is displayed.
4. In the Calculation Matrix Name field, enter a name for the calculation matrix, for
example, DynamicUsageQuantityMatrix.
5. Click Save.
6. On the Vlocity Calculation Matrix page, click the Related tab.
7. Click View all and select the calculation matrix version for which you want to create the matrix data.
The Details tab is displayed.
8. In the Table section, click Add Header. Enter the following details:
a. Name: Enter a name for the column header, for example, Average Monthly Consumption.
b. Header type: Defines the column mapping. Select Input if the column obtains data for the
calculation. Select Output if the column returns data from the calculation. You must name the
output column ServiceFieldAPIName for it to work.
c. Data Type: Select a data type, for example, Number.
d. Matrix Display Order: Specify a number, for example, 2. It defines the sequence in which the
column is displayed.
f. Click Edit Data and enter appropriate data in the matrix. See the following image for example
data.
1. From the App Launcher, search for Vlocity Calculation Procedures, and open it.
The Vlocity Calculation Procedures page opens.
2. Click New.
The New Vlocity Calculation Procedure dialog box is displayed.
3. Select the Declarative record type and click Next.
The New Vlocity Calculation Procedure: Declarative dialog box is displayed.
4. Enter a name for the calculation procedure, for example, Usage Quantity Pricing Procedure.
5. Click Save.
6. On the Vlocity Calculation Procedure page, click the Related tab.
7. Click View all and select the calculation procedure that you created.
8. (Optional) Click and expand the Preprocessor Class Name section.
9. (Optional) In the Enter your pre-processor Apex class name below box, enter a pre-processor Apex
class name, for example, UsageConfigPreProcessor.
10. Click and expand the Calculation Steps section.
a. Click Add Step.
b. Select Matrix Lookup.
c. Enter the name of the calculation matrix you created, for example,
DynamicUsageQuantityMatrix.
d. Select Include in Calculation Output on the right.
11. Go to the Calculation Setup section. Click the pencil icon and select Enabled.
1. From the App Launcher, search for Vlocity CMT Administration, and open it.
2. Click CPQ Configuration Setup under Custom Settings.
The CPQ Configuration Setup page opens.
3. Scroll to the end of the page and click Add.
4. In the Name column, enter UsageQuantityCalculationProcedureName.
5. In the Setup Value column, enter the name of the calculation procedure you created in the previous
task, for example, Usage Quantity Calculation Procedure.
6. Click Save.
1. Log in to Salesforce.
2. From the App Launcher, search for Vlocity Product Console and open it.
3. Search for the Price List for which you want to configure usage pricing and open it, for example, B2B.
The price list is displayed.
4. Click the Pricing Elements facet on the left.
The Charges tab displays the pricing elements that are defined for the price list.
5. Click New.
The Pricing Variable section opens on the right.
6. In the Charge Type field, select Usage from the drop-down list.
7. Click Search.
8. Select a pricing variable, for example, Usage Std Price.
NOTE
The Usage pricing variable option is no longer available starting with the Winter '20
release. Use the Usage Std Price option instead.
1. Log in to Salesforce.
2. From the App Launcher, search for Vlocity Product Console and open it.
3. Search for the product to which you want to apply the pricing element and open it.
The Product General Properties page is displayed.
4. Click the Pricing facet on the left.
5. Click New on the Charges tab.
6. Enter the required information.
Follow the workflow below to create an attribute binding and to update the usage quantity of a product in
Vlocity Cart:
1. Log in to Salesforce.
2. From the App Launcher, search for Vlocity Attribute Category and open it.
3. Click New.
The Vlocity Attribute Category page opens.
4. Enter the required information.
Create an Attribute
1. Go to Vlocity Product Console, in the Foundation panel, click the plus icon next to Attribute.
The New attribute page opens.
2. Enter the required information.
For field information, see Create Attributes.
1. Go to the app Launcher, search for Vlocity Objects and Object Types and open it.
2. Click New.
The New Vlocity Object or Object Type dialog box is displayed.
3. Select Object in the Select Record Type option.
4. Click Next.
5. Enter the required information:
6. Click Save.
A new Vlocity Object, Order Item Binding is created.
1. From the app Launcher, search, and open Vlocity Attribute Categories.
2. Click on the attribute for which you want to create attribute binding, for example, Usage Quantity.
3. Click the Related tab.
4. Click New.
The New Vlocity Attribute Binding dialog box is displayed.
5. Enter the required information.
After you set this up, any product using Usage Pricing will need this attribute assigned to it. This allows
for forecasted quantities to be used in usage totals.
1. From the App Launcher, search for Vlocity Product Console and open it.
2. Search for the product to which you want to assign an attribute that has an attribute binding configured
on it.
3. Click the Attributes and Fields facet.
4. Click Assign Attributes/Fields.
5. Select the attribute you created, for example, Usage Quantity.
6. Click Assign.
The attribute binding is associated with the product.
1. From the App Launcher, search for Orders and open it.
The Orders page opens.
2. Click on an order and open it.
3. Click Configure Order.
Vlocity Cart opens.
4. Select a product from the product list that has attribute binding configured on it.
5. Click Add to Cart.
6. On the cart line item, click Configure.
7. Update the usage quantity as required.
Vlocity Cart calculates the Usage Price Total of the line item using the updated usage quantity and the
unit usage price.
1. Log in to Salesforce.
2. From the App Launcher, search for Vlocity Product Console and open it.
3. Search for the price list for which you want to create usage standard cost and open it.
The price list is displayed.
4. Click Pricing Elements on the left.
5. Click on the Costs tab.
The pricing elements defined for the price list are displayed.
6. Click New. The Pricing Variable section is displayed on the right.
7. On the Charge Type field, select Usage from the dropdown list.
1. From the App Launcher, search for Vlocity Product Console and open it.
2. Search for the product to which you want to apply the usage standard cost and open it.
3. Click Pricing on the left.
4. Click on the Costs tab.
5. Click New.
The Price List Entry section is displayed on the right.
6. On the Price List field, select the price list for which you configured the usage standard cost.
7. Enter a display text, for example, 0.423.
8. On the Charge Type field, select Usage from the dropdown list.
9. Click Search and select a pricing variable, for example, Usage Std Cost.
10. Select a pricing element, for example, 0.423.
• In Vlocity Cart, you will see the UsagePricing + Cost and Margin view in the drop-down menu. New
usage price and usage totals are available in the header for line items and total bar.
• Vlocity Cart displays usage pricing related fields on total bars using the 'multiservice-cpq-group-total-bar'
layout and the 'multiservice-cpq-group-total-bar' card.
• All price list entries that apply to the product and their effectivity date ranges. For more information about
effectivity date ranges, see Effectivity Date Ranges for Price List Entries.
• Any pricing changes from promotions.
• Any pricing changes due to manual changes in the cart. For more information about changing a price
manually in the cart, see Manually Changing Pricing in the Cart.
• Any context rules that apply to the product's price.
When the customer's account is eligible for more than one product price because of context rules, the
system chooses one of the following based on the implementation being used:
As you add more products to the cart, Vlocity performs validation in one of the following ways:
For more information about settings for recalculation, see Price and Validate Changed Items Only.
You could then calculate the taxed value in the hook as something similar to the following calculation, which
you would save in the variable map: OT_WITH_TAX = OT_STD_PRC_TOTAL + (OT_STD_PRC_TOTAL *
OT_TAX_PCT/100)
The default calculation formulas for the pricing variables are implemented by the following class:
DefaultPricingVariableCalcImplementation. You can use a hook to this class to override the
calculations or to add calculations for custom pricing variables.
1. PricingVariableMapHookImplementation.invokeMethod('calculate.PreInvoke',
input, output)
2. DefaultPricingVariableCalcImplementation.invokeMethod('calculate', input,
output)
3. PricingVariableMapHookImplementation.invokeMethod('calculate.PostInvoke',
input, output)
Input Map
The input map has the following information. This is default sample code and does not have usage pricing
enabled.
{
"paymentMode": null,
"itemId": "80246000003urCpAAI",
"isRoot": true,
"parentItemEffectiveQuantity": null,
"pricingLogDataMap": {
},
"pricingVariableMap": {
"ROLLUP_OT_STD_PRC_TOTAL": 0.00,
"ROLLUP_REC_MNTH_STD_PRC_TOTAL": 55.00,
"OT_STD_PRC_CALC": 0.00,
"OT_STD_PRC": 0.00,
"REC_MNTH_STD_PRC_DISC_PCT_MAN": 0.00,
"OT_STD_PRC_DISC_PCT_MAN": 0.00,
"LINE_QUANTITY": 1.00,
"REC_MNTH_STD_PRC_TOTAL": 0.00,
"REC_MNTH_STD_PRC_CALC": 0.00,
"REC_MNTH_STD_PRC": 0.00,
"OT_STD_PRC_TOTAL": 0.00
}
}
Field Description
pricingVariableMap This map contains the current values of the pricing variables for the line item before they are calculated
by the DefaultPricingVariableCalcImplementation calculate method. This map is keyed by
the pricing variable codes.
Output Map
The output map has the following information:
{
"pricingLogDataMap": {
"OT_LTY_TOTAL": {
"data": [
"OT_LTY_TOTAL",
"0.00",
"ROLLUP_OT_LTY_TOTAL",
"0.00",
"LINE_QUANTITY",
"1.00"
],
"format": "[{0} ({1}) + Rollup {2} ({3})] x {4} ({5})"
},
"REC_MNTH_STD_PRC_TOTAL": {
"data": [
"REC_MNTH_STD_PRC_CALC",
"0.00",
"REC_MNTH_STD_PRC_TOTAL",
"55.00",
"LINE_QUANTITY",
"1.00"
],
"format": "[{0} ({1}) + Rollup {2} ({3})] x {4} ({5})"
},
"REC_MNTH_STD_PRC_CALC": {
"data": [
"REC_MNTH_STD_PRC",
"0.00",
"REC_MNTH_STD_PRC_DISC_PCT_MAN",
"0.00"
],
"format": "{0} ({1}) - {2} ({3}%)"
},
"OT_STD_PRC_TOTAL": {
"chargeTiming": "One-Time",
"data": [
"OT_STD_PRC_CALC",
"0.00",
"OT_STD_PRC_TOTAL",
"0.00",
"LINE_QUANTITY",
"1.00"
],
"format": "[{0} ({1}) + Rollup {2} ({3})] x {4} ({5})"
},
"OT_STD_PRC_CALC": {
"data": [
"OT_STD_PRC",
"0.00",
"OT_STD_PRC_DISC_PCT_MAN",
"0.00"
],
"format": "{0} ({1}) - {2} ({3}%)"
}
},
"pricingVariableMap": {
"DISP_OT_LTY": 0.00,
"EFF_OT_LTY_TOTAL": 0.00,
"ROLLUP_OT_LTY_TOTAL": 0.00,
"OT_LTY_TOTAL": 0.00,
"OT_LTY": 0.00,
"EFFECTIVE_QUANTITY": 1.00,
"DISP_OT_STD_PRC": 0.00,
"EFF_REC_MNTH_STD_PRC_TOTAL": 55.00,
"EFF_OT_STD_PRC_TOTAL": 0.00,
"ROLLUP_OT_STD_PRC_TOTAL": 0.00,
"ROLLUP_REC_MNTH_STD_PRC_TOTAL": 55.00,
"OT_STD_PRC_CALC": 0.00,
"OT_STD_PRC": 0.00,
"REC_MNTH_STD_PRC_DISC_PCT_MAN": 0.00,
"OT_STD_PRC_DISC_PCT_MAN": 0.00,
"LINE_QUANTITY": 1.00,
"REC_MNTH_STD_PRC_TOTAL": 55.00,
"REC_MNTH_STD_PRC_CALC": 0.00,
"REC_MNTH_STD_PRC": 0.00,
"OT_STD_PRC_TOTAL": 0.00
},
"errorCode": "INVOKE-200",
"error": "OK"
}
The messages are for pricing variables whose values are calculated inside the calculate method. The format
property is a string format with indexed placeholders to be filled in by the values in the data property.
Any pricing variable code in the data is replaced by its bound field label, if any. See the example below this
table.
A simple message can be passed in for a pricing variable, as in the following example:
• INVOKE-200 : No error.
• INVOKECLASS-404 : The class being invoked is not found.
• INVOKEMETHOD-405 : The method name is blank.
• INVOKE-500 : There is an exception. Check the error property for the message.
error OK if no exception. Otherwise the exception message is returned in this property.
REC_MNTH_STD_PRC_TOTAL = (REC_MNTH_STD_PRC_CALC +
ROLLUP_REC_MNTH_STD_PRC_TOTAL) * LINE_QUANTITY;
We make our changes in calculate.PostInvoke since we want to override the default calculation.
Rollup Logic
Note that the calculate method is called first for all the leaf nodes of the line item hierarchy, and then for
their parent level all the way up to the root. That is, each child line item has to be calculated first before their
parents.
This is true because the REC_MNTH_STD_PRC_TOTAL and OT_STD_PRC_TOTAL of each child is rolled up
to the ROLLUP_REC_MNTH_STD_PRC_TOTAL and ROLLUP_OT_STD_PRC_TOTAL of their parent line item.
This rollup logic is automatically done outside of the calculate method and is based on the rollup pricing
variables' definitions where they are defined as having Scope = Rollup and Applies To Variable,
which is the pricing variable on the child to rollup.
if (methodName.equalsIgnoreCase('calculate.PreInvoke'))
{
// dump the input
System.debug('--- calculate.PreInvoke input: ' +
JSON.serialize(input));
}
else if (methodName.equalsIgnoreCase('calculate.PostInvoke'))
{
// log the output
System.debug('--- calculate.PostInvoke output: ' +
JSON.serialize(output));
overridden is:
// REC_MNTH_STD_PRC_TOTAL = (REC_MNTH_STD_PRC_CALC +
ROLLUP_REC_MNTH_STD_PRC_TOTAL) * LINE_QUANTITY;
Decimal REC_MNTH_STD_PRC_TOTAL = (REC_MNTH_STD_PRC_CALC *
LINE_QUANTITY) + ROLLUP_REC_MNTH_STD_PRC_TOTAL;
pricingVariableCodeToValueMap.put('EFF_REC_MNTH_STD_PRC_TOTAL',
EFF_REC_MNTH_STD_PRC_TOTAL.setScale(2, RoundingMode.HALF_UP));
}
Decimal OT_STD_PRC_CALC =
(Decimal)pricingVariableCodeToValueMap.get('OT_STD_PRC_CALC');
pricingVariableCodeToValueMap.put('EFF_OT_STD_PRC_TOTAL',
EFF_OT_STD_PRC_TOTAL.setScale(2, RoundingMode.HALF_UP));
}
}
return true;
}
catch (Exception ex)
{
System.debug('--- Exception: ' + ex.getMessage());
System.debug('--- Stack Trace: ' + ex.getStackTraceString());
throw ex;
}
}
}
NOTE
Note the name of the DefaultPricingVariableCalcImplementaInterface
interface. The last part of the name is "ImplementaInterface" instead of
"ImplementationInterface".
Now we test the hook and modified calculation by adding a product to the cart or forcing a pricing event by
changing the quantity of a line item or changing attribute values. The new calculation formula is reflected in
the Recurring Totals and One Time Totals in the CPQ interface. As well, the new detail message
from the hook class appears in the totals details, as in the example below:
NOTE
We have changed the totaling behavior, which is reflected in the difference in overall totals
(line-level totals, child total rollups and header totals) compared to the out of the box
behavior.
Names of Elements
Note the name of the DefaultPricingVariableCalcImplementaInterface interface. The last part
of the name is "ImplementaInterface" instead of "ImplementationInterface".
Here's why:
However, this class name is too long and is truncated to 36 characters, making it:
DefaultPricingVariableCalcImplementa (the last few letters are missing). Then the InvokeService
appends Interface to that new name, arriving at the final name
(DefaultPricingVariableCalcImplementaInterface), which is then used to look for the
corresponding Active Implementation Name.
Whenever a new Interface Implementation and active Interface Implementation detail record is created or
updated, the interface name (minus the Interface string) and the name of its active implementation class
are cached in the Custom Class Implementation custom setting through the triggers of these objects. Doing
so reduces SOQL queries to look for the implementation class names during runtime. Instead, they are
retrieved from the Custom Class Implementation custom setting.
When we set up our hook interface, there is a corresponding custom setting created where Name is
DefaultPricingVariableCalcImplementa (the Interface string is stripped off) and Class Name is
PricingVariableMapHookImplementation.
The name of the interface has to fit within the maximum 40 character limit of the Custom Class
Implementation custom setting name field. This is why the InvokeService truncates to 36 characters.
NOTE
When you de-activate an active implementation, the custom setting class name value for
the interface will be null. When you activate another implementation, the custom setting
class name value for the interface is updated to the active implementation class name. The
screenshot below is the state of the Custom Class Implementation custom setting if the
PricingInterface active implementation is DefaultPricingImplementation and
DefaultPricingVariableCalcImplementaInterface active implementation is
deactivated.
See Also
• Defining Pricing
• Default Pricing Implementation
Pricing Hooks
In software development, hooking is a concept that allows you to modify the original behavior of the
application without changing your code. By intercepting the commands, you can change the action that
would have been performed originally. This is very useful when adding new functionality to applications,
exposing additional fields in pricing calculations, or altering how products are priced, to name a few of its
applications.
Using a hook, you can modify the pricing behavior in the cart without changing the underlying programming
code. Salesforce Industries CPQ enables you to write custom pre-invoke and post-invoke hooks for each
interface to implement custom logic. Pre-invoke hooks execute before the actual interface executes,
whereas post-invoke hooks execute after the actual interface executes.
behavior or processing of a CPQ operation, you create a custom implementation in CpqAppHandler’s hook
interface, which is appropriately named CpqAppHandlerHook.
You can use the CpqAppHandlerHook to manage the inputs and outputs of CPQ methods. You can:
• Conditional processing.
• Preload information to use further down the execution chain.
• Process custom fields.
• Implement custom functionality.
• Perform callouts.
The following image provides an example of the sequence when using a CpqAppHandlerHook.
Injecting custom code is powerful when executed correctly, but be aware of the ramifications if executed
poorly. Salesforce recommends the following when implementing a hook:
• Ensure that a feature doesn’t already exist that addresses your need for a hook.
• Ensure the custom code in the hook does not cause the execution to exceed any Apex governor limits.
• Put a try-catch around the hook code to catch any exceptions thrown by the custom code.
• When unit testing the hook code, it may be possible to mock the inputs expected by the hook code to
minimize test setup and get better code coverage. Use Test.isRunningTest() to extract the mock input
from the inputMap or from a static map.
Using a Hook
Let’s look at some examples based on the following business requirement:
• Implement a CpqAppHandlerHook to check before postCartsItems logic runs to see if the product exists
in other active line items or active assets.
• In the preinvoke hook, if the product exists in active line items or assets, null the items and create a new
node that is checked in the post-hook.
• In the postinvoke hook, if the new node exists, then display an error.
• When the user tries to add a duplicate product, they will get an error in the cart.
You would do this by implementing a pricing hook to alter how the pricing is calculated. Instead of
calculating Quantity*Price and displaying the price in the One Time Charge column, you would create a
pricing hook to calculate the One Time Charge as Quantity*Price*Sales Tax Rate. If you don’t want to
include the sales tax in the one-time charge column, but instead display it as a separate column, you can
modify the cart to display a custom field for the applicable sales tax.
For example, suppose there are five line items already present in the cart and then you add a sixth item to
the cart. If the DeltaValidate setting is false and the DeltaPrice setting is false, Vlocity passes all six items to
the rule engine to run configuration rules and passes all six items to the pricing engine as well.
To avoid passing large sets of items to the configuration rules and the pricing engine, set DeltaValidate to
true and DeltaPrice to true. Instead of passing all six items to the configuration rules and pricing engine,
Vlocity passes only the newly added item and the related items that might be affected by the new item. To
get the related items, Vlocity CMT preprocesses the rules and caches the Product IDs.
End users will not notice any difference in the final output. The performance will improve when tested with
orders that contain large numbers of items.
NOTE
For product bundles with more than 50 line items, you must set DeltaPrice and
DeltaValidate to true.
Attribute-Based Pricing
Product attributes describe product characteristics. You can use product attributes for many purposes such
as filtering, order decomposition, and fulfillment, and also to determine the correct price for a given product
configuration.
Complex products often have several characteristics that affect the price of the product such as the
capacity or other product options. Consider a smartwatch with two product attributes, shown in the following
example. Without attribute-based pricing, you must create separate product entities for each configuration,
so that each product configuration can be priced correctly.
In a large catalog with many products and attributes, this approach can cause your product catalog to grow
exponentially, increasing maintenance and administration.
Using attribute-based pricing, you can create a single product entity and a set of attributes, and use a
standard calculation matrix to price each possible combination of attributes. This method reduces the
number of products in your catalog and gives you an easy way to review and administer your pricing model.
NOTE
Vlocity Communications supports only standard calculation matrices. It doesn’t currently
support grouped calculation matrices, row-versioned calculation matrices, or wildcards in
calculation matrices. For a description of each, see Calculation Matrices.
You create a step in the default pricing plan. Then, use that step to call a calculation procedure and a
standard calculation matrix that stores the product attributes and pricing information. At runtime, the
PricingPlanService implementation passes the cart line items, including product information and their
attributes and fields, to the calculation service and retrieves the correct price. The price returned overrides
the base price in the shared catalog. Additional adjustments and calculations can be applied before the
price is displayed in Vlocity Cart.
• Standard
Standard attribute-based pricing provides the ability to price a product using attributes.
• Source/Target
Source/Target attribute-based pricing enables you to price a product based on the attributes of another
product. You can also provide a path to a child product in a bundle to change the price of a product
based on its specific context.
NOTE
Because a calculation matrix requires input data to be unique across all the rows in the
matrix, you can't use source-target attribute-based pricing to change more than one
child product in a bundle.
• Range
Range attribute-based pricing enables you to define ranges for each attribute and field in the matrix, and
to determine a price for the product when values fall within those ranges.
IMPORTANT
The Attribute/Volume Based Pricing DataPack is not installed by default. In Fall '18 and
later, Vlocity implemented changes to support the V2 attribute schema. If you installed this
data pack for Summer '18, and you upgraded to the V2 attribute schema, you need to get
the latest version of the Apex classes in the Attribute/Volume Based Pricing DataPack.
• Go to the Process Library and download the Attribute/Volume Based Pricing DataPack.
This digital asset includes:
• AttributePricingDataPack.json
Includes a preconfigured calculation procedure and calculation matrix for standard attribute-based
pricing.
• SourceTargetAttributePricingDataPack.json
Includes a preconfigured calculation procedure and calculation matrix for source target attribute-
based pricing.
• RangeAttributePricingDataPack.json
Includes a preconfigured calculation procedure and calculation matrix for range attribute-based
pricing.
• CustomPricingPlanStepImpl.cls
Includes the VlocityOpenInterface implementation Apex class that exposes the
GetMatrixPrice method and invokes the PricingPlanHelper class.
• PricingPlanHelper.cls
Includes the Apex helper class invoked by CustomPricingPlanStepImpl.cls that analyzes the
matrix and invokes the calculation procedure.
• CustomPricingPlanStepImplTest.cls
Includes an Apex test class. See Introduction to Apex Code Text Methods.
Before you set up attribute-based pricing, verify that the related post-install tasks are completed.
a. Click on the Default Pricing Plan, and then click Pricing Plan Steps in the sidebar.
b. In the Pricing Plan Steps facet, click on any step.
c. In the General Properties pane, ensure that the Parameters field displays.
If the Parameters field does not display, go to the EPC Jobs on the CMT Administration screen,
find the INSTALL DEFAULT VLOCITY OBJECTS AND LAYOUTS job, and click INSTALL. Note
that this job will overwrite any configuration changes that you have made to the Vlocity Product
Console.
3. Ensure that the DefaultPricingPlan custom setting has been created.
a. Go to CMT Administration, and in the Custom settings area, click CPQ Configuration Setup.
b. In the Search dialog box under CONFIGURATIONS, enter pricing. The DefaultPricingPlan
custom setting should display.
If the DefaultPricingPlan custom setting has not be added, scroll to the bottom of the page, and
click Add. In the first box, enter DefaultPricingPlan. In the second box, enter
DEFAULT_PRICING_PLAN. Then, at the bottom of the page, click Save.
To make the PricingPlanService implementation active and default, edit its record, check the Active
and Default fields, then click Save.
NOTE
PricingPlanService and PricingElementServiceImplementations are very similar, so
changing the PricingInterface from PricingElementServiceImplementations to
PricingPlanService has no impact on existing pricing in Vlocity Cart. The
PricingPlanService implementation enables you to use pricing plan functionality and
price lists, pricing elements, and pricing variables. The
PricingElementServiceImplementation only enables you to use price lists, pricing
elements, and pricing variables. For more information on pricing implementations, see
PricingInterface.
Before you do this step, download the Attribute/Volume Based Pricing DataPack from the Vlocity Industry
Process Library.
To implement attribute-based pricing in Summer '18, add the following Apex classes to your org. Due to
code dependencies, you must create these classes in the order shown below.
1. PricingPlanHelper.cls
This Apex helper class is invoked by the CustomPricingPlanStepImpl.cls that analyzes the
matrix and invokes the calculation procedure.
2. CustomPricingPlanStepImpl.cls
This VlocityOpenInterface implementation Apex class that exposes the GetMatrixPrice
method and invokes the PricingPlanHelper class.
3. CustomPricingPlanStepImplTest.cls:
This is an Apex test class. For more information on Apex test classes, see Introduction to Apex Code
Text Methods.
For information on how to create Apex classes, see Create an Apex Class in the Salesforce help.
Starting in the Summer '18 release, you use pricing plans and calculation matrices to price products using
attributes. The standard calculation matrices store the combinations of product configurations and their
corresponding prices. The pricing plan service overrides the product's base price with the price specified for
each permutation defined in the standard calculation matrix. If any permutations aren’t defined, the pricing
plan service defaults to the base price listed in the shared catalog.
An easy way to ensure that all permutations are captured in the calculation matrix is to set the product's
base price to $100,000,000. That way, users quickly let you know if a permutation slips through the matrix!
If you’ve installed the Attribute/Volume Based Pricing DataPack from the Vlocity Process Library, you
should have the following records in your org.
Each DataPack corresponds to a type of attribute-based pricing and has a standard calculation matrix that
has been configured to support it. You can deploy one, two, or all of these matrices depending on the type
of attribute-based pricing that you need. After importing the DataPacks into your org, go to Vlocity
Calculation Matrices to add data to the matrices.
NOTE
Vlocity Communications supports only standard calculation matrices. It doesn’t currently
support grouped calculation matrices, row-versioned calculation matrices, or wildcards in
calculation matrices. For a description of each, see Calculation Matrices.
Don’t change the header names of the columns in the calculation matrix. The PricingPlanHelper.cls
expects these column names and fails if they aren’t found. The only header change you can make is to
change the field names in the range attribute-based pricing matrix.
NOTE
Range attribute-based pricing calculation matrices also can include any field or attribute of
data type Number on order line item, quote product, or opportunity product sObjects.
Create column headers in your matrix for those fields using the API field name, such as
Quantity or vlocity_cmt__EffectiveQuantity__c.
• Setting Up AttributePricingMatrix
• Source Target Attribute-Based Pricing
• Setting Up the RangeAttributePricingMatrix
Setting Up AttributePricingMatrix
The AttributePricingMatrix enables you to implement standard attribute-based pricing. This calculation
matrix is pre-configured with the column headers that define the source products, the product attributes, the
MRC, the NRC, and the usage prices.
The AttributePricingMatrix calculation matrix is part of the Attribute/Volume-Based Pricing DataPack from
the Vlocity Process Library.
Before deploying the calculation matrix, you must populate it with data as described below. You can enter
data manually using the user interface or import a comma-separated values (CSV) file.
1. Navigate to the Vlocity Calculation Matrices tab, and find the AttributePricingMatrix calculation matrix
that you installed from the dataPack.
2. Click AttributePricingMatrix.
3. Scroll to the Vlocity Calculation Matrix Versions related list at the bottom of the page.
4. Click AttributePricingMatrix v1.
5. In Vlocity Calculation Matrix Version Detail, click Create New Version.
6. Expand the Table related list.
7. Enter your data using the user interface in the Enter New Data for Inputs section, or, if you want to
import a comma-separated values (CSV) file, click Upload CSV. When the Upload CSV window
opens, click Choose File. Select the required file, click Open, then click Upload.
8. To include the usage pricing components in AttributePricingMatrix, you must set up Unit Price (UP) and
Unit of Measurement (UOM) as headers in the pricing matrix.
a. To add the Unit Price component to the calculation matrix:
i. Enter a Name for the header, for example, UP.
ii. For Header Type, select Output from the drop-down list.
iii. For Data Type, select Currency from the drop-down list.
iv. Enter a number for Matrix Display Order, for example, 7.
b. To add the Unit of Measurement component to the calculation matrix:
i. Enter a Name for the header, for example, UOM.
ii. For Header Type, select Output from the drop-down list.
iii. For Data Type, select Text from the drop-down list.
iv. Enter a number for Matrix Display Order, for example, 8.
Setting Up SourceTargetAttributePricingMatrix
SourceTargetAttributePricingMatrix enables you to implement source target attribute-based pricing. Using
this approach, you can adjust pricing for one product based upon the attributes of another product. You can
also use a parameter on the pricing plan step to specify the path to specific products in a bundle.
NOTE
Due to the way that a calculation matrix requires input data to be unique across all the
rows in the matrix, it is not currently possible to use source-target attribute-based pricing to
change more than one child product in a bundle.
SourceTargetAttributePricingMatrix is part of the Attribute/Volume Based Pricing DataPack from the Vlocity
Process Library.
This calculation matrix has been preconfigured with the column headers that define the source products,
product attributes, MRC and NRC prices, and the target product name. Before deploying it, you must
populate the matrix with data. You can enter data manually in the UI or import a CSV file.
• Target Product Name must be the name of the product to price depending on the attribute values of the
source product. All products that match the Target Product Name in the cart receive the pricing override.
• The DeltaPrice and DeltaValidate custom settings are incompatible with source target pricing. For source
target pricing to work as designed in your org, these custom settings must be set to false. If these custom
settings are set to true, only a partial product hierarchy is sent to the pricing service when an event
change happens in the cart, which will cause your target product to not be found and thus no pricing
override will be applied.
• To minimize the number of matrices that you must maintain, you can use the same matrix to include
products that do not have a target product alongside products with a target product. To use this
approach, use the SourceTargetAttributePricingMatrix, and, for those products that do not have a target
product, enter a target product name that is the same as the source product name, which will apply the
pricing override to the source product.
• Due to the way that a calculation matrix requires input data to be unique across all the rows in the matrix,
you cannot use source-target attribute-based pricing to change more than one child product in a bundle.
Next Step
After you enter your data, go to the next step: Calculation Procedures for Attribute-Based Pricing
Setting Up RangeAttributePricingMatrix
The RangeAttributePricingMatrix enables you to implement attribute-based pricing that evaluates a range of
numeric values in an attribute or a field. Using this approach, you can override pricing for a product when,
for example, the Quantity field on the line item exceeds a certain threshold or the numeric value of an
attribute falls within a certain range. You can also use this matrix to allow volume-based pricing simply
based on quantity alone (no attributes necessary).
SourceTargetAttributePricingMatrix is part of the Attribute/Volume Based Pricing DataPack from the Vlocity
Process Library.
This calculation matrix is preconfigured with the column headers that define the source products, product
attributes, MRC and NRC prices, and the Quantity field as an example. Before deploying it, you must
populate the matrix with data. You can enter data manually to import a comma-separated values (CSV) file.
You can specify ranges for numeric fields on Order Product, Quote Product or Opportunity Product
sObjects or product attributes of value type number.
Each range defined for an attribute or field must not overlap with a range on another row of the matrix. For
example, do not create a range like this: 0-10 on one row and 10-20 on another row. In this case, the
pricing plan service has two matches when the attribute or field is set to 10. Instead, specify 0-9 in one row
and 10-19 in another row to ensure the pricing plan service finds a single match when evaluating the
matrix.
When entering a range for an attribute, specify two numbers separated by a dash; for example, 10-19.
If you have multiple attribute values, separate them with semi-colons, even those with ranges as shown in
the highlighted example below.
Create a separate column for each field that must be evaluated. Use the API field name for the column
header name. In this sample matrix, the range field is Quantity.
To combine target product and path pricing with range pricing, add a Target Product Name column and
adjust the calculation procedure to include the Target Product Name in the output.
If desired, you can delete the Characteristic Name and Characteristic Value columns from the matrix,
and use only the Quantity field to create a simple volume-based pricing matrix that does not include any
attributes.
1. Navigate to the Vlocity Calculation Matrices tab, and find the RangeAttributePricingMatrix that you
installed from the DataPack.
2. Click RangeAttributePricingMatrix.
3. Scroll to Vlocity Calculation Matrix Versions related list at the bottom of the page.
4. Click RangeAttributePricingMatrix v1.
5. In Vlocity Calculation Matrix Version Detail, click Create New Version.
6. Expand the Table related list.
7. Enter your data using the user interface in the Enter New Data for Inputs section, or click the Upload
CSV button to import a comma-separated values (CSV) file.
8. Click Save Data.
9. At the top of the page in the Vlocity Calculation Matrix version Detail, click Edit.
10. In the Priority field, enter 10 or a value greater than the priority on the v1 matrix included in the
DataPack.
11. Check Enabled.
12. Click Save.
After you've entered your data, go to the next step. Reviewing theSetting Up a Calculation Procedure s for
Attribute-Based Pricing
Caching is not needed for all calculation matrices. Small to medium-sized matrices will likely be quite fast.
Vlocity recommends implementing your attribute-based pricing solution without a cache at first and creating
the cache if additional speed is required.
The PricingPlanHelper Apex class caches calculation matrix data using the key AttrMatrixMap +
{Matrix Id}, for example, AttrMatrixMapa1K46000002FATaE, in a custom org cache partition.
NOTE
Calculation matrix data is not cached in the CPQPartition that is part of the Vlocity
managed package.
After you have implemented the caching feature, you must clear the cache every time you make a change
to your calculation matrices to ensure your changes are reflected at runtime.
To cache your calculation matrices, create a custom partition in the platform cache, and then create a
custom setting that stores the name of the custom partition as follows. The PricingPlanHelper.cls
then detects your custom setting and stores your calculation matrices in the cache.
NOTE
Do not enter an allocation amount for the session cache since it is not used by
the PricingPlanHelper.cls.
Table 41.
Calculation Procedure Calculation Matrix DataPack
AttributePricingProcedure AttributePricingMatrix AttributePricingDataPack.json
SourceTargetAttributePricingProcedure SourceTargetAttributePricingMatrix SourceTargetAttributePricingDataPack.json
RangeAttributePricingProcedure RangeAttributePricingMatrix RangeAttributePricingDataPack.json
Each DataPack contains a calculation procedure and a matrix that supports one of the three approaches to
attribute-based pricing.
The following sections provide details about calculation procedures for attribute-based pricing.
1. Navigate to the Vlocity Calculation Procedures tab, and find the calculation procedure that you installed
from the DataPack.
2. In the Vlocity Calculation Procedure Versions related list, click the latest calculation procedure
version.
3. In the Vlocity Calculation Procedure Version Detail, click Simulate.
4. Enter sample data for each variable, and then click Simulate All Steps.
NOTE
There is no need to set Apex pre-processor and post-processor classes previously used
for attribute-based pricing.
When you implement source-target attribute-based pricing, the Matrix Lookup calculation step for the
Target Product Name must have the Include in Calculation Output flag checked in addition to the
monthly recurring charge (MRC) and non-recurring charge (NRC) outputs. The pricing plan service uses
the Target Product Name and any path parameters that are specified to determine the products to apply
the MRC and NRC prices.
Figure 32. Target Product Name needs Include In Calculation Output flag checked
To include usage-based pricing in pricing calculations, you must configure two additional calculation steps
for Unit of Measurement (UOM) and Unit Price (UP) and check the Include in Calculation Output flag.
See Declarative Calculation Procedures for configuring calculation steps.
Next, see Setting Up a Custom Pricing Step for Attribute-Based Pricing to create a new step in the Default
Pricing Plan.
To add the Time Plan and Time Policy columns to Time Plan Attribute-Based Pricing:
In the Calculation Matrix, output columns consist of Time Plan and Time Policy, along with MRC and
NRC. Ideally, your matrix can contain all combinations of the attributes values.
6. View the line items created for Pricing Adjustments that are matched in the Attribute-Based Pricing.
The Source column indicates ABP.
In the Parameters dialog, enter as many parameters as needed. To get started, click the plus icon.
The table below lists the parameters that are used in the calculation procedures and matrices that are
supplied as part of the Attribute/Volume Based Pricing DataPack.
For example,
You can have multiple path parameters. Each path named in the first box in the parameter dialog must be
listed in your SourceTargetAttributePricingMatrix in the Target Product Name column for the appropriate
product configuration. For more information on how to enter this data in your matrix, see Source Target
Attribute-Based Pricing.
Range Parameters
To use range attribute pricing, create RangeFields and RangeAttributes parameters as shown below.
Multiple fields and attributes must be separated by semi-colons. The corresponding fields and attributes
listed must match those in your calculation matrix.
Next Step
After you create your custom pricing plan step, see attribute based pricing in action: Attribute Based Pricing
at Runtime.
After the change to the line item is saved, click the price details icon on the recurring charge or the one time
total.
In the Details dialog box, the name of the calculation procedure that was used to price the line item is
displayed.
Pricing Plan
Using a pricing plan, Vlocity Communications, Media, and Energy supports different pricing calculations
and storage for different line items.
For example, some devices, premium support, and installation may have different price calculation
methods. A pricing plan can calculate tier-based costs, promotion discounts, agent discounts, taxes, and
more.
A pricing plan can combine a series of pricing flows and perform calculations in a specific sequence. A
pricing plan supports line-level calculations and rollups. For example, if the total cost of the order is greater
than $100, then installation is 50% off. After the line items are added and the 50% taken off of the price,
Vlocity Communications, Media, and Energy can perform a second rollup.
NOTE
A pricing plan must use the PricingPlanService interface implementation in the Pricing
Interface.
Each pricing plan step can call processes to perform the necessary calculations. Steps usually call
functions. When you call the step, you must define some input parameters, such as the current line item
and current order. Each step depends on the previous step. Steps cannot run in parallel.
• General Properties
• Pricing Plan Steps
You can:
For example, there is a standard monthly recurring cost (MRC_STD) and a standard nonrecurring cost
(NRC_STD). Tax is calculated on the original, or base, price. Variables can contain the standard tax to add
(MRC_STD_TAX_ADD) and the price after tax (MRC_STD_TAX_AMT).
Similar variables can exist for nonrecurring charges as well. Rollup variables contain the pre-tax and post-
tax rollup values. To calculate the tax, the step calls a function.
NOTE
Tax calculation is complex. Vlocity recommends that customers consider using a third-
party application that integrates with pricing.
This custom setting is usually created during installation. However, if your implementation has been
upgraded from an earlier version of Vlocity Communications, Media, and Energy, you may need to create
this custom setting manually. Use the steps below to create the custom setting.
NOTE
Pricing plan codes are not case sensitive. For example, Cullen_Plan is the same as
CULLEN_PLAN or cullen_plan. Pricing plan codes must be unique. You cannot
create two plans that use the same code.
After you click Save, the Pricing Plan Steps tab becomes available.
You put pricing plan steps in sequence to define the entire pricing plan. Each step defines what happens in
that step. Usually, steps call functions. Vlocity provides some functions, but you can extend and add new
steps and new functions.
At this time, there are no loops available in pricing plans. Also, conditional steps are not supported. If you
need conditional steps, you must include them inside a step in a function call.
• Name
• Description
• Implementation Name
• Method Name
• Sequence
• Active
See:
• PricingElementServiceImplementation
• PricingPlanService
OT_STD_PRC_CALC = OT_STD_PRC -
(OT_STD_PRC *
OT_STD_PRC_DISC_PCT_MAN / 100)
One Time vlocity_cmt__OneTimeTotal__c Holds the total non-recurring charge, OT_STD_PRC_TOTAL
Total including rollups of the children One Time
Totals, multiplied by the line's quantity.
OT_STD_PRC_TOTAL =
(OT_STD_PRC_CALC +
ROLLUP_OT_STD_PRC_TOTAL) *
LINE_QUANTITY
ROLLUP_OT_STD_PRC_TOTAL is not
bound to any field. It is calculated in
memory.
Effective vlocity_cmt__EffectiveOneTimeTotal__c Calculated only for the root. The value is the EFF_OT_STD_PRC_TOTAL
One Time same as the OT_STD_PRC_TOTAL of the
Total root item. For items that are not root items,
this field value is 0.0. The field participates
in the rollup summary field in the header—
Effective Total: One Time Charges.
Recurring vlocity_cmt__RecurringCharge__c Holds the final calculated monthly recurring REC_MNTH_STD_PRC
Charge charge after adjustments. Changed based
on overrides and adjustments.
REC_MNTH_STD_PRC_CALC =
REC_MNTH_STD_PRC -
(REC_MNTH_STD_PRC *
REC_MNTH_STD_PRC_DISC_PCT_MAN /
100)
Recurring vlocity_cmt__RecurringTotal__c Holds the monthly recurring charge, REC_MNTH_STD_PRC_TOTAL
Total including rollups of the children monthly
recurring totals and multiplied by the line's
quality.
REC_MNTH_STD_PRC_TOTAL =
(REC_MNTH_STD_PRC_CALC +
ROLLUP_REC_MNTH_STD_PRC_TOTAL)
* LINE_QUANTITY
REC_MNTH_STD_PRC_TOTAL is not
bound to any field. It is calculated in
memory.
Effective vlocity_cmt__EffectiveRecurringTotal__c Calculated only for the root. The value is the EFF_REC_MNTH_STD_PRC_TOTAL
Recurring same as the
Total REC_MNTH_STD_PRC_TOTAL of the root
item. For items that are not root items, this
field value is 0.0. The field participates in
the rollup summary field in the header—
Effective Total: Monthly Charges.
Quantity Quantity Line item quantity. LINE_QUALITY
Effective vlocity_cmt__EffectiveQuantity__c The effective line item quantity. For items EFFECTIVE_QUANTITY
Quantity that aren't root items, the calculation is
EFFECTIVE_QUANTITY =
parentItemEffectiveQty * LINE_QUANTITY.
Instead, the adjustments records for Orders (Order Pricing), Opportunities (Opportunity Pricing), Quotes
(Quote Pricing), and Assets (Account Pricing) should be used. Adjustment records are the source of
truth and can be used to reconstruct the pricing history. By default, adjustment records do not record the
base or starting price. However, you may need base pricing information for downstream systems or for
reporting. If so, it can be enabled at runtime in Vlocity Cart and in repricing batch jobs using the
CreateBaseAdjustment parameter.
Using the CreateBaseAdjustment parameter increases the number of adjustment records, which will
impact storage requirements and performance. It is not necessary for most deployments.
NOTE
In order to use base pricing adjustments, the PricingPlanService implementation must be
the active implementation for the PricingInterface.
With some pricing models, you can have multiple effective price list entries. You may have price list entries
with time plans and time policies that will change the price after a defined time interval has passed. Using
the CreateBaseAdjustment parameter, each of these price list entries are recorded as base prices, but
you can distinguish them using the sequence and estimated start and end dates.
Note that at runtime in Vlocity Cart, the Price Details window only displays the applied base price based on
the current date, which in this example is the $149.99 One Time Std Price.
In this example, the other base price, $99.99, is written to the adjustment records, but will not display in the
Price Details window.
NOTE
The Base Pricing Adjustments feature is available starting in the Fall '18 release.
To set the CreateBaseAdjustments parameter on the Initialize Pricing Context step of your pricing plan:
1. In Vlocity Product Console, find the Default Pricing Plan, or the pricing plan that you want to use to
record base prices.
2. Click the Pricing Plan Steps facet.
3. Click Initialize Pricing Context. The General Properties window appears.
1. Click Done.
2. Click Save.
The Base Pricing Adjustments feature is available starting in the Fall '18 release.
To use base pricing adjustments, the PricingPlanService implementation must be the active
implementation for the PricingInterface.
You cannot use the CreateBaseAdjustment parameter to reprice orders, opportunities, or quotes that
have been imported from an external system since they will not have pricing logs.
Alternatively, the repricing service can also be invoked using anonymous Apex in the Salesforce Developer
Console using the code below. The order ID should be replaced with the correct ID for your deployment.
You can use repricing to support products with prices that fluctuate over time, such as natural resources, or
products that are priced based on usage or currency exchange rates. Repricing is done as a background
process across one or more records. During repricing, prices are evaluated to ensure they still apply based
on the effectivity dates of the price list entry for the product or applied promotion.
Rules are rerun to ensure that the line items still meet the criteria for any context rules applied to the price
list entry. Context rules for products or promotions are not rerun. Only context rules for price list entries are
rerun. Rules for any manual adjustments can also be rerun to ensure they are still valid. If the manual
adjustment is no longer valid, the pricing for that line item reverts back to original pricing. Any price list
entries that do not have a current effectivity date yield no change when repricing is run.
• RepricingElementServiceImplementation: Reprices line items or parent objects of the line items, such
as order line items or the order header, based on the price list entry effectivity dates attached to the
product or promotion at that point in time when the repricing service is run.
Repricing Example
Assuming changes in market conditions, you can lower the price of a product starting on a certain date and
make this new price available to any orders that are still pending and have not been submitted for
fulfillment.
To accomplish this, create a new price list entry and set the end date of the existing price list entry. Once
the price list entries are created and updated, run the repricing service to reflect the new pricing on existing
orders to ensure customers can take advantage of this new pricing:
18. From the Developer Console, click Debug > Open Execute Anonymous Window.
19. The following Apex code will be used to reprice orders. Copy this code and paste it in the Enter Apex
Code box from the Developer Console.
Once invoked, the Apex code reprices all orders with an order status of Draft, and with the effective
date you selected. For sample Apex code, refer to RepricingInterface.
20. Select the code and click Execute Highlighted.
21. Navigate back to the tab where the 4G LTE Data Plan is in the cart for the Adv Pricing Data Plan
Order.
22. Refresh the browser page.
23. Notice the Recurring Charge is now $24.99 from the new price list entry.
The customer needs to create a scheduler based on the requirements. The scheduler triggers the Repricing
API.
• To reprice all the line items for a particular Order, Quote, or Opportunity, replace the ID with the
appropriate Order, Quote, or Opportunity ID whose line items need to be repriced. This is highly
recommended for bulk repricing.
List<OrderItem/OpportunityLineItem/QuoteLineItem> a = [SELECT
Id,RootItemId__c From OrderItem/OpportunityLineItem/QuoteLineItem];
Map<String,Object> repricingInput = new Map<String,Object>{'objectList' =>
codea};
repricingInput.put('repriceProvidedLineItemsOnly', false);
// mark it true to reprice only provided itemId, else the whole bundle
associated with this ItemId needs to get repriced
Map<String,Object> repricingOutput = new Map<String,Object>();
Map<String,Object>; repricingOptions = new Map<String,Object>();
vlocity_cmt.VOIInvoker voi = vlocity_cmt.VOIInvoker.getInstance();
voi.invoke('Repricing', 'repriceLineItems', repricingInput, repricingOutput,
repricingOptions);
• To reprice assets, replace the query for assets with a more suitable query based on the requirements, for
example, reprice all assets created after 1/1/2019:
This is the preferred way of repricing lineItems to avoid hitting SOQL limits. Use less than 10 rootItemIds
at a time.
For example:
Loyalty Pricing
Customers can define loyalty credits as a form of payment for products. Loyalty credits enable customers to
use points or other customer loyalty awards to purchase products.
• The One Time Loyalty pricing variable to set the one-time price type
• Pricing variables with pricing variable bindings to ensure the correct calculation of each line item in the
cart
• Additional columns for Vlocity Cart to display the one-time loyalty price and one-time loyalty total for each
line item
• The loyalty points total on the cart's total bar
Before you can create a price list entry for a product using loyalty points, you must create pricing elements
that use the One Time Loyalty pricing variable and the specific amounts you need in loyalty points. See
Creating Pricing Elements for Loyalty Point Charges.
You can manage loyalty points in Vlocity cart. For example, if a product is priced with a currency charge
and a loyalty points charge, you can determine which payment type to use in the cart. See Managing
Loyalty Pricing in the Cart.
IMPORTANT
If you enable loyalty pricing after installing or upgrading Vlocity CME, you must run the
Field Maps Maintenance job and re-create any custom field mappings.
1. Set the currency code and loyalty code for active price lists. You should have completed this step in the
post-upgrade process. For more information, see Setting Currency and Loyalty Codes.
2. Run the EPCPEUpdateCurrencyCode class to copy the currency code into pricing elements. For more
information, see Running the EPCPEUpdateCurrencyCode Class.
3. Enable loyalty pricing.
NOTE
If you disable loyalty pricing after enabling it, some line items in some orders may become
invalid. The best practice is to not disable loyalty pricing after it has been enabled.
To get to the Vlocity CMT Administration tab, click App Launcher or All Tabs, and then click Vlocity CMT
Administration.
To use currency for the payment choice when you add a product to the cart, choose Currency in the
Payment Choice menu.
1. Click the One Time Charge or the One Time Loyalty price of the line item.
2. Click Payment Type .
3. In the Payment Choice dialog box, click the payment type you want to change the line item's charge
to.
4. Click Apply.
1. Navigate to the Product Console. For more information, see Navigating to the Vlocity Product Console.
2. Find and open the price list where you want to create the pricing element charge.
3. Click Standalone Pricing Elements.
4. Click New.
5. In the configuration panel in the Pricing Variable section, enter the search criteria to find the One Time
Loyalty pricing variable.
a. In Charge Type, choose One-time.
b. In Sub-Type, choose Standard.
c. In Type, Price.
6. Click Search.
7. In the search results under Select a Pricing Variable, choose the pricing variable created for
loyalty points, such as "One Time Loyalty".
8. Complete the General Properties section.
a. Name the pricing element. Make sure the name of the pricing element indicates as much
information about the price as possible, such as the amount and "loyalty points" or whatever name
you have for loyalty credits. For example, "2500 Loyalty Points".
b. Enter a unique code. This code identifies the individual pricing element.
c. In Display Text, enter the amount and your company's term for loyalty points.
9. Complete the Currency Value.
a. In Charge, enter the amount.
b. In Currency Code, choose the PTS.
10. Complete the Effectivity section.
a. Click in the Effective From field and select a date the pricing element is available for use.
b. Select Active to make the pricing element active and available for use.
11. Click Save.
The following tables explain the fields to complete for creating a pricing element charge for loyalty points.
1. Set the currency code and loyalty code for active price lists. Make sure you completed this step in the
post-upgrade process. For more information, see Setting Currency and Loyalty Codes.
2. Run the EPCPEUpdateCurrencyCode class to copy the currency code into pricing elements. For more
information, see Running the EPCPEUpdateCurrencyCode Class.
3. Enable loyalty pricing. For more information, see Enable Loyalty Pricing.
In this paradigm, pricing steps are driven by a flow. Each step in the flow follows a natural language layout.
You can set filters and actions to apply a flow to orders.
• The flow drives the rule execution: Which rules do I execute for pricing?
• Rules execute multiple filters: Which order lines should be adjusted?
• The filters trigger pricing actions: How should I change the pricing?
A pricing specification in the definition of the product or service. Offers and product specifications have
charges. Charges can be a cost or a price, one-time, recurring, or usage-based. You can use simple pricing
or a pricing matrix. Discounts are alterations to prices. You can discount by a specific amount or by a
percentage. Alterations can apply to simple or matrix prices.
Pricing overrides can be incremental or absolute. Incremental overrides start with a base price and then
take an amount off of that price. Absolute overrides entirely override the base price. Overrides apply in the
context of an offer, an account, or a contract.
A contract can drive pricing. The contract contains customer-specific discounts for products. When that
customer orders those products, they see the prices that the frame contract specifies. Frame contracts
enable customer-specific pricing. A frame contract stores individual product and discount configurations.
For more information about contracts, see Contract Lifecycle Management Overview.
• Calculation procedures
• Offering procedures
• Product relationships
• Entity filters
NOTE
You need not use the Vlocity pricing engine. You can use the pricing interface to call a
third-party pricing implementation. You need not use pricing rules to implement pricing
either.
Attribute-based pricing requires a matrix. Within the matrix, the calculation can be simple or attribute-based.
A charge matrix is also a Vlocity calculations matrix. You define the pricing action in the product
specification. A pricing specification is the definition of the physical product.
A pricing matrix requires DataRaptor input and output bundles, a calculation matrix, and a calculation
procedure. You associate rules, entity filters, and flows with the pricing matrix.
You create a DataRaptor of the type Extract(JSON). The extract object must be a line item, such as
OpportunityLineItem, OrderItem, or QuoteLineItem. You must transform the DataRaptor data to match the
pricing matrix column headers.
Next, you create a DataRaptor of the type Load(JSON). This DataRaptor uses generated values from the
calculation procedure to input into the line item. For example, you could create a field named OneTimeTotal
that appears as a nonrecurring charge on the line item. In DataRaptor, use the picklist to select the
destination for the uploaded JSON values.
The following is a sample JSON input structure in which the ID equals the extracting object ID and the
UnitPrice (also called the calculated price) is equal to the result output.
{
"ID": null,
"UnitPrice": null
}
A pricing matrix uses a calculation matrix. The headers in the calculation matrix correspond to product
attribute values, for example, Speed and Brand. For more information about calculation matrices, see
Calculation Matrices.
Create the pricing matrix before creating the pricing component. Connect the pricing matrix to the pricing
component and the pricing component to the product.
1. Create a DataRaptor of type Extract(JSON). For more information, see Create a Pricing Matrix
DataRaptor Extract(JSON).
2. Create a DataRaptor of type Load(JSON). For more information, see Create a Pricing Matrix
DataRaptor of Type Load(JSON).
3. Create a calculation matrix. For more information, see Creating a Calculation Matrix.
4. Create a declarative calculation procedure. For more information, see Create a Calculation Procedure
for a Pricing Matrix.
5. Create an entity filter. For more information, see Create an Entity Filter for a Pricing Matrix.
6. Create a pricing rule on a line item object. For more information, see Create a Rule for a Pricing Matrix.
7. Create a pricing rules flow. For more information, see Create a Pricing Rules Flow.
8. Activate the PricingRulesFlowmplementation. For more information, see Set an Implementation.
9. Add the pricing matrix custom settings.
When you have finished creating this DataRaptor, create a DataRaptor of type Load(JSON). For more
information, see Create a Pricing Matrix DataRaptor Extract(JSON).
In the JSON input structure, ID is equal to the extract object ID and Unit Price, also known as the calculated
price, is equal to the result output in the calculation procedure.
Including the effective one time total field reflects the price in the summary header.
{
"ID": null,
"UnitPrice": null
}
5. From the Creation Sequence list, select one of the following items:
• OrderItem
• OpportunityLineItem
• QuoteLineItem
6. In the Data Mappings table, select ID.
7. From the Domain Object list, select the object you added in step 5.
8. From the Domain Object Field list, select Id.
9. In the Data Mappings table, select Unit Price.
10. From the Domain Object list, select the object you added in step 5.
11. From the Domain Object Field list, select the one time total field, for example
vlocity_cmt__OneTimeTotal__c.
12. In the Data Mappings table, click New Mapping.
13. From the Mapping Detail list, select UnitPrice.
14. From the Domain Object list, select the object you added in step 5.
15. From the Domain Object Field list, select the effective one time total field, for example,
vlocity_cmt__EffectiveOneTimeTotal__c.
After you are done creating the DataRaptor of type Load(JSON), create a calculation matrix.
types must exactly match the incoming data types or the lookup won’t work. Input rows must be unique and
resolve to a single output.
You can use a calculation matrix in a pricing matrix as well. For more information about pricing matrices,
see Setting Up Pricing Matrices Using the PricingRulesImplementation.
In the example used in this procedure, the Life Insurance Pricing Matrix takes the ZIP code, Age, and
Smoker input to calculate a life insurance rate.
NOTE
Input column names must match the DataRaptor input bundle names.
• Data Type specifies the type of data stored in the column—Text, Number, Currency, Percent,
Boolean, Number Range, Text Range.
• Matrix Display Order defines the column number, or sequence.
In the image below, the fields circled in green are input fields. The field in blue is an output field.
IMPORTANT
Starting in the CME Summer '18 release, the following limits are supported:
9. In the Preprocessor Class Name section, in the Enter your pre-processor Apex class name below
box, enter CalcProcPreProcessor.
10. In the Calculation Steps section, click Add Step.
11. Select Matrix Lookup.
12. Enter the name of the calculation matrix you created. For more information, see Creating a Calculation
Matrix.
13. Select Include in Calculation Output.
14. Click Add Step.
15. Select Calculation.
16. Enter the appropriate input calculation data, for example Quantity * (Price (MemoryCard) +
OriginalPrice).
17. Enter the appropriate output data, for example UnitPrice.
18. Select Include in Calculation Output.
19. In the Postprocessor Class section, in the Enter your post-processor Apex class name below
box, enter the name of the class you created.
20. On the Vlocity Calculation Procedure Version record detail page, select Enabled.
Next, you must create an entity filter for the pricing matrix.
For more information about entity filters, see Entity Filters Overview.
7. Click Save.
Next, create a pricing rules flow. For more information, see Create a Pricing Rules Flow.
7. Click Save.
8. In the Flow Properties dialog box, enter the Name, in this example, Pricing Rules Flow.
9. Click OK.
Some of the benefits of the cost and margin feature include the following:
• Sales agents can identify the profit and loss margins quickly, enabling them to achieve long-term
strategic objectives.
• Companies can define and meet financial targets for specific products.
• By defining profit margins, companies can better project, maintain, and grow revenues while keeping
costs down.
1. Enable cost and margin, create a pricing element for cost, configure a cost for your product, and view it
in Vlocity Cart. These steps are required to use this feature. See Defining Cost and Margins.
2. Define and validate margin ranges to ensure that the cost does not exceed the price by a certain
percentage amount. This is optional but can be useful if you want to generate warning messages in
Vlocity Cart when the margin range is violated. See Defining and Validating Margin Ranges.
3. Optionally, customize either one or both the default Vlocity margin range and margin validation
interface implementations. See Customizing Default Margin Range and Validation Interface
Implementations.
4. Optionally, link service points to line items in Vlocity Cart. See Associate Service Points to Line Items in
Vlocity Cart.
NOTE
You must first create a price list with pricing elements related to costs before you can
associate costs to the product. See Creating a Pricing Element for Costs.
1. Enable the cost and margin feature. See Enabling Cost and Margin.
2. Create a pricing element for price and cost and then configure the price for your product.
a. Create a pricing element for a price.
b. Create a pricing element for cost.
c. Configure the price for a product.
3. Configure a cost for your product. See Defining Costs.
4. View the cost and margin in Vlocity Cart.
NOTE
Margins are calculated automatically after you configure the price and the cost for
your product.
• The default MarginRangeLoader interface implementation loads the margin range data from the
calculation procedure and returns the data in an output map. The calculation procedure is passed
through the parameter, loadMarginRange, in the pricing plan step.
• The default MarginValidation interface implementation validates margin ranges on line items in Vlocity
Cart.
TIP
You can customize either one or both interface implementations.
NOTE
The Costs tab is always visible from either the Products, Pricing facet or the Price List,
Pricing Elements facet even if the feature is disabled.
NOTE
If you disable the feature after you have enabled it, you will see a warning message
indicating that any Opportunities, Quotes, or Orders using costs become invalid.
5. Click Enable.
After you enable the cost and margin feature, the following options are available in Vlocity Cart.
There are new columns for each line item in the Cart. They are calculated based on the • Recurring Cost
cost pricing variable you defined. • Recurring Cost Total
• One Time Cost
If you enabled usage pricing as well as cost and margin, you see other columns in the
• One Time Cost Total
Cart. See Enable Usage Pricing.
• Recurring Margin
• One Time Margin
There are new columns in the Total Bar. They are calculated based on the cost pricing • Recurring Total
variable you defined. • Recurring Margin Total
• One Time Total
If you enabled usage pricing as well as cost and margin, you see other columns in the
• One Time Margin Total
Total Bar. See Enable Usage Pricing.
• Order Total
• Order Margin Total
• In Vlocity Cart, you will see the AdvancedPricing + CostMargin view in the drop-down menu. New cost
and margin totals are available in the header for line items and total bar.
• The Vlocity Cart displays cost-related fields on line items using the 'cpq-product-cart' layout and the 'cpq-
product-cart-item' card.
• The Vlocity Cart displays cost-related fields on total bars in Vlocity Cart using the 'cpq-total-bar' layout
and the 'cpq-total-bar-card'.
Table 50. Required and Optional Fields for Costs in Pricing Elements
Fields Description
General Properties
Name Enter the name of the cost.
Code Enter a unique code for the cost.
Display Text Enter a brief description of the cost.
Help Text Enter a description for the Help text. This is optional.
Currency Value
Fields Description
Cost Enter the cost price that you want to apply.
Currency Code The default currency code is set to USD.
Effectivity
Effective From Enter the Effective From date for the cost. This is the date the cost becomes active.
Effective Until Enter the Effective Until date for the cost. This is optional. If you choose an effective until date, the cost will not
apply after that date.
Active Click Active to activate the cost.
11. Click Save.
Defining Costs
Similar to the way you define a price for a product, you can define costs for a product. Use the Vlocity
Product Console to define the cost for a product.
IMPORTANT
Before you configure costs, you must define pricing elements for the costs first. See
Creating a Pricing Element for Costs.
Table 51. Product or Price List Entry, Required and Optional Fields
Required Fields Description
General Properties
TIP
The Default Pricing Plan includes a step to calculate margins after you complete the setup
described in this section. See Default Pricing Plan.
Use the following formulas to calculate margins, recurring margins, and margin totals for line items in
Vlocity Cart.
NOTE
• If the One Time Cost Total is 0, then the One Time Margin is 0.
• If the Recurring Cost Total is 0, then the Recurring Margin is 0.
Use the following formulas to calculate margins, recurring margins, and usage margin totals listed in the
Vlocity Cart header.
NOTE
When NumberOfContractMonth is set to null, the default is 1.
Margins for each line item can be validated using a LoadMarginRange step in your pricing plan. The
LoadMarginRange step invokes a calculation procedure and matrix. This is similar to how attribute-based
pricing is implemented using pricing plans.
Follow these steps to define a margin range and validate the range.
You must create a DataRaptor before you can use DataRaptor as a data source. As an example, you can
use the product code and quantity.
To identify and extract the order item (Order Product) or the line item using the DataRaptor Designer:
6. Click the Output tab and specify the Output JSON Path fields you want to extract for the calculation
matrix, for example, Product Code, ID, and Quantity.
This output from the Data Raptor is the input to the calculation matrix. An example is shown below.
a. Extract JSON Path: Product ID
b. Output JSON Path: data:ProductCode
c. Output Data Type: String
IMPORTANT
Ensure that the Output Data Type matches the matrix input headers. For example,
Quantity must be of data type Number and the input header, Quantity, in the
calculation matrix must be of Integer.
After you have identified the product to which you want to associate a margin range, create a calculation
matrix.
Specify the input data and make it a unique record (unique row). Identify and specify the lower and upper
bounds of the margin range. Set up margin ranges using calculation procedures. Define margin ranges in
the Vlocity Calculation Matrix.
As an example, product code and quantity are used to specify the uniqueness to determine the lower and
upper bounds. Customers can define their unique lower and upper bound values.
TIP
You must define the following output columns in the calculation matrix with a datatype of
percentage. These output columns are expected by the MarginRangeLoader
implementation interface. Make sure to use the following names.
If you also enabled usage pricing, you must define additional output columns with a
datatype of percentage and the following names.
IMPORTANT
Before you begin, complete the Post-Upgrade Steps for Fall '18 to Winter '19 for Vlocity
Communications, Media, and Energy steps so that the out-of-the-box cost variables are
available to you. For a list of the pricing variables for cost and margins, see Pricing
Variables for Cost and Margins.
The calculation procedure calls the associated calculation matrix to find the margin range for the product
and then returns the output from the matrix to the pricing service. If a line item in the cart is outside the
upper and lower bounds of the margin range, Vlocity Cart will report an error to the user. For example, if
you defined a margin range that cannot be lower than 5%, you will see an error in Vlocity Cart if the range
is 4% for that line item.
NOTE
If a line item contains a product that does not match the matrix, the pricing service will
continue to the next step of the pricing plan.
• Create a calculation procedure as shown in the following screen. Specify the Record Type to be
Declarative.
If you also enabled usage pricing, add Usage Margin Lower Bound and Usage Margin Upper Bound
variables.
• Associate the procedure with the Extract DataRaptor bundle you created.
• Use the Calculation Matrix lookup to associate the calculation steps with the matrix you created. Be sure
to check the "Include in Calculation Output" option. Output variables are required.
• Enable the calculation procedure and make sure it has the highest priority.
IMPORTANT
Before you begin, complete the Post-Upgrade Steps for Fall '18 to Winter '19 for Vlocity
Communications, Media, and Energy steps. This is to make sure that the pricing plan step,
"Load Margin Ranges" is available to you.
• In the Vlocity Product Console, edit the pricing plan that you want to use to validate the margin ranges.
Next, edit the Load Margin Ranges step and add only one of the following parameters you want in the
General Properties section:
• OpportunityMarginRangeVCPName = name_of_calculation_procedure_for_opportunity
• QuoteMarginRangeVCPName = name_of_calculation_procedure_for_quote
• OrderMarginRangeVCPName = name_of_calculation_procedure_for_order
IMPORTANT
In the Pricing Plan Steps facet of the Default Pricing Plan, add the Load Margin Ranges
step after the "Calculate Rollups" step and before the "Save Line Items" step.
IMPORTANT
If you do not have the MarginRangeLoader or MarginValidation interfaces in your org,
install the Winter '19 release and run the post-installation or post-upgrade steps. See the
Installation Guide for Vlocity Communications, Media, and Energy
NOTE
This is an optional step. Use it only if you want to customize the default Vlocity interface
implementations to load the margin range and validate it.
Customize this interface implementation, for example, when you don't want to validate error messages at
the line item level. Instead, you want to set up a different validation mechanism. See Customizing the
MarginValidation Interface Implementation.
NOTE
This step is optional. Skip it if you want to use Vlocity's default MarginRangeLoader
interface implementation.
• Using the Load Margin Ranges interface implementation, the pricing service queries the named
calculation procedure to find the margin ranges for the product specified in the line item and passes it to
the Margin Validation interface implementation.
• Next, the Margin Validation interface implementation compares the line item's margin to determine
whether the range is within the specified limits.
• If the margin is outside the valid range, it returns an error message in the CPQ pricing message field to
Vlocity Cart.
NOTE
This step is optional. Skip it if you want to use Vlocity's default MarginValidation interface
implementation.
• OneTimeMarginLowerBound
• OneTimeMarginUpperBound
• RecurringMarginLowerBound
• RecurringMarginUpperBound
Output Parameters: None
2. Specify an error message in the 'CpqPricingMessage__c' field of the line items. Error messages for
one-time margins and recurring margins are displayed for each line item in Vlocity Cart when the
margin ranges are violated.
For example, the one-time margin must be between 5.0% to 10.0% is displayed in Vlocity Cart for a
line item when the validation.
3. Customize the margin validation implementation using the sample implementation code.
if (methodName.equals('validateMarginRange'))
{
validateMarginRange(input, output, options);
return true;
}
return false;
}
/*
* validate margin ranges.
*
*/
private void validateMarginRange(Map<String, Object> input, Map<String,
Object> output,
Map<String, Object> options)
{
List<SObject> lineItemList = (List<SObject>) input.get('lineItemList');
//map, which has margin range details.
Map<Id, Map<String, Object>> itemIdTomarginRangeMap = (Map<Id,
Map<String, Object>>)
input.get('lineItemIdToMarginRangeMap');
for (SObject item : lineItemList)
{
String oneTimeMarginMessage = null;
String recurringMarginMessage = null;
Id lineItemId = (Id) item.get('Id');
//margin range map also has all output columns of martix.
Map<String, Object> marginRangeMap =
itemIdTomarginRangeMap.get(lineItemId);
if (marginRangeMap != null)
{
Decimal oneTimeMargin = (Decimal) item.get(nsp +
'OneTimeMargin__c');
Decimal recurringMargin = (Decimal) item.get(nsp +
'RecurringMargin__c');
Decimal oneTimeMarginLowerBound = (Decimal)
marginRangeMap.get('OneTimeMarginLowerBound');
Decimal oneTimeMarginUpperBound = (Decimal)
marginRangeMap.get('OneTimeMarginUpperBound');
Decimal recurringMarginLowerBound = (Decimal)
marginRangeMap.get('RecurringMarginLowerBound');
Decimal recurringMarginUpperBound = (Decimal)
marginRangeMap.get('RecurringMarginUpperBound');
if (oneTimeMarginLowerBound != null &&
oneTimeMarginUpperBound != null &&
(oneTimeMargin > oneTimeMarginUpperBound ||
1. In Vlocity Cart, click the down arrow next to the line item to which you want to link a service point.
2. Using the line item action drop-down menu, click Configure.
3. Click Service Point.
For Multi-Service Points, premises for the accounts in this order are loaded.
Otherwise, the Cart Item Lookup Field dialog box appears. Type the premises name and then select it
from the list. No automatic lookup occurs, so you must know the name.
4. Select a premises.
For Multi-Service Points, an API call displays all the service points associated with that premises.
Otherwise, type the service point name. No automatic lookup occurs, so you must know the name.
5. Select the service point.
6. Click Save.
Vlocity has two rules frameworks that work in tandem: context rules and advanced rules.
• Use the context rules framework to determine what products, promotions, and prices appear in Vlocity
cart. You can specify when to apply a penalty for cancellations and what the penalty will be.
• Use the advanced rules framework to design product compatibility rules based on conditions in order line
items and related objects. You can also create advanced pricing, availability, and eligibility rules.
You can use rules to change standard product and pricing behaviors in Vlocity Cart. Vlocity rules are
essential to creating the perfect order. You control all the products and services you offer to your customers,
and offer them at the right prices.
There are two primary types of context rules: Qualification and Penalty. These rule types have different
uses in Vlocity Cart. See Types of Context Rules.
Create and manage context rules in the Vlocity Product Console. Build context rules with reusable
components. Context rules can be combined into rule sets and applied to products, promotions, price lists,
and price list entries. They can also be applied to virtual objects. See Context Rules Components.
Interface Implementations
The following interface implementations must be active and set to their default values to enable the
specified types of context rules.
NOTE
The CPQ Configuration Setup UseSessionCache custom setting is deprecated. In Vlocity
Communications, Media, and Energy Summer '17 and later, set UseSessionCache to
false.
• Qualification rules—Qualification rules determine customer eligibility for products, promotions, price lists,
price list entries, and pricing adjustments at run time. Because context rules are reusable, you can assign
the same qualification context rule to a product, a promotion, a price list, or a price list entry. Context
rules for pricing adjustments are available in Vlocity Communications, Media, and Energy Summer '18
release, and because they operate on virtual objects, they cannot be reused on other objects such as a
product, for example.
• Qualification Rules for Products
• Qualification Rules for Promotions
• Qualification Rules for Price Lists
• Qualification Rules for Price List Entries and Child Price Lists
• Qualification Rules for Pricing Adjustments
• Penalty rules—Penalty rules determine whether a penalty applies and what the penalty is when a
customer cancels a promotion or deletes or disconnects an asset linked to a contract during its
commitment period. Penalty rules apply only to MACD or asset-based orders.
• Penalty Rules for Promotions
• Penalty Rules for Contracts
• There is a third type of context rule—evaluation rules. However, evaluation rules are not implemented in
Vlocity Cart, and are available only using an API. For more information, see Evaluation Rules Overview.
For example, you might want to offer certain products to customers purchasing through one channel and a
different set of products to customers purchasing through another channel.
When creating the product list for Vlocity Cart, the rules engine first queries the shared catalog for all
products that are marked orderable, active, effective as of today's date, and that have a price. Then, using
that list of products, the context rules framework filters it using qualification context rules, which results in a
list of qualified and disqualified products. The qualified products are then passed to the advanced rules
framework, which refines the list again using its rules. The final output is displayed in Vlocity Cart's product
list, with the qualified products appearing in the Qualified tab and the disqualified products in the
Disqualified tab.
Before you can use qualification context rules for products, you must ensure that the
CtxRulesProductsOpenImplementation is the active and default implementation for
ProductAvailabilityOpenInterface.
You create qualification rules in Vlocity Product Console using reusable context rule components. See
Create Qualification Rule Sets.
After creating a qualification rule, you can assign it to a product. See Qualification Rules - Assigning or
Deleting to Products.
You create qualification rules in Vlocity Product Console using reusable context rule components. For more
information, see Creating Qualification Rule Sets .
After creating a qualification rule, you can assign it to a promotion. For more information, see Qualification
Rules - Assigning or Deleting to for Products and Promotions.
Figure 42. Using Qualification Context Rules To Control Displaying the Price Lists
You create qualification rules in Vlocity Product Console using reusable context rule components. For more
information, see Creating Qualification Rule Sets.
After creating a qualification rule, you can assign it to a price list. For more information, see Qualification
Rules - Assigning or Deleting to Price Lists.
Qualification Rules for Price List Entries and Child Price Lists
In addition to assigning qualification rules to products, promotions, and price lists, you can assign
qualification rules to price list entries or to a child price list, which acts as a container for a group of price list
entries. This ensures that each customer sees the price that is right for him or her. For example, might have
specific pricing for certain geographies or customer segments, in addition to base pricing. You can use a
qualification rule to determine a customer's eligibility for pricing, just like using a qualification rule to
determine a customer's eligibility for products or promotions.
This approach enables you to assign a single product to multiple prices. In some cases, a customer might
be eligible for more than one of them. In the end, a single price must be set. To ensure that the correct price
is applied, you use the TightestMatchInterface and condition weights.
Condition Weights
Condition weight is a context dimension general property that is assigned a numeric value from 0 to 60. The
TightestMatchServiceImplementation uses the condition weight to calculate the relative weight of a price list
entry. The weight is only used for rules that are assigned to price list entries or child price lists and not for
rules assigned to products and promotions. For more information, see Using Condition Weights.
TightestMatchInterface
TightestMatchInterface is provided as part of the managed package. It includes the
TightestMatchServiceImplementation, which selects the tightest match price. For more information, see
Using Tightest MatchQualification Rules for Price List Entries
Tightest Match
Products can have multiple price list entries across child price lists or in a single price list. You can use
context rules to determine which price list entry to apply when the product is added to the cart.
In a world of multiple prices, what if the customer is eligible for multiple prices? In the end, a single price
must be set. That’s when the TightestMatchInterface comes into play.
TightestMatchInterface
TightestMatchInterface is an interface that is provided as part of the managed package. It is called by the
PricingInterface when using either PricingElementServiceImplementation or PricingPlanService
implementations. It is not called when using PricingRulesImplementation.
• FirstMatchImplementation ignores any condition weights and selects the first price list entry that it finds.
• TightestMatchServiceImplementation uses condition weights to determine the “tightest match” price.
For more information on condition weights, see Using Condition Weights.
NOTE
To use condition weights and the tightest match algorithm set the
TightestMatchServiceImplementation as the active implementation for the
TightestMatchInterface.
Using the TighestMatchInterface and Context Rules to Set the "Tightest Match" Price
However, when there are multiple “winning” tightest matches, the most recent price list entry is selected,
and the price list entries not selected are displayed in the price Details window.
Condition Weights
Condition weight is a general property of context dimensions. Condition weights are numeric values ranging
from 0 to 60. These values are used by the TightestMatchInterface to calculate the relative weight of rules
assigned to a price list entry.
Condition weight is only used for rules assigned to price list entries or child price lists and not for rules
assigned to products and promotions. Because context dimensions are reusable, a context dimension
might be used for rules for both price list entries and for products or promotions. The condition weight value
is ignored on a context dimension used in a rule for a product or a promotion.
With multiple price list entries, rules, and conditions, it is important to reduce the possibility for ties, so that a
single price can be selected. Administrators can ensure that certain criteria can win over others by
incrementing condition weight using integers. The Tightest Match algorithm further reduces the possibility of
ties and uses bitwise operators for maximum processing speed, so the weights are calculated as 2n. For
example, 21=2, 22=4, 23=8, 24=16, and so on.
In the following formula, x is the condition weight set on the context dimension used by the child price list
rule and y is condition weight set on the context dimension used by the price list entry rule.
This formula ensures that price list entries on a child price list will win over price list entries on a parent
price list if all other criteria are equal.
Algorithm Assumptions
The Tightest Match algorithm assumes:
• Price list entries with no context rule are assigned a condition weight of 0, or 20, which equals 1.
• Price list entries with a context rule that has a null condition weight are evaluated as 0, or 20, which
equals 1.
• Price list entries with condition weights that are greater than 60 default to 0, or 20, which equals 1.
• Context rules on parent price lists are not evaluated.
• If there are multiple price list entries with the highest weight for the same pricing variable (such as a One
Time Charge or a Monthly Recurring Charge), the interface selects the most recently-created price list
entry and applies that price to the variable in the line item.
For example, imagine you create two rules that evaluate multiple criteria such as sales channel, geographic
region, customer segment, and SLA/service level, and your business objective is to prioritize existing
customer service level agreements above other criteria. You can weight them as follows:
The total condition weight for Rule #1 is 1 + 4, and the total condition weight for Rule #2 is 2 + 3. If the
condition weights were simply summed, these rules would tie. However, using the Tightest Match formula,
the business objective of prioritizing the SLA/service level criteria is achieved because using bitwise
operators, the total condition weights are not equivalent.
• Rule #1 = 21 + 24 = 18
• Rule #2 = 22 + 23 = 12
To simplify your rules environment, the right approach is to leave the condition weight property blank for
most context dimensions. Then, when you want to prioritize certain criteria, it is easy to weight conditions
quickly because 21=2, 22=4, 23=8, 24=16, and so on.
Related Information
Create Context Dimensions.
Tightest Match
For example, you can allow your platinum SLA accounts up to a 15% manual pricing adjustment, while your
silver SLA accounts only are allowed up to a 10% manual pricing adjustment.
Qualification rules for pricing adjustments evaluate data from the order, opportunity, quote, or account, as
well as adjustment values and adjustment codes the user enters at run time. This approach ensures that
pricing adjustments comply with your organization's business rules.
Figure 46. Where Do Qualification Context Rules for Pricing Adjustments Run?
The AdjustmentData virtual object must exist in the shared catalog before you can create rules for pricing
adjustments. For more information about the AdjustmentData virtual object, see AdjustmentData Virtual
Object.
Additional Considerations
• All or Nothing. Before you create context rules for pricing adjustments, users can make pricing
adjustments at any time and for any amount. For more information about pricing adjustments, see
Manually Adjust a Price in the Cart. However, as soon as you create a single rule and assign it to the
AdjustmentData virtual object, pricing adjustment rules are enabled and govern the conditions in which
users can make adjustments. For example, you may want to ensure that orders placed over the web are
only allowed a pricing adjustment up to 5%. After you create and deploy that rule, the only orders that
can be adjusted will be web orders, up to 5%. You will probably want to develop pricing adjustment rules
for other channels and conditions as well, or create a catch-all Else rule condition.
• Supported Mappings in Summer '18. In the Summer '18 release, pricing adjustment rules can evaluate
data entered at runtime from the AdjustmentData virtual object as well as fields on Order, Quote,
Opportunity, and Account sObjects. However, as with other context rules, you can't evaluate the following
unless you use a custom function:
• Products currently in the cart
• User profile or role data from the currently logged-in user
• Data stored in related sObjects such as Account.RecordType
• Enhanced Mappings in Fall '18. Starting in the Fall '18 release, you can now create rules to evaluate
product codes, so pricing adjustment rules can be applied to specified products. Also, you can also set
maximum adjustment totals to ensure that multiple adjustments do not exceed defined thresholds.
• Repricing Support. Context rules for pricing adjustments supports repricing. This functionality evaluates
manual pricing adjustments as a part of the repricing process. Any manual pricing adjustments that are
forbidden by current context rules are removed. This approach requires activation of the
RepricingManualAdjEligibilityService implementation for the RepricingManAdjEligibilityInterface.
• Multiple Pricing Adjustments. Users can apply multiple pricing adjustments as long as the adjustments
meet context rule conditions.
Interface Implementations
Context rules for pricing adjustments require the following interface implementations to be active and
default.
For details about disabling pricing adjustments, see Creating a Qualification Rule to Disable Pricing
Adjustments
NOTE
The Create Default Contextual Adjustment Data job is a one-time job that should be run as
a post-install step after upgrading. However, if you ran this job for the Summer '18 release,
you will need to run it again for the Fall '18 release to receive the latest updates to the
AdjustmentData Virtual Object. (There is no risk in running this job more than once.)
1. In Vlocity Product Console, in the Metadata section of the Dashboard, click the search icon next to
Object.
2. In the Search Object dialog box, enter data and click the search icon.
3. Click the name of the AdjustmentData virtual object, or click the edit icon to open the object for
editing.
4. In the sidebar, click Attributes, and review the list of attributes available in this virtual object.
The AdjustmentData virtual object is a system object and must not be altered. Do not change its general
properties or its attributes. If the AdjustmentData object or its attributes are accidentally altered, run Create
Default Contextual Adjustment Data job to reset the object to its original settings.
Attribute Purpose
Account Maps to information on the account related to the order, quote or opportunity.
AdjustmentAmountTotal Defines the maximum manual adjustment amount allowed at runtime. Does not include adjustments or
overrides applied at the product level or by an applied promotion.
Available starting in Fall '18
Attribute Purpose
AdjustmentMethod Maps to data entered at runtime using the adjustment picklist. Use the following values in your rule
conditions, to evaluate what the user selects.
AdjustmentPercentTotal Defines the maximum manual adjustment percent allowed. Does not include adjustments or overrides
applied at the product level or by an applied promotion.
Available starting in Fall '18
AdjustmentTotal Defines the maximum manual adjustment allowed, combining absolute and percentages adjustment
totals. Does not include adjustments or overrides applied at the product level or by an applied
Available starting in Fall '18 promotion.
Attribute Purpose
AdjustmentType Maps to data entered at runtime using the adjustment picklist. Use the following values in your rule
conditions, to evaluate what the user selects.
ANY Enables you to map to fields across order, quote or opportunity sObjects, similar to the ANY entity
context scope.
Opportunity Maps to fields on the opportunity sObject.
Order Maps to fields on the order sObject.
Attribute Purpose
PricingVariableCode Maps to data entered at runtime in the ADJUSTMENT CODE box.
ProductCode Maps to the Product Code field on the Product object. Enables the creation of pricing adjustment rules
for specific products.
Available starting in Fall '18
Quote Maps to fields on the quote sObject.
For details on how to write context mappings to attributes on a virtual object, see Using Source
Expressions.
If a penalty rule is triggered, the user is prompted that a penalty will be applied if the promotion is canceled.
The user can continue with the cancellation or keep the promotion.
If the user continues with the cancellation, the promotion is given an action status of Disconnect.
Vlocity Communications, Media, and Energy records the penalty in the Order Pricing object
(vlocity_cmt__OrderPriceAdjustment__c), along with any promotional pricing adjustments that need to
be reversed.
You create penalty rules in Vlocity Product Console using the same context rule components as
qualification context rules. For more information, see Creating a Penalty Rule.
After creating a penalty rule, you can assign it to a promotion. For more information, see Penalty Rules -
Assigning or Deleting to a Promotion.
NOTE
Vlocity Cart does not fully implement penalty rules. Custom configuration is required to
provide a penalty notification message to the user at run time.
To use penalty rules for contracts, you must perform some additional setup steps in addition to creating a
penalty rule and setting up the context rules framework.
• Sett up the ContractTerminationService Interface. Create the following interface and interface
implementation using the following names.
• Interface Name is ContractTerminationService
• Interface Implementation Name is ContractTerminationService
NOTE
For more information about setting up interfaces and interface implementations, see Add a
New Interface and Add a New Interface Implementation.
To use penalty rules for contracts, select a root-level asset and begin the asset-based ordering process in
Vlocity Cart. In the order, delete the asset and submit the order. After the order is submitted, the contract
cancellation penalty appears in Order Pricing.
NOTE
Custom configuration is required to provide the user with a cancellation penalty notification
message in Vlocity Cart.
You create penalty rules in Vlocity Product Console using reusable context rule components. See Creating
a Penalty Rule
NOTE
Evaluation rules are only available using an API. Custom configuration is required to
implement them in Vlocity Cart. For more information, contact Vlocity Services.
Evaluation context rules are used exclusively with promotions and evaluate the customer's eligibility for a
promotion after the promotion has been added to the cart. By contrast, qualification context rules determine
eligibility before it is added to the cart.
For example, after adding a promotion to the cart, an agent can change the customer's membership from
Silver to Gold to understand how it affects the promotional price of the product or service. Evaluation rules
can access account information stored in Salesforce, as well as temporary values passed at runtime.
Evaluation rules enable you to create what-if scenarios to determine a customer's qualification for a
promotion by manipulating information at runtime, without committing it to the database and permanently
changing it on the account.
NOTE
If you do not see the value Evaluation in the Rule Types picklist, activate or add
Evaluation to the Rule Type (vlocity_cmt__RuleType__c) picklist values on the
Vlocity Rule object (vlocity_cmt__Rule__c).
https://{instance}.salesforce.com/services/apexrest/vlocity_cmt/v2/cpq/GET/
carts/{cartid}/promotions?
subaction=getPromotionsAppliedToCart&include=qualifications&ruleType=Evaluation
&category={value}&ruleEvaluationInput={value}
The ruleEvaluationInput parameter accepts sObject and field values written in JSON notation. For
example, the following API request returns all disqualified promotions using the temporary run time value
specified in the ruleEvaluationInput parameter. In this example, the ruleEvaluationInput
parameter is what if an order's Originating Channel field is set to Web.
/services/apexrest/vlocity_cmt/v2/cpq/carts/8011I000000TNSZ/promotions?
subaction=getPromotionsAppliedToCart&include=qualifications&ruleType=Evaluation
&category=disqualified&ruleEvaluationInput={"Order":
{"OriginatingChannel__c":"Web"}}
See Also
Cart-Based APIs
Assume that your business requires that the 5G Premium Data Plan be available in select regions, such as
the West-coast states, while the 4G LTE Data Plan is available to all customers. To support this business
requirement, you can create a qualification context rule for use with the Digital Commerce APIs and assign
it to the 5G Premium Data Plan. For more information, see Qualification Rules for Digital Commerce APIs.
After the rule has been created, you must populate the API cache. See Preparing to use Vlocity
Communications API Caching.
Now assume a customer from the West coast is browsing for available data plans. An API call is made to
the GetOffers API with the following context parameter:
?context={"Region":"West"}
/services/apexrest/vlocity_cmt/v3/catalogs/{catalog_code}/offers/{offercode}?
context={"Region":"West"}
The name specified in the parameter, which in this example is “Region”, must match the code of the context
dimension used in the context rule. The value passed, which in this example is “West”, must match the
value specified in the context rule condition in order for the product or promotion to display. You can pass
multiple dimensions in the context parameter as shown below.
?context={"Region":"West",”AccountStatus”:”New”}
At runtime, the Digital Commerce APIs query the API cache and compare the specified context parameters
with cached context dimensions.
Products or promotions that have context rules associated with them will appear in the appropriate cached
context dimension. If a product or promotion in the catalog has no context rule associated with it, it will
appear in all the cached context dimensions. Product and promotions are populated in the cache list in an
inclusive manner. As shown in the table below, the 5G Premium Data Plan product is included in
{"Region":"West",”AccountStatus”:”Active”} and
{"Region":"West",”AccountStatus”:”New”} dimensions because the 5G Premium Data Plan
product is associated with a context rule where the Region = West.
• Rule sets contain one or more context rules, and are applied to products, promotions, price lists, and
price list entries. See Rule Sets.
• Context rules are analogous to entity filters in the advanced rules framework. Context rules determine
when a rule set applies in Vlocity Cart. See Context Rules.
• Context dimensions are variables that describe the possible values to use in a rule condition. You can
reuse context dimensions across multiple rule conditions. The rules engine compares context dimensions
to data that comes from an sObject, a function, or a static value defined in the context mapping. See
Context Dimensions.
• Context mappings enable the rules engine to compare context dimension variables to data stored in
sObjects, calculated using a function, or entered during design-time in a specified context scope. Vlocity
Communications, Media, and Energy caches context mappings in the session cache. See Context
Mapping.
• Context scopes describe the relational path from a root sObject, such as an Order, to related sObjects.
Context mappings use context scopes to pinpoint the fields on the sObjects or compute data to match
with context dimension variables so the Context Rule Service engine can evaluate them. See Context
Scopes.
• Functions are used in context mappings. You can invoke custom implementations to provide additional
logic and processing. See Functions for Rules.
• Object level rules assign penalty rules for contracts. See Creating Object Level Rules.
• Context actions can be used with penalty rules to apply a fee when a promotion or contract is canceled.
Context actions enable you to specify either a flat fee using a pricing element on a price list or calculate a
fee by invoking a custom implementation. See Creating Context Actions.
You combine context rule components to create logical expressions that the rules engine can evaluate. For
example:
Rule Sets
A rule set is a logical grouping of one or more context rules. Use a rule set to designate how the grouped
context rules are expressed in a logical expression and how they are used in Vlocity Cart.
Rule Types
Rule sets have a Rule Type property. The rule type property controls how the rules are used in Vlocity Cart.
There are three rule types.
• Qualification
• Penalty
• Evaluation
For more information about rule types, see Types of Context Rules .
Expression Mode
Rule sets can also define an Expression Mode. Use the expression mode when there are multiple context
rules contained in the rule set. The expression mode describes how the rules engine compiles the child
context rules into a logical expression. See Child Rules and Expression Modes and Custom Expressions .
Header Rules
To optimize rules processing, you can set one of the children context rules in the rule set as the header
rule. For more information about header rules, see Header Rule.
For more information about how to assign rule sets, see the following topics:
Create rule sets in Vlocity Product Console. For more information about how to create rule sets, see
Creating Rule Sets.
Header Rule
To configure which rule is executed first when you have multiple children rules in a rule set, you can specify
one of the rules as the header rule. If the header rule does not pass, processing stops on the entire rule set.
Using header rules enables you to optimize rule set evaluation.
Figure 53. Setting a Header Rule in the Rule Set General Properties Facet
• And (the default): Requires that all of the child rules in the rule set pass for the rule set to pass. If one
child rule fails, the rule set fails. Used only with qualification rules.
• Or: Requires that only one of the child rules in the rule set passes for the rule set to pass. If one child rule
passes, the rule set passes. Used only with qualification rules.
• Custom: Uses a custom logical expression defined in the Expression property to evaluate the rule set.
Used only with qualification rules. See Custom Expression Definition for more information.
• If Else If: Evaluates the first child rule in the rule set and if it does not pass, continues to subsequent
children rules in the sequence. After a rule passes, it stops processing. The best practice is to set the last
rule to always be true, creating a fallback action. Used with penalty rules to apply different penalty
amounts using context actions.
• If: Evaluates the first child rule in the rule set. If it does not pass, continues to evaluate all subsequent
child rules in sequence. Continues to process until all child rules are processed. Used with penalty rules,
when more than one penalty may be applied.
When writing the custom expression, use the following syntax rules:
( Rule1Code OR Rule2Code )
( ( Rule1Code AND Rule2Code ) OR ( Rule3Code AND Rule4Code ) )
( ( Rule1Code OR Rule2Code ) AND ( Rule3Code ) AND ( Rule4Code ) )
Failure Messages
When creating context rules, you can create failure messages for the following entities: rule sets, context
rules, and rule conditions.
To enable the display of failure messages for pricing adjustments, set the CPQ Toast Message Log Level
in the CPQ Configuration Setup custom settings to All. For more information on this custom setting, see
CPQ Configuration Settings Reference. When changing a failure message for a pricing adjustment, you
must clear the CPQPartition platform cache to ensure your changes display. For more information, see
Configuring CPQ Platform Cache.
Starting in Summer '18, context rules, rule sets and rule conditions are cached in the org cache of the
CPQPartition. In order to see your changes reflected at runtime, run the Clear Managed Platform Cache
job in the CMT Administration Maintenance jobs page.
1. In Vlocity Product Console, in the Rules list, next to Rule Set, click Create .
2. On the New Rule Set tab, enter the following information.
1. Choose a context scope for the rule. If the context scope does not exist, create it. For more information
about creating context scopes, see Creating Context Scopes.
2. Choose a context dimension for the rule. If the context dimension does not exist, create it. For more
information about creating context dimensions, see Creating Context Dimensions.
3. Choose a context rule to use in the rule set. If the context rule does not exist, create it. For more
information about creating context rules, see Creating Context Rules.
4. Create a qualification rule set.
a. In Vlocity Product Console under Rules, click the create icon next to Rule Set.
b. In the New Rule Set dialog box, enter the following information.
This procedure creates a new qualification rule set. The next step is to assign it to a product, promotion,
price list, price list entry or pricing adjustment object.
1. In Vlocity Product Console, under Product Management, find the product to which you want to assign a
context rule.
2. To open the product for editing, click the PRODUCT NAME or the edit icon.
3. In the left sidebar, click Context Rules.
4. In the Context Rules facet, click Add Rule Set. The Add Rule Set dialog opens.
5. In the Add Rule Set dialog, search for and select the context rule you want to assign.
6. In the Add Rule Set dialog, click Save.
7. The context rule you assigned to the product will now appear in the Context Rules facet
QUALIFICATION list.
1. In Vlocity Product Console, under Product Management, find the product to which you want to assign a
context rule.
2. Click the PRODUCT NAME or the edit icon to open the product for editing.
3. In the left sidebar, click Context Rules.
4. In the Context Rules facet in the QUALIFICATION list, find the context rule you want to delete, and
click Delete in the right side of the table row for that context rule.
5. In the Delete Rule Set dialog, click Delete.
1. In Vlocity Product Console, under Product Management, find the promotion to which you want to
assign a context rule.
2. Click the PROMOTION NAME or the edit icon to open the promotion for editing.
3. In the left sidebar, click Context Rules.
4. In the Context Rules facet, click Add Rule Set. The Add Rule Set dialog opens.
5. In the Add Rule Set dialog, search for and select the context rule you want to assign.
6. In the Add Rule Set dialog, click Save.
The context rule you assigned to the promotion is displayed in the Context Rules facet QUALIFICATION
list.
1. In Vlocity Product Console, under Product Management, find the promotion to which you want to
assign a context rule.
2. Click the PROMOTION NAME or the edit icon to open the promotion for editing.
3. In the left sidebar, click Context Rules.
4. In the Context Rules facet in the QUALIFICATION list, find the context rule you want to delete, and
click Delete in the right side of the table row for that context rule.
5. In the Delete Rule Set dialog, click Delete.
When you access a price list entry from a product, you will be able to see all price list entries for that
product across multiple price lists, which provides a useful perspective.
1. In Vlocity Product Console, under Product Management, find the product that has the price list entry to
which you want to assign a rule set.
2. Click the PRODUCT NAME or the edit icon to open the product for editing.
3. In the left sidebar, click Pricing.
4. In the Pricing facet in the CHARGES list, find (or create) the price list entry to which you want to
assign the context rule.
5. Click the edit icon. The PRICE LIST ENTRY pane appears on the right.
6. In the PRICE LIST ENTRY pane, click the CONTEXT RULES tab at the top of the pane.
7. In the PRICE LIST ENTRY pane, click Add Rule Set. The Add Rule Set dialog opens.
8. In the Add Rule Set dialog, search for and select the context rule you want to assign.
9. In the Add Rule Set dialog, click Save.
10. The context rule you assigned will now appear in the Context Rules facet QUALIFICATION list.
1. In Vlocity Product Console, under Pricing, find the price list to which you want to assign a context rule.
2. Click the PRICE LIST NAME or the edit icon to open the price list for editing.
3. In the left sidebar, click Price List Entries.
4. In the Price List Entries facet, scroll to find the price list entry to which you want to assign the context
rule.
5. Click the edit icon. The PRICE LIST ENTRY pane appears on the right.
6. In the PRICE LIST ENTRY pane, click the CONTEXT RULES tab at the top of the pane.
7. In the PRICE LIST ENTRY pane, click Add Rule Set. The Add Rule Set dialog opens.
8. In the Add Rule Set dialog, search for and select the context rule you want to assign.
9. In the Add Rule Set dialog, click Save.
10. The context rule you assigned will now appear in the Context Rules facet QUALIFICATION list.
1. In Vlocity Product Console, under Product Management, find the product that has the price list entry to
which you want to assign a rule set.
2. Click the PRODUCT NAME or the edit icon to open the product for editing.
3. In the left sidebar, click Pricing.
4. In the Pricing facet in the CHARGES list, find the price list entry for which you want to delete the
context rule.
5. Click the edit icon. The PRICE LIST ENTRY pane appears on the right.
6. In the PRICE LIST ENTRY pane, click the CONTEXT RULES tab at the top of the pane.
7. In the Context Rules facet in the QUALIFICATION list, find the context rule you want to delete and
click Delete on the right side of the table row for that context rule.
8. In the Delete Rule Set dialog, click Delete.
To delete a qualification rule for a price list entry via a price list:
1. In Vlocity Product Console, under Pricing, find the price list for which you want to delete a rule set.
2. Click the PRICE LIST NAME or the edit icon to open the price list for editing.
3. In the left sidebar, click Price List Entries.
4. In the Price List Entries facet, scroll to find the price list entry for which you want to delete the context
rule.
5. Click the edit icon. The PRICE LIST ENTRY pane appears on the right.
6. In the PRICE LIST ENTRY pane, click the CONTEXT RULES tab at the top of the pane.
7. In the Context Rules facet in the QUALIFICATION list, find the context rule you want to delete and
click Delete on the right side of the table row for that context rule.
8. In the Delete Rule Set dialog, click Delete.
NOTE
Price list entries on a child price lists will be weighted higher than price list entries on a
regular price list. See Condition Weights.
1. In Vlocity Product Console, under Pricing, find the price list that contains the child price list to which
you want to assign a context rule.
2. Click the PRICE LIST NAME or the edit icon to open the price list for editing.
3. In the left sidebar, click Hierarchy.
4. Click the name of the child price list to which you want to assign a context rule.
5. In the left sidebar, click Context Rules.
6. In the Context Rules facet, click Add Rule Set. The Add Rule Set dialog opens.
7. In the Add Rule Set dialog, search for and select the context rule you want to assign.
8. In the Add Rule Set dialog, click Save.
9. The context rule you assigned will now appear in the Context Rules facet QUALIFICATION list.
1. In Vlocity Product Console, under Pricing, find the price list that contains the child price list to which
you want to assign a rule set.
2. Click the PRICE LIST NAME or the edit icon to open the price list for editing.
3. In the left sidebar, click Hierarchy.
4. Click the name of the child price list to which you want to assign a context rule.
5. In the left sidebar, click Context Rules.
6. In the Context Rules facet in the QUALIFICATION list, find the context rule you want to delete, and
click Delete in the right side of the table row for that context rule.
7. In the Delete Rule Set dialog, click Delete.
NOTE
Price list entries on a child price list will be weighted higher than price list entries on a
regular price list. See Condition Weights.
1. In Vlocity Product Console, under Pricing, find the price list that contains the child price list to which
you want to assign a context rule.
2. Click the PRICE LIST NAME or the edit icon to open the price list for editing.
3. In the left sidebar, click Hierarchy.
4. Click the name of the child price list to which you want to assign a context rule.
5. In the left sidebar, click Context Rules.
6. In the Context Rules facet, click Add Rule Set. The Add Rule Set dialog opens.
7. In the Add Rule Set dialog, search for and select the context rule you want to assign.
8. In the Add Rule Set dialog, click Save.
9. The context rule you assigned will now appear in the Context Rules facet QUALIFICATION list.
1. In Vlocity Product Console, under Pricing, find the price list that contains the child price list to which
you want to assign a context rule.
2. Click the PRICE LIST NAME or the edit icon to open the price list for editing.
3. In the left sidebar, click Hierarchy.
4. Click the name of the child price list to which you want to assign a context rule.
5. In the left sidebar, click Context Rules.
6. In the Context Rules facet in the QUALIFICATION list, find the context rule you want to delete and
click Delete in the right side of the table row for that context rule.
7. In the Delete Rule Set dialog, click Delete.
To create a new qualification context rule set to not allow pricing adjustments, follow these instructions.
For this rule to disable pricing adjustments, it must be the only context rule for pricing adjustments in your
org. To conditionally disable pricing adjustments, you must specify additional context rule conditions to
restrict its scope, such as account SLA or order originating channel.
Create the Context Dimension and Context Mapping to the AdjustmentData Virtual
Object
To create a context dimension with a context mapping to the AdjustmentData virtual object for the rule:
1. In Vlocity Product Console, in the Rules area, next to Context Dimension, click Create .
2. On the New Context Dimension tab, enter the following information.
NOTE
You cannot use spaces in a context
dimension name due to rules parsing
engine requirements.
NOTE
You cannot use spaces in a context
dimension code due to rules parsing
engine requirements.
Description Context dimension mapped to Specify the purpose of this context dimension.
AdjustmentData.AdjustmentValue
Condition n/a This property is not used for context rules for pricing
Weight adjustments.
Data Type Text Data type of this context dimension.
Domain Type Type in Describes how rule condition values appear when creating a
rule condition.
Object n/a Not needed since the Domain Type is Type in.
Vlocity Picklist n/a Not needed since the Domain Type is Type in.
Picklist n/a Not needed since the Domain Type is Type in.
Selection Mode
Active Click to select Only active context dimensions will be evaluated by the rules
engine.
Effective From [today's date] Specifies the start date of the period during which rules can use
Date the context dimension.
Effective Until n/a Not needed.
Date
3. Click Save.
4. In the left sidebar, click Context Mappings.
5. In the Context Mappings facet, click New Context Mapping.
6. In the New Context Mapping dialog box, enter the following information.
1. In Vlocity Product Console in the Rules area, next to Rules, click Create .
2. In the New Rule dialog box, enter the following information.
1. In Vlocity Product Console under Rules, next to Rule Sets, click Create .
2. In the New Rule Set dialog box, enter the following information.
This procedure creates the pricing adjustment qualification rule set. The next step is to assign it to the
pricing adjustment virtual object. For details, see Qualification Rules for Pricing Adjustments - Assigning or
Deleting to the AdjustmentData Virtual Object.
After this rule set is assigned, you can test its functionality in Vlocity Cart with an order, quote, or
opportunity. Enter any value in the Adjustment Value text entry box, and verify that a toast message is
displayed, as shown in the screenshot below.
1. In Vlocity Product Console, under Pricing, find the price list to which you want to assign a context rule.
2. Click the PRICE LIST NAME or the edit icon to open the price list for editing.
3. In the left sidebar, click Context Rules.
4. In the Context Rules facet, click Add Rule Set. The Add Rule Set dialog opens.
5. In the Add Rule Set dialog, search for and select the context rule you want to assign.
6. In the Add Rule Set dialog, click Save.
The context rule you assigned to the price list displays in the Context Rules facet QUALIFICATION list.
1. In Vlocity Product Console, under Pricing, find the price list for which you want to delete a context rule.
2. Click the PRICE LIST NAME or the edit icon to open the price list for editing.
3. In the left sidebar, click Context Rules.
4. In the Context Rules facet in the QUALIFICATION list, find the context rule you want to delete, and
click Delete in the right side of the table row for that context rule.
5. In the Delete Rule Set dialog, click Delete.
1. In Vlocity Product Console, in the Metadata section of the Dashboard, click the search icon next to
Object.
2. In the Search Object dialog box, enter data and click the search icon.
3. Click the name of the AdjustmentData virtual object, or click the edit icon to open the object for
editing.
4. In the sidebar, click Context Rules.
5. In the Context Rules facet, click Add Rule Set. The Add Rule Set dialog box opens.
6. In the Add Rule Set dialog box, search for and select the context rule you want to assign.
7. In the Add Rule Set dialog box, click Save.
8. The context rule you assigned to the virtual object is displayed in the Context Rules facet
QUALIFICATION list.
1. In Vlocity Product Console, in the Metadata section of the Dashboard, find the AdjustmentData virtual
object.
a. Click the search icon next to Object.
b. In the Search Object dialog box, enter data and click the search icon.
c. To edit the object, click the name of the AdjustmentData virtual object, or click the edit icon.
For more information on context rule sets, see Creating Rule Sets.
To create new penalty context rule sets, perform the following steps:
1. Choose a context scope to use for your rule. If the context scope does not exist, create it. For more
information on creating context scopes, see Create Context Scopes.
2. Choose a context dimension to use for your rule. If the context dimension does not exist, create it. For
more information on creating context dimensions, see Create Context Dimensions.
3. Choose a context rule to use in your rule set. If the context rule does not exist, create it. For more
information on creating context rules, see Create Rules.
4. Create a penalty rule set.
a. In Vlocity Product Console under Rules, click the create icon next to Rule Set.
b. In the New Rule Set dialog, enter the following information.
This procedure creates a new penalty rule set. The next step is to assign it to a promotion or to use it to
create an object level rule for contracts.
1. In Vlocity Product Console, under Product Management, find the promotion to which you want to
assign a rule set.
2. Click the PROMOTION NAME or the edit icon to open the promotion for editing.
3. In the left sidebar, click Context Rules.
4. In the Context Rules facet, click Add Rule Set. The Add Rule Set dialog opens.
5. In the Add Rule Set dialog, search for and select the context rule you want to assign.
6. In the Add Rule Set dialog, click Save.
7. The context rule you assigned to the promotion will now appear in the Context Rules facet PENALTY
list.
In the Context Rules facet, click the PENALTY tab to display the list of assigned penalty rules.
1. In Vlocity Product Console, under Product Management, find the promotion to which you want to
assign a rule set.
2. Click the PROMOTION NAME or the edit icon to open the promotion for editing.
3. In the left sidebar, click Context Rules.
4. In the Context Rules facet, click the PENALTY tab to view the penalty rule list.
5. In the penalty rule list, find the context rule you want to delete, and click the Delete button in the right
side of the table row for that context rule.
6. In the Delete Rule Set dialog, click Delete.
For more information on penalty rules for contracts, see Penalty Rules for Contracts.
1. In Vlocity Product Console under Rules next to Object Level Rule, click the create icon.
2. In the New Object Level Rule dialog, enter the following information.
If additional objects display in this list, go to the Object Manager and deactivate
those picklist items from the Vlocity Object Rule Assignment
ObjectRuleAssignment__c Object vlocity_cmt__Object__c picklist.
Rule Select a context rule Lookup dialog that enables you to select any context rule. Although any rule can be
using the Vlocity selected, be sure to select the desired penalty rule for contract cancellations.
Rule Lookup
dialog.
Context Rules
Context rules determine when a rule set applies in Vlocity Cart. Context rules are analogous to entity filters
in the advanced rules framework.
• Simple: A condition that compares a context dimension value to a context mapping value
• Function: A condition that compares the output of the function to a static value
Create context rules in Vlocity Product Console. See Creating Context Rules.
Starting in Summer '18, context rules, rule sets, and rule conditions are cached in the org cache of the
CPQPartition. In order to see your changes reflected at runtime, run the Clear Managed Platform Cache job
in the CMT Administration Maintenance jobs page.
Prerequisites:
• CPQPartition exists and has appropriate org and session cache allocations.
• CacheEnabled is set to true.
• ContextRulesEnabled is set to true.
To create a context rule, define the rule's general properties and then specify one or more rule conditions:
1. In Vlocity Product Console, in the Rules list, next to Rule, click Create.
2. Enter the following information:
IMPORTANT
Because rule code is used when creating custom
expressions, the rule code should be unique,
descriptive, and contain no spaces.
Expression • Use AND and OR Use expression when the expression mode is set to Custom. It enables you
operators to create to specify a custom logical expression. For more information, see
custom expressions. Expression Modes and Custom Expressions.
• Refer to conditions
using condition codes.
• Use spaces to delimit
each code.
• Use parentheses to
sequence the
operations for the
expression.
• Expressions are case-
sensitive.
• Simple: A condition that compares a context dimension value to a context mapping value.
• Function: A condition that compares the function's output to a static value.
IMPORTANT
Because the rule condition code is used to
create custom expressions, the code should be
unique, descriptive, and contain no spaces.
Context Select a context dimension using Specifies the context dimension to use with this rule condition.
Dimension the Context Dimension Lookup
dialog box.
Operator • > Specifies the operator the context rule service uses to compare the
• >= Value property to the context mapping.
• <
• <=
• ==
• !=
• <>
• LIKE
• NOT LIKE
• INCLUDES
• EXCLUDES
IMPORTANT
Because rule condition code is used to create custom
expressions, the code should be unique, descriptive, and
contain no spaces.
Vlocity Select a function using Specifies the function to use for this rule condition. After it is selected, the
Function the Vlocity Function function's input and output arguments display in the Rule Condition dialog box.
Lookup dialog box.
Operator • > Specifies the operator the context rule service uses to compare the Value
• >= property to the function's output.
• <
• <=
• ==
• !=
• <>
• LIKE
• NOT LIKE
• INCLUDES
• EXCLUDES
5. Click Save.
After creating the context rule, the next step is to create a rule set. For more information about creating rule
sets, see Creating Rule Sets.
Context Dimensions
Context dimensions are variables that describe the possible values to use in a context rule condition. You
can reuse context dimensions across multiple rule conditions. Context dimensions are linked to one or
more context mappings. The rules engine compares them to the linked context mappings.
Context dimensions must have a Domain Type, a property that specifies how the rule condition values
appear when a user creates the rule condition. Valid domain types are:
Context dimensions can also have condition weights, which allow the pricing engine to find the tightest
match when used in context rules for price list entries or child price lists. For more information about
condition weights, see Using Condition Weights.
• In a simple rule condition, when the context dimension determines the values that will be available to the
user when creating a rule condition
• In a function rule condition, when the context dimension can be used as the input to the function
Condition Weights
Condition weight is a general property of context dimensions. Condition weights are numeric values ranging
from 0 to 60. These values are used by the TightestMatchInterface to calculate the relative weight of rules
assigned to a price list entry.
Condition weight is only used for rules assigned to price list entries or child price lists and not for rules
assigned to products and promotions. Because context dimensions are reusable, a context dimension
might be used for rules for both price list entries and for products or promotions. The condition weight value
is ignored on a context dimension used in a rule for a product or a promotion.
With multiple price list entries, rules, and conditions, it is important to reduce the possibility for ties, so that a
single price can be selected. Administrators can ensure that certain criteria can win over others by
incrementing condition weight using integers. The Tightest Match algorithm further reduces the possibility of
ties and uses bitwise operators for maximum processing speed, so the weights are calculated as 2n. For
example, 21=2, 22=4, 23=8, 24=16, and so on.
In the following formula, x is the condition weight set on the context dimension used by the child price list
rule and y is condition weight set on the context dimension used by the price list entry rule.
This formula ensures that price list entries on a child price list will win over price list entries on a parent
price list if all other criteria are equal.
Algorithm Assumptions
The Tightest Match algorithm assumes:
• Price list entries with no context rule are assigned a condition weight of 0, or 20, which equals 1.
• Price list entries with a context rule that has a null condition weight are evaluated as 0, or 20, which
equals 1.
• Price list entries with condition weights that are greater than 60 default to 0, or 20, which equals 1.
• Context rules on parent price lists are not evaluated.
• If there are multiple price list entries with the highest weight for the same pricing variable (such as a One
Time Charge or a Monthly Recurring Charge), the interface selects the most recently-created price list
entry and applies that price to the variable in the line item.
For example, imagine you create two rules that evaluate multiple criteria such as sales channel, geographic
region, customer segment, and SLA/service level, and your business objective is to prioritize existing
customer service level agreements above other criteria. You can weight them as follows:
The total condition weight for Rule #1 is 1 + 4, and the total condition weight for Rule #2 is 2 + 3. If the
condition weights were simply summed, these rules would tie. However, using the Tightest Match formula,
the business objective of prioritizing the SLA/service level criteria is achieved because using bitwise
operators, the total condition weights are not equivalent.
• Rule #1 = 21 + 24 = 18
• Rule #2 = 22 + 23 = 12
To simplify your rules environment, the right approach is to leave the condition weight property blank for
most context dimensions. Then, when you want to prioritize certain criteria, it is easy to weight conditions
quickly because 21=2, 22=4, 23=8, 24=16, and so on.
Related Information
Create Context Dimensions.
Tightest Match
1. In Vlocity Product Console, in the Rules area, next to Context Dimension, click Create .
2. On the New Context Dimensiontab, enter the following information.
• Name is the context dimension name.
NOTE
You cannot use spaces in a context dimension name due to rules parsing engine
requirements.
• Code is the code that refers to the rule when creating custom expressions. Use a unique but
meaningful code, so that it is easy to read custom expressions. For more information about custom
expressions, see Child Rules and Expression Modes and Custom Expressions.
NOTE
You cannot use spaces in a context dimension code due to rules parsing engine
requirements.
NOTE
The context rule service supports only single values.
• Cacheable Mode; When this option is checked, cacheable jobs (that is, jobs that populate the API
Cache) will use this Context Dimension. If this option is not selected, the Context Dimension will not
be cached, and therefore will not available to Digital Commerce APIs.
• Default Value specifies the value that will be used for the Context Dimension (and passed to the
Context Rules) when the input context parameters do not have a given value. The value is used in
the case of tightest match for price list entries. If this field is left empty, then the value will be passed
as null.
• Values for caching specifies the list of possible values for this dimension. For each of these values,
the Cacheable Jobs (for example, the Populate API Cache job) will cache a response.During
runtime, if the input context parameter is passed a value that is not present in this list, the CPQ
engine will evaluate the response on the fly and then cache the result.
• Active specifies whether this context dimension is active or not.
• Effective From is the start date of the period during which rules can use the context dimension.
• Effective Until is the end date of the period at which rules can no longer use the context dimension.
3. Click Save
After creating your context dimension, the next step is to create a context mapping. For more information
on creating context mappings, see Creating Context Mappings.
CurrentRuleObjectId Variable
In some cases, you might want to create a context rule that evaluates the entity to which it is applied. For
example, you might want to create a rule that disqualifies a promotion for accounts that have already used
that promotion. Or perhaps you want a rule to disqualify products when they are already in the cart line
items of Vlocity Cart. To do this, you use a special variable called CurrentRuleObjectId, which enables your
rule conditions or functions to access the current object's record Id as it iterates over them.
1. In Vlocity Product Console under Rules, click the create icon next to Context Dimension.
2. In the New Context Dimension dialog, enter the following information.
After you create the CurrentRuleObjectId variable, you can use it in a rule condition or as an input argument
to a function.
For more information on creating and using functions, see Functions for Rules.
1. In the Vlocity Product Console, the Rules section, click the plus icon next to Context Dimensions.
2. In the General Properties section, complete the following fields:
1. In the Vlocity Product Console, the Rules section, click the Plus icon next to Context Dimensions.
2. In the General Properties section, complete the following fields:
1. In the Vlocity Product Console, the Rules section, click the Plus icon next to Context Dimensions.
2. In the General Properties section, complete the following fields:
1. In the Vlocity Product Console, the Rules section, click the Plus icon next to Context Dimensions.
2. In the General Properties section, complete the following fields:
• Rule sets contain one or more context rules, and are applied to products, promotions, price lists, and
price list entries. See Rule Sets.
• Context rules are analogous to entity filters in the advanced rules framework. Context rules determine
when a rule set applies in Vlocity Cart. See Context Rules.
• Context dimensions are variables that describe the possible values to use in a rule condition. You can
reuse context dimensions across multiple rule conditions. The rules engine compares context dimensions
to data that comes from an sObject, a function, or a static value defined in the context mapping. See
Context Dimensions.
• Context mappings enable the rules engine to compare context dimension variables to data stored in
sObjects, calculated using a function, or entered during design-time in a specified context scope. Vlocity
caches context mappings in the session cache. See Context Mapping.
• Context scopes describe the relational path from a root sObject, such as an Order, to related sObjects.
Context mappings use context scopes to pinpoint the fields on the sObjects or compute data to match
with context dimension variables so the Context Rule Service engine can evaluate them. See Context
Scopes.
• Functions are used in context mappings. You can invoke custom implementations to provide additional
logic and processing. See Functions for Rules.
• Object level rules assign penalty rules for contracts. See Creating Object Level Rules.
• Context actions are used with penalty rules to apply a fee when a promotion or contract is canceled.
Context actions enable you to specify either a flat fee using a pricing element on a price list or calculate a
fee by invoking a custom implementation. See Creating Context Actions.
You combine context rule components to create logical expressions that the rules engine can evaluate. For
example:
You must define context scopes and context dimensions before configuring context mappings.
Context scopes and context dimensions link to context mappings. You can access the context mappings
facet when editing a context scope or a context dimension.
1. In Vlocity Product Console, in the Rules list, next to Context Dimension or Context Scope, click Search.
2. Find the context dimension or the context scope for which to make a context mapping.
3. Click Edit to open the context mapping for editing.
4. In the sidebar, click Context Mappings.
5. In the Context Mappings facet, click New Context Mapping.
6. In the New Context Mapping dialog box, enter the following information:
After creating a context mapping, the next step is to create a context rule. For more information about
creating context rules, Creating Context Rules.
• Use API names of related sObjects and fields when writing source expressions.
• When referring to a field on a custom object using a custom lookup, use __r instead of __c as the suffix
syntax, e.g., ContractId__r.ContractTerm using the Asset context scope.
Context Scopes
Context scopes describe the relational path from a root sObject, such as an Order, to related sObjects.
Context mappings use context scopes to identify the fields on the sObjects or computed data that is
matched with context dimension variables. The Context Rule Service evaluates the information.
• Order
• Opportunity
• Quote
• Asset*
• Any
*You can only use the Asset scope for rules invoked during repricing.
Each of these scopes can then reference account and contract scopes.
For more information about the any context scope, see Any Context Scope.
As of CME Summer '18, context rules for pricing adjustments must use a Virtual context scope type. You
use virtual context scopes to map to data entered by users at run time, which is stored only in memory.
orders, quotes, and opportunities, you can use any context scope to evaluate the status for all root entities,
including orders and quotes. You can also specify any as the entity for second-level context scopes,
enabling you to evaluate information in accounts and contracts across all root entities.
While the any context scope allows more flexibility and efficiency when defining context mappings, in some
cases, when you know that the value can come from only on sObject, you might want to explicitly specify
that object as the root scope entity. By doing so, you limit the number of fields that are retrieved and stored
in the session cache. When the context scope is Order.Account, the rules engine retrieves fields from the
account sObject only. If the context scope is Any.Account, the rules engine retrieves fields from all root
entities: Order, Opportunity, Quote, and Asset. For example, the Originating Channel field only exists on
the Order object. If you specify Any as the root entity for Originating Channel, the system will look across all
root entities even though it only exists on Order, which is not an efficient design.
The entity for a virtual context scope is the virtual object name. There are no entity paths used for virtual
context scopes.
Context scopes are used to build context mappings for your context rules.
Using the information in the table below, create context scopes for each of the following entities.
1. In the Vlocity Product Console, in the Rules section, click the plus icon next to Context Scope.
2. In the General Properties section of the New Context Scope dialog, enter the required values for
each entity using the information in the table below.
3. Click Save.
The AdjustmentDataScope is a virtual context scope used to create context rules for pricing adjustments.
Virtual context scopes are supported starting in CME Summer '18. For more information, see Virtual
Context Scopes.If your implementation is using CME Summer '18 or later and the Scope Type picklist does
not display the Virtual picklist item, you must update the picklist items available for the Scope Type picklist
on the Context Scope object. For more information, see Adding the Virtual Picklist Item to the Scope Type
Picklist.
• Context Scopes
• Any Context Scope
• Virtual Context Scopes
You can invoke the Context Rule Message Service using the getRuleMessages action for either the
getProductList or getPromotionList APIs. These APIs are part of the CPQ APIs, which are available using
REST or Apex Remote actions.
Parameter Value
Apex Remote Service Class CpqAppHandler
methodName getRuleMessages
ruleEvaluationInput null
ruleType Qualification
include qualifications
id • {pricebookentryId} for products
• {promotionId} for promotions
cardId {cardId}
See Also
Cart-Based APIs
xx##.salesforce.com/services/apexrest/vlocity_cmt/v2/cpq/GET/carts/{cartid}/
promotions/{promotionId}?include=qualifications&ruleType=Qualification
xx##.salesforce.com/services/apexrest/vlocity_cmt/v2/cpq/GET/carts/{cartid}/
products/{pricebookentryId}?include=qualifications&ruleType=Qualification
The include parameter is required and must be qualifications. The ruleType parameter is
optional.
Failure Messages
When creating context rules, you can create failure messages for the following entities: rule sets, context
rules, and rule conditions.
To enable the display of failure messages for pricing adjustments, set the CPQ Toast Message Log Level
in the CPQ Configuration Setup custom settings to All. For more information on this custom setting, see
CPQ Configuration Settings Reference. When changing a failure message for a pricing adjustment, you
must clear the CPQPartition platform cache to ensure your changes display. For more information, see
Configuring CPQ Platform Cache.
NOTE
When specifying a pricing element on a price list for a context action, the price list can be
different than the price list associated with the order.
Create context actions in Vlocity Product Console. Use context actions when specifying child context rules
for a penalty rule set. For more information about rule sets, see Create Rule Sets.
1. In Vlocity Product Console, in the Rules area, next to Context Action, click Create .
2. On the New Context Action tab, enter the following information.
• Name is the name of the context action.
NOTE
You cannot use spaces in a context action name.
You might want to count records, looking for a certain threshold because, for example, a customer with
more than two mobile phone assets is eligible for the family data plan promotion. Or, you might want to
know if a certain type of record exists in a data set, returned as a Boolean value (true/false); for example,
has the account participated in a campaign in the last 12 months? Because information like this does not
exist as a single field on an object, functions enable you to insert custom logic to create advanced rule
criteria. Creating rules using functions allows complete flexibility and control, but also requires Apex code.
Functions invoke Apex classes and methods. When you create the function, you can define multiple input
arguments and a single output argument that will be passed to and from the Apex class and method. Over
time, you can build a library of functions that can be reused for a variety of different purposes and for
different context rules.
Functions are used in context mappings or in rule conditions. When functions are used in context
mappings, the function output becomes the context mapping value and is compared by the rules engine to
the rule condition values, which are set by the context dimension, just like when you create a context
mapping to a field on an object.
However, when functions are used in rule conditions, the output from the function is compared to a static
value in the rule condition. The other context rule components (such as context dimension) can be used as
input arguments.
In some cases, you might want to create a context rule to evaluate the product or promotion that the
context rule has been applied to.
For example, you might want to prevent customers who have used a promotion from using it again. To do
this, you can create a function that uses the CurrentRuleObjectId variable as an input argument.
Creating Functions
1. Create your Apex class and note the Apex class name and the method name. For more information on
working with Apex classes, see Salesforce's Apex Developer Guide.
2. Create a function definition in Custom Metadata.
3. In Setup, go to Custom Metadata Types.
4. Click Manage Function Definitions.
5. In Function Definitions, Click New.
6. Enter the following information:
NOTE
You can create multiple input arguments but a single output argument. The names of
the arguments are not passed to the Apex class. Instead, the sequence of the input
arguments is used to identify each argument within the Apex code. After the argument
sequence has been set, do not change it without editing the corresponding Apex class
accordingly.
Output specifies the argument that will be passed to the function as output. You
can only define one output arguments.
Data Type • Text Specifies the data type of the argument.
• Number
• Date
• DateTime
• Boolean
Domain Type • Picklist Specifies the domain type of the input argument.
• Object Lookup
• If you select Picklist and specify a Vlocity Picklist here, the picklist values are
• Type in
displayed next to the Picklist radio button when you create a rule condition or a
• Context
context mapping later.
Dimension
• If you select Object Lookup and then specify an object in the Object field
here, you can select a record from that object when you create a rule condition
or a context mapping later.
• If you select Type in, you can type in a value when you create a rule condition
or a context mapping later.
• If you select Context Dimension, you can specify a context dimension to
pass as input to the function when you create a rule condition or a context
mapping later.
Select Context Dimension as the Domain Type when using the
CurrentRuleObjectId variable.
Object String value Used with Domain Type of Object Lookup. Specifies the API name of the sObject
to lookup.
Vlocity Select a picklist using Used with Domain Type of Picklist. Specifies the picklist to use as input to the
Picklist the Vlocity Picklist function.
Lookup dialog.
Picklist • Single Used with domain type of picklist. Specifies whether the user is allowed to pick one
Selection • Multiple value from the picklist or multiple values.
Mode
13. Click Save.
Add as many arguments as needed to support the function's implementation class, then create the
context mapping or rule condition that uses the function.
1. In Vlocity Product Console, the Rules area, click the Plus icon.
2. Complete the required fields and click Save.
3. In the right menu, click the Rule Conditions option.
4. Click Add Condition and select Simple.
5. Enter the following rule conditions:
a. Code — any unique value
b. Field Name — name of the context dimension you have created
c. Operator — select a desired operator
d. Value — select a desired value
e. Fail Level — select a desired value
For example:
You can also migrate context rules using IDX Workbench. See IDX Workbench Desktop Application.
The migration process migrates all data related to context rules, including:
• Functions
• Context Actions
• Context Dimensions
• Context Scopes
• Object Level Rules
• Rule Sets
You can migrate context rule data using the DataPack Export functionality, which is invoked by the URL to
the DataPack Home Visualforce page.
For example:
apex/DataPacksHome?exportDataPackType=<data-pack-name>&exportData=<record-ID>
apex/DataPacksHome?exportDataPackType=Rule&exportData=a2b46000000dsxM
apex/DataPacksHome?
exportDataPackType=ContextDimension&exportData=a3441000000S5BA
You must export each context rule and context dimension individually. Once exported, you can create a
multi-pack to bulk import all context rules and context dimensions at the same time.
NOTE
At this time, the export of multiple context rules or context dimensions is not supported.
This task is a step in the Migration of Context Rules Between Environments process.
This task is a step in the Migration of Context Rules Between Environments process.
1. In the All Tabs page, click the Vlocity Context Dimensions link.
The Vlocity Context Dimensions pages displays all existing context dimensions.
2. Click the name of a context dimension you wish to export.
3. In the browser URL line, copy the ID of the context dimension.
5. Click Enter.
The Export DataPack dialog box appears.
Create a MultiPack
Once you have exported all context rules and context dimensions, to import all rules and dimensions to
another environment at the same time, create a multipack.
This task is a step in the Migration of Context Rules Between Environments process.
1. In the source environment, the All Tabs page, click the Vlocity DataPacks link.
For each context rule and context dimension, a data pack is created and listed in the Vlocity
DataPacks page. Use the Last Modified column to view a list of recently created datapacks.
2. Click each data pack you wish to import to expand it and select the checkbox.
This task is a step in the Migration of Context Rules Between Environments process.
1. In the source environment, the All Tabs page, click the Vlocity DataPacks link.
2. Click the Installed tab.
3. Click Import From File.
4. Browse to the location of the multipack JSON file, which is located in the Downloads folder by default.
5. Select the file.
6. Click Next, Next, Next, and Done.
Vlocity provides the following rule types: Compatibility, Pricing, and Availability & Eligibility rules.
• Compatibility rules: Use product relationships to ensure products ordered in Vlocity Cart are compatible
based on conditions in order line items and related objects. They are also known as Configuration or
Validation rules.
• Pricing rules change standard pricing and operate on order line items in Vlocity Cart.
• Availability & Eligibility rules are legacy rules that display or hide products in Vlocity Cart's product list
based on conditions in opportunity, quote or order header data or data in related objects such as
Accounts or Assets. (Except in certain circumstances, these rules have been replaced by context rules.)
Advanced Rules Framework works in tandem with Context Rules Framework. To understand which type of
rule to use in each situation, see Context Rules or Advanced Rules: What Type to Use?
Vlocity provides a configure, price, quote (CPQ) rules framework. Rules are associations of entity filters and
actions. Entity filters evaluate objects for specific conditions. Rules execute actions on qualified objects.
You can create and implement reusable rules using the Vlocity Rule Builder. Each rule is built using natural
language. The natural language and visual Rule Builder enables designing new offers and managing
promotions through availability, eligibility, compatibility, and pricing rules. Rules use filters to identify a set of
items, and then apply one or more action steps to each remaining item. You can choose from existing filters
and actions, or you can create new ones.
Rules Overview
Vlocity provides a Configure, Price, Quote (CPQ) rules framework. Rules are associations of entity filters
and actions. Entity filters evaluate objects for specific conditions. Rules execute actions on qualified
objects.
A defined rule applies to an object, such as an Opportunity, Order, or a Quote. Rules are run based on the
implementation that the interface calls. Rules can operate on any object, but they are usually used on CPQ
objects. The Vlocity open interface implementations invoke the rules that you specify in flow steps.
A rule often includes an entity filter, which filters the objects on which to run. Each rule includes a rule
action, which defines what the rule does. For every rule, the rule action is different. Rules can use entity
filters to define what the rule is, how it’s used, and what it does.
Rules execute with system, or org, privileges, and not those of the user triggering them. For example, a
user who has no rights to see the customer class level can run rules that are based on the customer class
level. If a rule must exclude certain products or pricing based on a user profile, the profile check must be a
part of the rule itself.
• Header-level Rules act on parent objects, such as Opportunity, Order, and Quote.
• Item-level Rules act on line items.
There are four Rule types. Each Rule type has a different action behavior.
• Availability
• Eligibility
• Compatibility, also known as Configuration or Validation
• Pricing
Availability and Eligibility Rules are defined at the header level. Compatibility and Pricing Rules are defined
at the item level.
Vlocity supports standard and advanced Rules. Using standard Rules, you might restrict availability of
products to customers in specific locations or restrict eligibility of some products based on Account type.
Advanced Rules implement a story. They provide the answers to questions such as, “How is each product
in a quote priced? Why is this set of products available to this specific customer at this time?” You can use
advanced Rules to do the following:
• Compatibility depends on context, for example, recommend free installation for Gold customers.
• Compatibility depends on Product attributes, for example, exclude a service if the Internet speed is less
than 100 Mbps.
Offering procedures support inclusion or exclusion. Vlocity supports multi-service point ordering, in which
different sites have different availability and eligibility rules. Eligibility rules exclude products of specific
types.
Availability and eligibility rules must run against the header object (Opportunity, Quote, or Order).
Availability rules are usually run first. If a product or service is unavailable, then eligibility is irrelevant.
Use availability implementations to specify what product is available for a specific shipping state, city,
country, street, contact, or product attributes. Availability rules use the ProductAvailabilityInterface and
associated implementations. The ProductAvailabilityInterface is called when a request is made to provide a
list of products that are available to the customer to select. Availability implementations include the
following:
• AvailabilityFlowOpenImplementation: Evaluates defined availability rules and filters products and still
displays products that are not available so the user can see them but cannot add them to the cart.
• AvailabilityRulesFlowImplementation: Run advanced availability rules when the sequence of those rules
is important.
• DefaultAvailabilityOpenImplementation: Provides availability in a loosely typed nonoperative interface.
• DefaultProductAvailabilityImplementation: Nonoperative (does not run availability rules)
• FilterAvailabilityImplementation: Run advanced availability rules when the sequence of those rules is
unimportant.
• LocaleProductAvailability: Run standard availability rules.
• XLIAvailabilityValidationService: Invokes availability rules to validate line items.
Vlocity supports multi-service point ordering, in which different sites within the same opportunity, order, or
quote have different availability and eligibility rules.
To base availability rules on attributes, you must ensure that you set those attributes on the appropriate
products. For more information, see Set Up Product Attributes.
The rule actions in availability and eligibility rules are called offering procedures. Offering procedures
support inclusion or exclusion. An offering procedure is another object that you define to include or exclude.
For more information, see Rule Actions.
Compatibility Rules
Compatibility rules are also known as configuration rules or validation rules. 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.
Compatibility rules run on Order Line Item objects—Opportunity Line Item, Quote Line Item, or Order Line
Item. The rule actions involve product relationships.
Compatibility rules define the relationship between products to ensure that the correct combination of
products is added to the cart. Compatibility rules use the ProductValidationInterface and associated
implementations to execute definitions in the Product Relationship object. For more information about
product relationships, see Product Relationships Overview.
The validation interface and implementation are triggered when products are added to an order.
Compatibility rule implementations include:
• ValidationRulesFlowImplementation
Use ValidationRulesFlowImplementation when using a flow with Compatibility Rules included.
• ValidationRulesImplementation
Use ValidationRulesImplementation when using advanced Compatibility Rules, including those that
should be run conditionally.
• ProductRelationshipValidationImpl (deprecated)
Use ProductRelationshipValidationImpl when using standard Compatibility Rules with soft relationships—
requires or excludes.
NOTE
With the ValidationRulesImplementation, you must also use a flow that includes a custom
action with the class name UnconditionalProductValidation.
For more information about interfaces and implementations, see the Interfaces, Implementations, and
Services.
You can also create compatibility rules based on product attributes, for example, exclude Product B if
Internet speed is less than 100Mbps. For more information about product attributes, see Product Attributes.
Before you create a compatibility rule, you must create an entity filter that defines the conditions. The entity
filter must be run on the same object type as the rule. For more information about entity filters, see Entity
Filters Overview.
Pricing Rules
Pricing rules determine the price of the products in the cart. They use calculation procedures to calculate
the appropriate prices and apply discounts. When you create a pricing rule, you specify a calculation
procedure as the rule action.
Pricing rules can be hard or soft. When a pricing rule is soft, a customer can see a price even if she is not
eligible for it. When a pricing rule is hard, a customer cannot see the price if she is not eligible for it.
Many pricing rules run in a defined sequence to result in the correct order pricing. Pricing rules, using entity
filters and rule actions, modify orders. Actions may include calculation procedures, offering procedures,
product relationships, and entity filters.
Pricing depends on pricing rules, which are based on attributes. The attributes drive the pricing. You can
offer one product with pricing based on its attributes.
For example, you can offer broadband Internet service at different prices for 50 Mbps, 100 Mbps, and so
on. You can also define rules that specify one price for a product by itself, but a different price when the
product is part of a bundle.
You can implement promotions using pricing rules and the PricingRulesFlow. For more information about
flows, see Flows.
Pricing rules use the PricingInterface and associated implementations to calculate the correct order total.
The pricing interface and implementation are triggered when a product is added to, deleted from, or
modified in an opportunity, order, or quote.
• DefaultPricingImplementation: Use with standard pricing rules that are not dependent on any external
factors.
• PricingRulesFlowImplementation: Use with advanced pricing rules that are dependent on external
factors.
NOTE
You must associate the PricingRulesFlowImplementation class with the flow name. For
more information see PricingRulesFlowImplementation .
• Office Internet Solution costs $25 per month with a $10 one-time fee.
• All non-discounted child items should be priced at $0.
• Office Internet Solution is discounted by 10% if the quantity is 10 to 25, discounted by 15% for a quantity
of 26 to 99, and discounted by 20% for a quantity of 100 or more.
• The monthly price of Office Internet Solution is based on the selected download speed and upload
speed.
Pricing rules must be run on Line Item objects—Opportunity Line Item, Order Line Item, or Quote Line Item.
Rule Objects
A Rule object is a header object with three related objects: Rule Filter, Rule Action, and Rule Variable.
The Rule Filter object encompasses the Entity Filter that a Rule uses. Rule Filter object fields include:
• Rule Filter Name specifies the name of the Rule Filter. Salesforce automatically names the Rule Filter.
• Entity Filter is a lookup to the Entity Filter that the Rule uses to qualify the objects. For more information,
see Entity Filters Overview.
• Rule is a lookup to the associated Rule object.
The Rule Action object defines the actions associated with the Rule. Rule Action object fields include:
The Rule Variable object defines the variables that are used in the Entity Filters. Rule Variable object fields
include:
• Variable name specifies the name of the variable, which is used to reference the variable in the Entity
Filter.
• Rule is a lookup to the associated Rule object.
• Entity Filter is a lookup to the Entity Filter that the rule uses to qualify the objects that populate the
variable.
• Type specifies the variable type.
• Field Name to Assign specifies the field used to populate the variable.
• Object Path is a comma-delimited value that describes the path to the list of objects to use when
populating the variable.
Rule Actions
You can specify the sequence in which rules execute rule actions. You can associate rule actions with
evaluation entity filters. If the rule action in an entity filter evaluates to false, then the action will not be
executed. The available rule actions vary by rule type.
• Require: If a customer adds Product A, require that she also adds Product B.
• Recommend: If a customer adds Product A, recommend that he also adds Product B.
• Exclude: If a customer adds Product A, stop her from adding Product B.
• Order add, or automatically add: If a customer adds Product A, automatically add Product B.
• Order replace, or switch: If a customer adds Product A, replace it with Product B.
• Order remove, or automatically remove: If a customer adds Product A and Product B, automatically
remove Product B.
The rule actions on eligibility and availability rules are offering procedures, special procedures for
presenting products and offers. Offering procedures are Exclusions or Inclusion. See Create Offering
Procedure Rule Actions.
• Exclusions: Exclude all products qualified by the entity filter in the rule action.
• Inclusions: Include all products qualified by the entity filter in the rule action.
1. Click the Vlocity Offering Procedures tab in your org. If it is not visible, click Vlocity Offering
Procedures in the App Launcher.
2. Click New.
The Vlocity Offering Procedure Details page appears
Rule Variables
Rule Variables can hold information passed to them by Entity Filters. For example, suppose that you want
to identify offers that a customer has rejected in the past year. You must check each Product against the
Account Offers that a customer has rejected. This means you must check the vlocity_cmt__ProductId__c
field. When you do that, you must store the Product IDs in a list to compare them. In the Rule Variable, you
specify the path from the Product to the Account Offer, AccountId, vlocity_cmt__AccountOffer__c,
vlocity_cmt__AccountId__c.
You define a Rule Variable in a Rule and refer to it from the associated Entity Filter. You must create a Rule
before you can create a Rule Variable.
Variables use the syntax {!$Variable.variableName}, where variableName is the name of the Rule
Variable.
• Variable Name specifies the variable name, which you will refer to in the Entity Filter conditions using the
format {!$Variable.variableName}.
• Rule is a lookup to the associated Rule. Salesforce automatically populates the Rule field.
• Type specifies the variable type:
• If the variable has a single value, select sObject, String, or Id.
• If the variable has more than one value, select List <sObject>, List <String>, or List <Id>.
• Object Path is a comma-delimited value describing the path to the list of objects to use to populate the
variable.
• Entity Filter is a lookup to the Entity Filter used to qualify the objects that populate the variable.
• Field Name to Assign specifies the object field used to populate the variable.
The Object Path consists of three comma delimited values. For example:
AccountId,vlocity_cmt__AccountOffer__c,vlocity_cmt__AccountId__c
The example describes the path from the Opportunity object related list to the Account.
The Field Name to Assign defines that vlocity_cmt__ProductId__c will be extracted from the
related list and added to the variable.
For more information about using and creating Rule Variables, see Create a Rule Variable.
An entity filter focuses on selected items in the order. For example, the flow implements promotional pricing
for Sports and Movies channels that are child products of the ICU Cable service. The action is applied to
the selected items, in this case, Sports and Movies. Applying the action results in changed order pricing.
An entity filter consists of one or more conditions that are based on fields or attributes. Entity filters apply
those conditions to objects. Each object is evaluated to determine if the condition applies to it.
You build entity filters by dragging elements to visually represent the filter results. Entity filters are
associated with rule actions. A rule action can be a matrix, calculation, or procedure.
Entity filters focus on select line items. For example, you can create an entity filter to return all child
products, except discounts. You can define entity filters to run for specific dates, or you can leave the dates
blank to run the filters on any date (all the time). You can also reuse entity filters.
You can add only one entity filter to an action, but you can create compound entity filters.
Filters are reusable and additive. Over time, it is possible to build a library of filters.
NOTE
Other names for entity filters include rule action filters and rule filters.
Applicable Sub Type is set to Product Attribute. See Create Attribute Categories in the Product
Designer.
• Field—Select products based on fields in an object.
• Filter—The system looks up something that was found in another filter and does something else with it.
This type is also known as a compound filter.
Entity Filters include operators and values. Conditions use the operators and/or. The index starts at zero.
You can use the following operators in an Entity Filter:
• Evaluation— Determines if a set of object records matches specific conditions. Returns true or false.
• Qualification— Determines if a set of records qualify to be acted upon. Returns qualified line items.
In Evaluation Entity Filters, the input is a list of items, and the output is the result true or false. Evaluation
filters are internal filters. Evaluation filters evaluate if all, any, or none of the objects satisfy a set of
conditions.
In the image below, the evaluation filter evaluates to true if any of the product children has a maximum
quantity of less than 10 and a minimum quantity larger than 2. You would also use an Evaluation Entity
Filter to act on accounts that have not used free installation in the past year. You can use Evaluation Entity
Filters as arguments in Qualification Entity Filter conditions.
In Qualification Entity Filters, the input is a list of items and the output is a list of qualified items. Qualified
items meet the filter conditions. Qualification Entity Filters quantify a set of objects against a set of
conditions.
For example, you could return only those accounts where the shipping state is Alaska or Hawaii.
Id,vlocity_cmt__ProductChildItem__c,vlocity_cmt__ParentProductId__c
The value consists of three comma-delimited values. The example describes the path from the product
object to the product child items related lists.
• Index defines the sequence of conditions. Using the index values, you can build a formula to evaluate
the conditions. For example, {0}AND{1}OR{2}.
• Type defines the filter condition type. The supported values are Attribute, Field, and Filter.
• Use Attribute when creating a condition on a JSON attribute.
• Use Field when creating a condition on a field.
• Use Filter when creating a condition on another internal filter.
NOTE
If you select Attribute from the Type picklist, you must include a valid attribute in the
Field/Attribute Name field. If you do not, you may receive a null pointer error.
• Field Type defines the field type for a Field Entity Filter. Vlocity automatically populates this field when
you select the field name.
• Field/Attribute Name defines the field name or attribute identifier on which the condition is run.
• Operator defines the condition operator.
• Value defines the value to compare. Currently, the following values are available:
• Literals—Literal string values.
• Variables—Variables defined through the rules or passed through the implementation. Use the
following syntax to reference variables: {!$Variable.variableName}, where variableName corresponds
to the variable name used.
• Functions—Supports simple Date and DateTime functions, such as today, today-numOfDays, and
today+numdOfDays.
• In Availability and Eligibility Rules, the Entity Filter qualifies products. The system expects the Entity Filter
to run on the Product2 object. Entity Filters for Availability and Eligibility Rules run on the header level.
• In Compatibility Rules, an Entity Filter works with the Rule Filter to further qualify an object. That is, the
Rule Filter is a general qualifier and the Entity Filter narrows down the qualified products. The Entity Filter
and the Rule must be run on the same object type. Entity Filters for Compatibility Rules run on the line-
item level.
• In Pricing Rules, the Entity Filter determines to which items the Rules are applied. Entity Filters for
Pricing Rules run on the line-item level.
FilterEvaluator Class
The FilterEvaluator class uses Entity Filters to compare objects to the defined conditions.
A product relationship is or is not conditional. If a product relationship is conditional, it is only applied under
certain conditions, defined in the compatibility rules. If a product relationship is not conditional, then it
always applies.
• Recommends
• Requires
• Excludes
• Automatically add
• Automatically replace
• Automatically remove
You define product relationships in the Product Relationship object, which corresponds to the Product
Relationship record detail page.
NOTE
For the asChild option to work, the product to be added must be defined as a child to
the original product, with a default quantity of zero. You may also need to run the
Product Hierarchy maintenance job. For more information, see Administration Jobs
Reference for Vlocity Communications, Media, and Energy.
NOTE
This option is only applicable if the UnconditionalProductValidation custom action is
included in the Validation flow. For more information about flows, see Flows.
To use Product Relationship objects to their fullest extent, you must use the
ValidationRulesFlowImplementation, which includes a custom action with the specified class name
UnconditionalProductValidation. You can also use a custom implementation, as long as it includes the
UnconditionalProductValidation class or a similar class. For more information, see Interfaces,
Implementations, and Services.
For example, you may want to recommend that, when a customer orders an iPhone, he also orders an
iPhone case. To do so, you create a product relationship for the iPhone.
6. Click Save.
• Rule
• Rule Filter
• Rule Action
• Rule Variable (optional)
When you define a Rule, you provide a descriptive short name and a long description. You specify the filter
type to apply to the object. You also set the status as active or inactive and set the effective dates. You can
define Rule using natural language, so people can read and understand what the rule is meant to do.
After you have created the prerequisite elements, use Vlocity Rule Builder to group the elements in a Rule.
Using the Rule Builder, you define what the Rule must do, associate Entity Filters with the Rule, and define
the Rule Actions.
You build entity filters by dragging elements to visually represent the filter results. You can define entity
filters to run for specific dates, or you can leave the dates blank to run the filters on any date (all the time).
You can also reuse entity filters.
In this example, Office Internet Solution is not available to customers in Alaska and Hawaii when the
selected download speed is less than 100 Mbps.
NOTE
To edit entity filters, the DefaultEntityFilterEditFieldset custom setting must be present and
include the value Entity_Filter_Edit_Field_Set. For more information, see CPQ
Configuration Settings and Add CPQ Configuration Setup Settings.
11. In the Value box, enter the appropriate value. In this example, enter AK when creating the first
condition, HI when creating the second condition, and 25 Mpbs;50 Mbps;75 Mbps when creating
the third condition.
NOTE
The delimiter is a semi-colon (;). Ensure there is no space between the “;” and the
next value. The values must exactly match the attribute values as they’re defined on
the product.
Rule Variables
Use Rule Variables to hold the information passed to Rules from Entity Filters.
• You want to identify offers that have been rejected in the past year.
• You want to identify promotions that have been offered to and rejected by a customer in the last six
months.
2. Determine the Entity Filter field that will populate the Rule Variable.
3. Determine the Rule Variable type. What information do you need the variable to store?
• If the variable has a single value, it will be an Sobject, String, or Id.
• If the variable has more than one value, it will be a List<Sobject>, List<String>, or List<Id>.
The Rule Variable type should match the Entity Filter field type.
4. Determine the path from the parent object to the queried object.
5. Determine which Entity Filter you must use to qualify the object records and populate the Rule Variable.
1. Create the Rule. For more information, see Go to Vlocity Rule Builder.
2. After you save the rule, on the Vlocity Rule page, scroll down to the Rule Variables related list.
3. Click New Rule Variable.
NOTE
Salesforce automatically enters the associated Rule name, for example, Exclude
offers rejected by customers.
5. Click Save.
NOTE
The Country and City fields are not currently used in Availability Rules.
1. On the Product page, scroll down to the Products Not Available related list.
2. Click New Product Not Available.
In the Product Not Available Rule box, enter a name for the rule.
3. Enter either a state or an inclusive postal code range.
NOTE
Data in the State field is case-sensitive and must match data in the Shipping Address
field on the Opportunity, Order, or Quote.
For example, you can make a Product ineligible for all Bronze-level business accounts. Another product
may be restricted to all Consumer Accounts, regardless of SLA.
In this procedure, the Office Internet Solution cannot be ordered on an Account when the Record Type is
Billing.
1. On the Product page, scroll down to the Products Not Eligible related list.
2. Click New Product Not Eligible.
3. In the Product Not Eligible Rule field, enter a name for the Rule.
4. Enter a Start Date.
5. If you want the Rule to expire, enter an End Date.
6. From the Account Record Type picklist, select the Account record type that is not eligible for the
product, for example, Billing.
7. From the Account SLA picklist, select the account service level agreement to which the Rule applies.
8. Click Save.
In this example, customers are eligible for free installation when they have been a customer for less than
one year.
a. In the Filters and Actions list, click Add To Rule Action to include or exclude the filter.
NOTE
The rule actions in availability and eligibility rules are called offering procedures.
Offering procedures support inclusion or exclusion. An offering procedure is
another object that you define to include or exclude. For more information, see
Rule Actions.
For example, the Office Internet Solution product should not appear in the list if the shipping address state
is AK or HI, nor should it appear for Billing Accounts.
NOTE
Before you can test Rules, you must ensure that Vlocity is using the appropriate interface
implementation. For more information, see the Interfaces, Implementations, and Services.
In the example, Gold accounts are automatically given a free case when they order an iPhone 6.
1. Create the necessary Product Relationships. For more information, see Create a Product Relationship.
In this example, create a Product Relationship for the Apple iPhone 6 that automatically adds an
iPhone case.
2. Create the necessary Entity Filters. For more information, see About Build Rules and Entity Filters
In this example, create an Entity Filter that returns the Gold accounts.
• The Entity Filter Name is Parent Order Account Gold.
• The Filter on Object Name is Order Product<OrderItem>.
• Active is selected.
• The Type is Qualification.
3. Create the necessary Entity Filter conditions. For more information, see Entity Filter Conditions.
In this example, the condition finds the Gold accounts.
• The Type is Field.
• The Field/Attribute Name is Order.Account.vlocity_cmt_vCustomerPriority.
• The Operator is = (equal sign).
• The Value is Gold.
4. Click the Vlocity Rules tab.
5. Click New.
• From the This defines picklist, select the Rule type, for example, Configuration.
• From the Rule that applies to picklist, select the object to which the Rule applies, for example,
Order Product<Order Item>.
• From the And is picklist, select if the rule is Active or Inactive.
• In the Description field, enter a description of what the Rule does.
7. Scroll down to the Filters and Actions section.
For example, ordering an iPhone 6 from a Gold Account should add a free case.
NOTE
Before you can test Rules, you must ensure that Vlocity is using the appropriate interface
implementation. For more information, see "Set an Implementation," in the Interfaces,
Implementations, and Services.
For example, you can base the price of the Office Internet Solution on download and upload speeds. You
can also provide a discount if a customer orders more than one Call Me 500 Plan. For more information
about pricing, see Pricing Rules.
1. If necessary, create a Calculation Matrix to define quantity ranges or discounts. For more information,
see Calculation Matrices.
2. Create a Calculation Procedure to calculate the different charges. For more information, see Test a
Product Relationship.
3. If necessary, create one or more Entity Filters. For more information, see Entity Filters Overview.
4. Click the Vlocity Rules tab.
a. Click New.
b. Enter the following information:
• Rule Name is the name of the Rule. Enter a descriptive name so you can easily remember what
the Rule does.
• From the This defines picklist, select the Rule type, for example, Pricing.
• From the Rule that applies to picklist, select the object to which the Rule applies, for example,
Order Product<Order Item>.
• From the And is picklist, select if the rule is Active or Inactive.
• In the Description field, enter a description of what the Rule does.
NOTE
Before you can test Rules, you must ensure that Vlocity is using the appropriate interface
implementation. For more information, see "Set an Implementation," in the Interfaces,
Implementations, and Services.
1. Add the Rule to the Pricing Flow. For more information, see Add a Rule to the Pricing Flow.
2. Click the Orders tab.
3. Create a new Order.
4. On the Order detail page, scroll down to the Order Manager.
5. Add the products that are relevant to the Pricing Rule.
6. Confirm that the price each product is correct.
If… Then…
An active flow is not present Next to the latest inactive flow, click Open.
An active flow is present Deactivate the latest flow, and then click Open. Save the flow as a new version.
5. In the palette, scroll to the Apex section.
You can invoke rules using the RuleSupport class. The elements in FlowStaticMap are different based on
the rule type.
//The elements in the FlowStaticMap will be different based on the rule type
//The following describes the input in the case of an Eligibility/Availability
rule
FlowStaticMap.flowMap.put('itemList',new list<Sobject>{item});
FlowStaticMap.flowMap.put('pricebookIdToItemWrapper',
pricebookIdToItemWrapper);
Map<String, Object> input = new Map<String, Object>();
Map<String, Object> output = new Map<String, Object>();
input.put('ruleIdentifierType', 'Id');
input.put('ruleIdentifiersList', ruleIds);
input.put('flowMap', FlowStaticMap.flowMap);
RuleSupport ruleSupport = new RuleSupport();
RuleSupport.invokeMethod('executeRules',input, output, null);
Deactive a Rule
You can deactivate rules. You want to deactivate rules when migrating Vlocity CLM to another org, for
example.
To deactivate a rule:
To configure the rule, you must create one rule action and one rule variable. The rule variable will collect
the declined product IDs from the account offers object related to the account. This variable will then be
used within the entity filter associated with the rule action in order to exclude the correct products.
• Variable Name: Name of the variable. This name will be used to reference the variable in the entity filter
conditions.
• Rule: Lookup to the associate rule
• Type: Type of variable
• Object Path: Comma-delimited value describing the path to the list of objects to use in populating the
variable. The Object Path consists of three comma-delimited values. The sample
AccountId,vlocity_cmt__AccountOffer__c,vlocity_cmt__AccountId__c describes the
path to the account offers related list from the opportunity object.
• Entity Filter: The filter used to qualify the objects populating the variable
• Field Name to Assign: the field used to populate the variable. It defines that
vlocity_cmt__ProductId__c is extracted from the related list and added the variable.
In this example, the parent must have a quantity greater than one and an attribute memory size of 16GB.
In this example, you create a configuration rule with one action. Pair the action with a filter to qualify the
triggering product that checks the quantity and the memory attribute value. Create configuration rules
against the Line item objects (Opportunity Line Item, Quote Line Item, or Order Item). This example is for
the Order Item, with a product relationship of type Modify Attributes, and an action parameter JSON
describing the actions to be against the target line item.
Verify that the has rule flag is enabled for each attribute with a rule. Failure to set that flag results in the
runtime user interface bypassing the required APIs, so the rule will not apply.
• The rule supports two attribute modification contexts: Bundle and Cart. Selecting Bundle causes the rule
to apply the actions to the related product within the same bundle of the triggering line item. Selecting
Cart applies the actions to the related product within the cart.
• The action parameters JSON can be created using the product configuration procedure editor. Once
created the JSON can be moved to the product relationship. Make sure to delete the mock product
configuration procedure once the JSON is copied.
• The rule supports a self action by leaving the related product field empty, the actions are applied to the
triggering product.
• Create all the entity filters used within the rule actions.
• Create all the action procedures used within the rule actions.
For the Actions Parameter field, see Create Action Parameter JSON with Product Configuration Procedure.
After you save the product configuration procedure, you can view the Action Parameters code on its
Details tab. You can copy the code and paste it into a product relationship's Action Parameters field.
Action Description
Constrain Include or exclude certain picklist entries.
Assign Assign a value to any type of attribute.
Disable Disable an attribute of any type.
Require Mark an attribute of any type as required.
Hide Hide attribute in the UI. The attribute definition is still in the JSON, but it's hidden from the user.
7. Select the action type, which varies depending on the action.
• Disable, Require, and Hide have Yes and No options.
• Constrain has Exclude and Include options.
• Assign has no action types.
8. Select an attribute value.
• For Constrain, select the attribute to include or exclude.
• For Assign, enter the value to set for the attribute.
• Disable, Require, and Hide require no attribute value.
9. Click Save after you specify all the attribute actions and values for a product.
10. In the Details tab for the saved configuration, copy the JSON for the Action Parameters field, and
paste it to your Product Relationship.
See Also
• Setting Up a Vlocity Attribute Configuration Rule to Modify Attributes Across Line Items
Context rules and advanced rules support slightly different functionality, so it's important to understand
these differences to determine the best type of rule to use. You must fully define your requirements end-to-
end before you can map your requirements to the rules functionality matrix below.
Here are some questions to help you define your requirements and select the best rule framework to meet
those requirements.
How will you manage this rule? Context Rules Advanced Rules
I need to apply this rule to a large number of products. Not supported Supported
I need maximum performance using caching. Supported Not supported
Promotions
Promotions offer a variety of capabilities. You can configure the cart so that agents or customers can add a
promotion list to the cart. You can create more than one promotion to apply to a product or product bundle.
You can apply promotions to new or existing line items in the cart. You can use follow-on promotions, apply
penalty fees, and define service continuation after a promotion expires.
• Discount the price of a product in a promotion without updating the product hierarchy or price book.
• Apply promotional discounts to products that are already assets.
• Automatically charge a penalty if the customer does not fulfill the promotion’s time commitment.
• Create promotions which begin automatically as soon as a previous promotion ends.
• Automatically continue or discontinue the subscription of a promotion’s products based on the customer’s
request.
Discounts allow you to create products and offers that have discount prices. Promotions offer additional
functionality.
• Time commitment: How long the customer must subscribe to the promotion’s products
• Changes to pricing and time frame: Whether the products of the promotion are changed by an
adjustment or override, and for what length of time
• Whether the promotion appears in the Promotions list of the cart
A product:
• Typically does not expire after a brief limited time, such as three months
• Contains products or quantities of each product that are not necessarily limited
• Is not for a limited group of customers
Promotions consist of individual products or product bundles you create for a limited:
• Time
• Customer group
• Subset of products
• Combination of products
Both promotions and discounts allow applying time-based pricing adjustments in Opportunities, Quotes, or
Orders.
The following table summarizes the differences between promotions and discounts.
Promotions Discounts
Allow setting pricing adjustments at product level only. Allow setting pricing adjustments at both the product and the catalogue or
category level.
Promotions Capabilities
Promotions offers a variety of capabilities. You can configure the cart so that agents or customers can add
a promotion list to the cart. You can create more than one promotion to apply to a product or product
bundle. You can apply promotions to new or existing line items in the cart. You can use follow-on
promotions, apply penalty fees, and define service continuation after a promotion expires.
Orderable Promotions
Promotions that appear in the Promotions list of the cart can be added to the cart by the agent or customer.
If you have configured Vlocity cart to do so, a qualified and disqualified promotions list appears.
Promotions Automation
You can automate functionality with promotions to:
• Set a promotion to begin as soon as a previous one ends. This is called a follow-on promotion. Follow-on
promotions are not orderable, meaning they do not appear in the list of promotions of the cart. For more
information, see Using a Follow-on Promotion.
• Apply penalty fees. You can use context rules to automatically apply a penalty fee when a promotion is
canceled before the date committed to by the customer. For more information on the how to use a
context rule to trigger a penalty fee, For more information, see Penalty Rules for Promotions.
• Determine whether the product subscriptions of a promotion continue or discontinue at the end of the
promotion, depending on whether the customer contacts you. For more information on service
continuation after a promotion expires, see the settings for Service Continuation in Basic Promotion
Settings.
• How do you describe the promotion? The promotion description can appear in the Vlocity Cart promotion
list. It’s important to describe clearly what the promotion includes. See Completing Basic Promotion
Settings.
• Do you want the promotional pricing to apply only to line items in the cart or to assets as well?
• How long is the subscription commitment? You need this information to set the commitment duration time
plan. See Time Plans for Products in Promotions.
• When does the subscription start and end? This information is important for the time policy.
• How will the subscription end? Will the subscription end unless the customer chooses to continue the
product subscription or will the customer need to cancel for the subscription to end? See Completing
Basic Promotion Settings.
• What is the time frame for child product price reductions? Some child products may require time plans
that are separate from and shorter than the commitment duration time plan of the promotion. See Time
Plans for Products in Promotions.
You may find it more convenient to group products together in bundles before adding them to a promotion,
instead of putting products in a promotion to group them.
Create a Promotion
To create a promotion, you define basic settings and add products to the promotion. You can change the
pricing of products, and add context rules to the promotion.
1. Complete basic settings about the promotion, including its name, unique code, and the price list the
promotion uses. See Basic Promotion Settings.
2. Add one or more products to the promotion and make the appropriate edits. See Adding a Product to a
Promotion.
3. Change the pricing of any product of the promotion. See Changing the Price of a Product in a
Promotion .
4. Add any context rules to apply to the promotion. See Qualification Rules for Promotions.
1. Navigate to the Product Console. For more information, see Navigating to the Vlocity Product Console.
2. Next to Promotion, click Create .
3. In the New Promotion page, complete the General Properties section.
a. In Name, enter a name for the promotion.
b. In Code, enter a unique code to identify the promotion from all other promotions.
c. In Description, include specific information about the promotion. This description can show in the
Promotions list of the cart when you configure the cart to do so.
d. In Price List, search for and select the price list where the promotion is stored.
4. Complete the Duration section.
a. In Commitment Duration Time Plan, choose the time plan for the entire promotion.
b. In Commitment Duration Time Policy, choose the time policy that applies to the entire
promotion.
5. Complete the Additional Properties section.
a. For Orderable, select this option if you want the promotion to appear in the Promotions list of the
cart.
b. In Service Continuation, choose an option for automatically continuing service after the
promotion ends, if applicable.
c. In Follow-on Promotion, choose a promotion that you want to begin as soon as the promotion
you are creating ends.
6. Complete the Effectivity section.
a. Select Active to make the promotion available for use.
b. Click in the Effective From field and select a date the promotion becomes effective.
7. Click Save.
The following tables explain the fields to complete for a price list entry.
For example, "20% off data plan for 6 months and $150 off the iPhone X".
Redeemable Code A code available for customers to use to be eligible for the promotion.
Price List The price list where the promotion will be stored. The products you add to the promotion must be from the same
price list as the promotion.
Options are:
• Not Applicable: No automatic functionality applies when the promotion commitment duration ends.
• Manual Opt-In: Select this option to require the customer to contact you and request the subscription to the
promotion's products continue. If the customer does not contact you, the subscription to the promotion's
products ends automatically.
• Manual Opt-Out: Select this option to require the customer to contact you and request the subscription to the
promotions products to end. If the customer does not contact you, the subscription to the promotion's
products automatically continues.
Follow-on Select a promotion to begin after this promotion's commitment duration ends.
Promotion
1. Navigate to the Product Console. For more information, see Navigating to the Vlocity Product Console.
2. Next to Promotion, click Search.
3. Search for and select the promotion.
4. From the search results, click Promotion Products.
5. In the configuration panel, complete the General Properties section.
a. In Action Type, choose how the promotion acts.
b. In Product, search for and select the product to add to the promotion.
c. In Update Scope,
6. Complete the Cardinality section.
a. In Minimum Quantity,
b. In Quantity,
c. In Maximum Quantity,
7. Complete the Effectivity section.
a. Select Active to make the promotion available for use.
b. Click in the Effective From field and select a date the promotion becomes effective.
8. Click Save.
The following tables explain the fields to complete for a price list entry.
• Add: Select this option to add the promotional changes to products in the cart. If the products are already in
the cart, this option adds the promotional changes to them.
• Update: Select this option to add the promotional changes to assets placed in the cart as a result of a change
order.
• Add/Update: Select this option to perform either the add or update option as previously explained.
Product Search for and find the product or product bundle to become part of the promotion.
Description Description
Is Undoable Do not select. For future use.
Undoable Do not select. For future use.
Message
Field Description
Cardinality Options are:
Check Scope
• Context Product Scope: Leads to the cardinality checks to be conducted within the scope of the context
product.
• Cart Scope: Leads the cardinality checks to be conducted within the full cart scope (default).
Update Scope Update Scope determines whether the top level item or the top level item and all of its child items are updated
with the promotional changes.
Options are:
• Update Item Only: Select this option to update only the top level item of a product bundle.
• Update Item and Child Items: Select this option to update the top level item of a product bundle and its child
products.
• Adjusting the price with an absolute price or a percentage. For more information, see Adjusting a
Product's Price in a Promotion.
• Overriding the price completely. For more information, see Overriding the Base Price for a Product in a
Bundle.
An adjustment to a product in a promotion can be an amount added or subtracted from the base price.
When you create product adjustments and overrides for products in promotions, you do so in the Product
Adjustments facet of the promotion.
1. Navigate to the Product Console. For more information, see Navigating to the Vlocity Product Console.
2. Search for and select the promotion.
3. Click Product Adjustments.
4. Click in the row of the product to show the configuration panel to configure the product.
5. In the Price List Entry window, complete the General Properties section.
a. In Price List, find and choose the price list where the adjustment should be stored.
b. In Display Text, enter an explanation for the adjustment, including any duration limits if applicable.
6. Click Product Structure.
7. In the configuration panel, click the Product Pricing tab, then click the Adjustments sub-tab.
8. Click New.
9. In the Price List Entry dialog box, complete the General Properties section:
a. Find and select the price list where this price list entry should be stored. Keep in mind the
adjustment must be stored in the same price list as the base price.
b. In Display Text, enter a description of the adjustment you are making, including any duration
limits. For example, 20% off monthly for six months.
10. In the Pricing Variable section, complete the search criteria and click Search. A results list of available
pricing variables appears.
11. In the pricing variable results list, click the appropriate pricing variable. A results list of available pricing
elements appears. You can choose to adjust the price by a percentage or an amount. If you do not see
the pricing element you need in the list, you must create it. For more information, see Creating a
Pricing Element Adjustment.
12. A results list in the Pricing Element section appears listing pricing elements that are associated with
the pricing variable you chose. Click the appropriate pricing element.
13. In the Time Plan/Policy section, choose the appropriate time plan and time policy if applicable.
14. Complete the Effectivity section.
a. Click in the Effective From field and select a date the adjustment becomes effective for use.
b. Click in the Effective From field and select a date the adjustment becomes effective for use.
15. Click Save.
The following tables explain the fields to complete for a price list entry.
Price List The price list where you want the adjustment stored. The adjustment must be stored in the same price list as the base
price you are adjusting. For more information on price lists, see Price Lists.
Display Text This text appears in the Details dialog box when you click on the price of a product in the cart, and then click on the
Price Details button (a lowercase i in a circle).
Base Price Do not select base price.
Virtual Price Do not select. For future use.
You can assign a time plan to limit the override duration and a time policy to determine when the override
begins and ends. A product must be contained in a product bundle before you can override its base price.
The following tables explain the fields to complete for an adjustment price list entry.
As a best practice, clearly describe the adjustment and any duration limit on it.
Base Price Do not select Base Price.
Virtual Price Do not select. Reserved for future use.
Or, if you want to use a specific date, use the following statement and substitute the example date
(2017/05/19) with another date.
promotion, when you add the promotion to the cart, its promotional pricing applies to the bundle or the
single product in the cart.
For example, you can create an iPhone X promotion that discounts the iPhone X by taking $200 off the
original price. If the iPhone X has been added to the cart, when you add the iPhone X promotion, Vlocity
CME applies the discount and the name of the promotion appears in the Promotions column next to the
product line item.
Or you can create a promotion by adding a product bundle to the promotion, and discounting the products
in the bundle. If the same product bundle you used for the promotion is in the cart, when you add the
promotion, it applies the promotional discounts to the product bundle. The name of the promotion appears
in the Promotions column next to the product line items.
Figure 91. iPhone X Intro Promo Discounts Two Products in iPhone X Intro Bundle
Figure 92. Unlimited Talk + Text Promotion Discounts One Product in iPhone X
Intro Bundle
• View a list of qualified and unqualified promotions. For more information, see Qualified and Disqualified
Promotions.
• Add a promotion to the cart. For more information, see Adding a Promotion to the Cart.
• Delete a promotion from the cart and the products it applies to, or delete a promotion from the cart
without removing the products it applies to. For more information, see Deleting a Promotion from the
Cart.
• Add a promotion to products already placed in the cart. For more information, see Creating a Promotion
That Applies to Products in the Cart.
• Add more than one promotion to a product. For more information, see Creating Multiple Promotions for a
Single Product Bundle.
• Create a change order, then add a promotion to the cart which applies to an asset in the cart.
• Create a change order and cancel a product in a promotion. For more information, see Canceling a
Promotion.
• Qualified
• Disqualified
Qualified promotions are promotions that are currently eligible for purchase. Disqualified promotions are
promotions that are not eligible for the customer to purchase. However, if a specific factor related to the
customer’s account changes, the promotion can become eligible for them to purchase.
For example, a promotion can have a context rule to limit promotional discounts to accounts with a status of
“student”. The agent can check the disqualified promotions list to determine whether the customer might be
eligible for a promotion if certain conditions for the account change. If the customer indicates to the agent
they are a student and the agent changes the account status, the previously disqualified promotion is now
eligible for purchase by the customer.
For any price changed due to the promotion, the cart displays the beginning price with a line through it and
the changed price appears in below it.
If the products contained in the promotion are not already in the cart, all the products in the promotion are
added to the cart.
If the products contained in the promotion are already in the cart, the prices of products in the cart are
updated with the promotional pricing. If the promotion contains a product bundle, the promotional changes
to products appear in either of the following ways:
• Only the price of the product bundle shows a promotional price. This occurs when the promotional setting
of Update Scope is Update Item Only.
• The price of the product bundle and its children show the promotional prices. This occurs when the
promotional setting of Update Scope is Update Item and Child Items.
For more information on the Update Scope field, see Completing Basic Promotion Settings.
A deep delete removes the promotion and its changes along with the products pertaining to the promotion.
This is the default setting for DeleteServices.
When you delete the promotion, it only deletes the promotion and its changes (discounts and cardinality).
The products that the promotion applies to remain in the cart. To change the delete to a shallow delete, edit
the DeleteServices setting.
When you have applied more than one promotion to a bundle in the cart, you must have shallow delete
enabled. Then you can delete each promotion individually. If deep delete is enabled, you cannot delete
multiple promotions applied to one bundle of products.
1. To see the promotions you have added to the cart, click the PROMOTIONS tab.
2. Click Delete next to the promotion that you want to delete.
3. When prompted, click Delete again.
Cancel a Promotion
You can cancel a promotion after you have applied the promotion to products that are now assets or after
you have applied a promotion to products that are assets.
To cancel a promotion:
You can assign a context rule to assign a penalty if a promotion is canceled. For more information, see
Penalty Rules for Promotions.
Discounts
A discount is defined as a reduction in price on a product, a catalog (collection of products), or the contents
of Vlocity Cart. The discount is negotiated, approved, activated, and applied towards the current or future
purchase of products or services. You can create and apply discounts to an account or define and apply
discounts as part of a contract. You can also apply discounts in Vlocity Cart.
1. Creation: Create a discount. There are two ways to create a discount. The product administrator
creates a pre-defined discount using the Vlocity Product Console. Alternatively, product executives can
create custom discounts from Vlocity Cart or CPQ. After you create discounts, they are independent of
the price list that the Vlocity Cart is associated with.
TIP
The pricing interface implementation should refer to the PricingPlanService (instead of
the DefaultPricingPlanImplemenatation) for discounts to be applied. By default, the
pricing step "Apply Context Discounts" is included in the pricing plan.
2. Negotiation: You can negotiate and agree on a discount. For example, an account executive is
responsible for negotiating the discount and ensuring that the appropriate agreement with discounts
are in place.
In the following example scenario, an account executive negotiates a 10% contract-based discount for
all employees of ABC when they purchase iPhone accessories.
3. Approvals: You can automate the approval of discounts or define custom logic using Vlocity's interface
implementations to determine, for example, whether the approval for a specific discount type is
required.
4. Activation: When you activate a discount, it goes into effect when the discount is submitted. The
discount is effective in the following cases:
a. No end date: If you do not specify an end date for a discount, the duration of the discount is
effective from the time the discount was activated.
b. Valid end date: If you specify an end date, the discount is active as long as the end date is valid.
The duration is ignored. In this case, the end date takes precedence over the duration.
c. No end date or duration: If you do not specify an end date or a duration, the discount never
expires.
Types of Discounts
Discounts can be applied to orders, accounts, or contracts. Each discount type can be associated with
products or specific categories or catalogs (a group of products). Discounts have a duration with an
effective end date and can be applied to future contracts or accounts. You can apply discounts to all items
in your cart or individual items in your cart. You can also adjust the discount manually.
NOTE
You can have zero or more products and zero or more categories.
• Order-Based Discounts: Most commonly used by Customer Service Representatives (CSRs) to apply as
a one-time courtesy towards an order to incentivize customers.
• Account-Based Discounts: Most commonly defined by Product Administrators and applied, for example,
towards a loyalty and retention program.
• Contract-Based Discounts: Most commonly defined by Product Administrators as part of a contract or
frame agreement.
Order-Based Discounts
An order-based discount is defined as a one-time discount that is applied at the time of the purchase. With
order-based discounts, you can identify, create, and apply a discount for that order against a specific
product or a collection of products (catalogs or categories). You can specify a reduction in price using a
percentage (for example 10% off on your phone plan) or an absolute value (for example $10 off all iPhone
accessories).
TIP
Order-based discounts are useful during a conversation between a sales representative
and a CSR during an active sales order to incentivize a behavior during the purchase
process. You can apply an order-based discount to a single item in the cart or all items in
the cart.
• Order-based discounts can only be applied once to the product or catalog for that instance of the order.
• Order-based discounts can be applied to opportunities and quotes.
Account-Based Discounts
An account-based discount allows you to apply a reduction in prices to products and services in the future.
This discount type applies to all orders or individual orders in your account. You can save account-based
discounts for future use. This means that the account-based discounts can be applied towards any future
purchases made as part of the account till the validity of the discount ends.
TIP
Account-based discounts are most relevant during a conversation between a CSR and a
customer, especially to retain the business of a loyal customer (part of the loyalty and
retention program).
For example, ABC Headquarters negotiates a 15% discount for all internet services. The negotiated
discount is stored in ABC's account. This means that any future orders for account ABC will receive a 15%
discount on internet services.
Contract-Based Discounts
A contract-based discount applies the negotiated discount specified in the contract to the product or catalog
being purchased. Contract-based discounts are tied to frame agreements. When a contract is created as a
frame agreement with applicable discounts, you can update the discounts based on the agreement in the
Vlocity Cart. The agreement is updated with a new version with the revised discounts applied to it.
TIP
Contract-based discounts are useful during the contract negotiation phase and may
become a part of a frame agreement.
For example, an account executive negotiates and establishes a 5% discount on all accessories for
employees of company ABC who have purchased iPhone products. The 5% discount is stored under
company ABC. When any new employee joins company ABC, the 5% discount is applied automatically
when they add any iPhone accessories to the cart.
The Create Default Time Policy job creates a default time policy, but you can clear the time policy. Time
Plan is not defaulted. If both Time Plan and Time Policy are undefined, then runtime time plan and policy
are ignored and start and end dates are not calculated.
See Create Default Time Policy job and Setting Up Attribute-Based Pricing with Time Plan and Time Policy.
4. Enter the following required information. All fields marked with an asterisk are required.
NOTE
Skip this step if you select the option "Applies to All Item in Cart" when you create a new
discount. The New Discount Item button located in the Discount Items facet is disabled if
you select the option "Applies to All Item in Cart" in the General Properties facet.
General Descriptions
Properties Fields
Product or Catalog/ Select the item to which you want to apply the discount. Options are product or catalog/category. Catalog/
Category Category is a grouping of products. You must configure a product in the Product Console and add it to the
price list before you can apply a discount.
Depending on the type you select, search for and select the Product or Catalog/Category to which this
discount applies.
Active Select Active.
Effective From Enter the start date for the discount item.
Effective Until Enter the end date for the discount item. The end date takes precedence over the duration. If you do not
specify an end date, the discount uses the time specified in duration. If you do not specify an end date or
duration, the discount never expires.
4. Click Save.
5. After you create the discount item, you can edit or delete it at any time.
3. In the Price List Entry form, enter the required information. All fields marked with a red asterisk are
required.
TIP
After you configure Discount Pricing, confirm that the Adjustment Value in the Pricing
Elements facet for the price list entry is not empty. If you do not specify an Adjustment
Value in the price list entry, the discount will not be applied to eligible products in
Vlocity Cart.
Example 17. Create a Discount for a Single Order or Multiple Order Items
As a product administrator, you determine the need to create a Holiday Season discount for all iPhone
accessories. You apply a 10% discount towards iPhone accessories for 3 months starting from November
through January. The Holiday Season discount is an order-based discount that applies to individual
products and catalogs that are added as part of the same Vlocity Cart.
3. Follow the steps listed in Defining a New Discount to create an order-based discount.
4. Select Order for Discount Type.
5. Select the option, Applies to All Items in Cart, for bulk purchases. When you select this option, the New
Discount Item button on the Discount Items facet is disabled.
6. Click Save.
7. Apply and view the order-based discount:
a. Log in to Salesforce and create a new order for your B2C price list.
b. In the order header, click CPQ to launch Vlocity Cart.
c. Select the B2C price list.
When you select the price list, the Products list will display all available, eligible, and qualified
products.
d. Select the product to which you want to apply the discount and click Add to Cart.
e. Click the Discounts tab.
The discount you created appears in the selectables list.
f. Select the discount you want to apply to the product and click Add to Cart.
g. Click Submit Order.
After you submit the order, you can view the discount for the order.
After you create the account-based discount and submit the order, the request is not approved
automatically. The new discount must be approved by your supervisor. See Approve Discounts.
A list of qualified discounts for that account is available in the Discounts tab.
d. Select the LNR discount you want to apply for your customer account.
e. Click Submit.
• If a contract-based discount has not been activated, you can edit it in the cart where you created or
edited the discount. When a contract-based discount is activated, it means that the contract has been
activated. If the contract has not been activated, you will see the following error message in Vlocity Cart.
• You can edit a contract-based discount that has been activated only through a Contract Amendment
process. See Amending a Discount in a Contract.
1. Log in to Salesforce.
2. Search for and open an existing contract that is activated to update the discount.
3. Click Amend Frame Agreement.
You will see version 1 of the contract agreement.
NOTE
Editing a discount is distinct from creating custom discounts. See Define Custom
Discounts in Vlocity Cart.
To edit a discount:
1. Go to Vlocity Cart by opening the order record detail page and clicking CPQ.
2. Select a price list.
3. Click the Discounts tab on the right pane in Vlocity Cart.
You will see a list of discounts.
4. Click the pencil icon to edit the discount.
5. Make your changes and click Save.
NOTE
You cannot edit a discount that has been activated in the same cart where you
created or modified it. See Activating and Deactivating Discounts.
1. Go to Vlocity Cart by opening the order record detail page and clicking CPQ.
2. Click the Discounts tab on the right pane of Vlocity Cart.
3. Click New Custom Discount.
The Create Custom Discount window is displayed.
4. Enter the required information. All fields marked with an asterisk are required.
Approve Discounts
If your business requires you to request an approval for a discount, you can do so by using the Discount
Approval button in Vlocity Cart. By default, discounts are set to be auto-approved.
TIP
The Discount Approval button invokes an OmniScript which calls the Vlocity Integration
Procedure (VIP), CPQ/Submit Discounts for Approval. The VIP invokes a remote action
which submits all discounts for approval that have a status of Not Submitted. You can
enable the discount status to require approvals or set it to be approved automatically using
the Vlocity CMT Administration Console.
TIP
If the setting does not exist, you can add it to the Custom Settings list. Click Add and
specify the Setup Value to be either True or False.
NOTE
This section applies only if the Custom Setting, Cart Level Discount Approval Required, is
set to True. The default value is set to False which means that all discounts are auto-
approved. You will not see the Discount Approval button in Vlocity Cart if the value for Cart
Level Discount Approval is set to False. To change the settings, see Enabling Discount
Approvals.
• Approved: When a discount is approved, the status changes to Approved and is Pending Activation as
indicated by the tool-tip on the yellow checkmark in Vlocity Cart. When you submit the order, the discount
status changes to Approved. In a different cart, the approved discount appears with a green checkmark.
• You cannot edit the discount in the same cart after it has been Activated. You can create a new cart
and edit the discount. See Edit Discounts in Vlocity Cart.
• You can edit contract-based discounts in the Amend Frame Agreement scenario only.
See Create a Contract-Based Discount.
• Rejected: When you reject a discount, the status changes to Rejected and the Discount Approval button
in Vlocity Cart is not activated. You can edit the discount and re-submit it for approval.
• Not Submitted: If the Cart Level Discount Approval Required value is set to True, the discount has a
status of Not Submitted in Vlocity Cart when you add the discount to cart. It is Pending Activation as
indicated by the tool-tip on the yellow checkmark. Click Discount Approval to submit the discount for
approval. After it has been approved, the status changes to Approved, Pending Activation. You cannot
submit your order, opportunity, or quote till the discounts in Vlocity Cart are approved.
• Pending: The discount is pending approval. It can be approved or rejected.
NOTE
In the Winter '19 release, the Discount Approval button does not appear in Vlocity Cart if
the discount is rejected. Proceed in one of two ways:
1. Go to Vlocity Cart by opening the order record detail page and clicking CPQ.
2. Click the Discounts tab on the right pane in Vlocity Cart.
TIP
The Discount Approval button only appears if the Cart Level Discount Approval
Required value is set to True. If the value is set to False, the Discount Approval button
will not appear.
The approval status changes. The approver receives a request to approve or reject the discount if the
Cart Level Discount Approval Required setting is set to True. If the setting is False, the discount is
automatically approved and you can submit the order.
See Also
• ApprovalStatusInterface
• DefaultApprovalStatusImplementation
Activating a Discount
After you activate a discount and go back to Vlocity cart, the original discount appears with a yellow
checkmark and a tooltip that says Activated. You cannot edit the discount after you activate it.
To activate a discount:
• For order and account-based discounts, go to Vlocity Cart and do a checkout by clicking Submit.
• For contract-based discounts, click Create Frame Agreement. This creates a new frame contract. See
Create a Contract-Based Discount.
1. Go to Vlocity Cart by clicking on any order record detail page and clicking CPQ.
2. Go to the Discounts tab and select the account-based discount you want to deactivate.
3. Click the x button to deactivate the account-based discount and click Submit.
The status changes to Pending Deactivation. The discounted price is no longer available for that
product.
1. Log in to Salesforce.
2. Go to the Contract Details page.
3. Click Amend Frame Agreement. This launches Vlocity Cart.
4. Go to the Discounts tab and select the contract-based discount you want to deactivate.
5. Click X to deactivate the contract-based discount.
6. Click Update Frame Agreement.
7. Click Activate Contract.
WARNING
You must perform this step to deactivate the contract-based discount. If you skip this
step, the previous discount is still valid for the contract.
Table 87. Matrix of Vlocity Cart State with Products and Discounts
Scenario in Vlocity Cart Resulting Action Frame Agreement
Buttons Available
No Products or Discounts in • The checkout button is disabled because there is no product or No
Cart discount.
No products with multiple • You may have an account-based discount or a contract-based discount. Yes
discounts. No products are required in this case.
• Order-based discounts cannot be applied when you do not have any
products in the cart.
Multiple products with multiple • You can apply multiple types of discounts to multiple products. Yes
discounts.
Flow Management
Flows define sequential processing of rules, logic, and custom processing that can be initiated by an
interface implementation, specify calls to Apex, and can access any service.
Vlocity extends Salesforce Flow tools with sequencing logic to support the flow of objects, such as orders,
quotes, and price books. Flows support branching, synching, conditional execution, embedded flows, flow
actions, and entry and exit criteria.
Flows drive pricing steps. Vlocity Communications, Media, and Energy can then compute pricing for an
entire order.
You can create and manage flows and associate them with business processes to provide eligibility,
compatibility, and pricing. You can change the processing order, add new steps, and include branching
logic. Each rule action in a flow can invoke one rule by specifying the rule name and rule type. The
doCommit option specifies the last rule action, which is required.
Sample flow:
Enabling a Flow
You can have several different versions of any flow in your org, but only one version can be active at a time.
To enable a flow:
Deactivating a Flow
You can have several different versions of any flow in your org, but only one version can be active at a time.
To deactivate a flow:
4. On the Flow detail record page, in the Flow Versions related list, next to the flow to deactivate, click
Deactivate.
If… Then…
An active flow is not present Next to the latest inactive flow, click Open.
An active flow is present Deactivate the latest flow, and then click Open. Save the flow as a new version.
5. In the palette, scroll to the Apex section.
Change of Plans
Customers of service providers can be enabled to change or migrate their services and plans after the
initial purchase.
To ensure that the existing service is not disrupted or discontinued, the Change of Plans feature (also
known as Replace Offers) allows service providers to upgrade or downgrade customer plans during the
lifecycle of the subscription.
NOTE
This feature is supported in Enterprise Product Catalog (EPC) and Configure Price Quote
(CPQ) for the Winter ‘19 release and later.
• Service Continuity
Your customers can migrate from the original plan to the new plan without any disruptions to their existing
services.
• Unchanged Service Identifiers
Service identifiers such as your customer's email address and mobile phone number remain the same
while migrating from one offer to another offer.
• A View into the History of Subscription Updates and Traceability
You can view the history of the asset details for your customers.
Usage Scenarios
Customers can move to new plans from old plans without any interruptions in service. In all cases, you can
move the customer from the source (original plan) to the target (new plan).
Customers can change plans that result in moving from one bundled offer to another bundled offer. A
bundled offer contains plans, devices, and services that are packaged together. Both bundled offers may
have common products that are retained in the process. Some of the existing assets that are not available
in the new bundled offer will be disconnected.
Here are some common use case scenarios that apply to the Change of Plans feature.
unlimited plan, guaranteeing continuity of service and retaining the same mobile number and email address
(service identifiers).
NOTE
Before you make the switch, make sure to inform her of any available change fees that
may apply.
4. Enter the following required information. All fields marked with an asterisk are required.
In telecommunications, a product family can represent the following products and services:
• Internet
• TV
• Wireless Mobile
• Broadband
• Support
• Fixed Line
As a service provider, you can use product families to categorize products one way for internal operations, and
another way for external presentation. It's up to you to determine how to categorize or classify the products.
The root catalog may have several categorizations for presenting products to customers on an eCommerce
website.
The Offer Migration Plan's Product Family field can be a subset or a complete set of the Product2 object's
Product Family field.
Migration Select the migration method. The offer migration plan applies to either Any-to-Any offers or Specific offers.
Method
• For Any-to-Any offers, users can upgrade or downgrade plans without any restrictions. The product
administrator can allow upgrades or downgrades from any-to-any offers, with or without exceptions.
• For Specific offers, users can only migrate to plans that meet the criteria defined in the Offer Migration
Component Mappings section. The product administrator can allow upgrades or downgrades between named
offers.
5. Enter the following optional information:
Defining Mappings
You can define exceptions to the any-to-any offer plan. This means that the customer can only migrate to
the new plan if the source and target defined in the exceptions list match the criteria.
NOTE
When you select the 'Specific Offers' migration path option, the mappings are used to
define the allowed migration paths for the offers.
To define mappings:
Interface Action
Vlocity Product Designer 1. Click the button, and select Offer Migration Plans.
2. Click in the Search this list field.
Vlocity Product Console In the Product Management table, click the search icon next to Offer Migration Plan.
4. Click the migration plan name to view or edit it.
You can view or edit the General Properties and the Offer Migration Component Mappings.
For more information about editing and deleting offer migration plans and exceptions, see:
Interface Action
Vlocity Product Designer 1. Click the button, and select Offer Migration Plans.
2. Click in the Search this list field.
Vlocity Product Console In the Product Management table, click the search icon next to Offer Migration Plan.
4. Click the migration plan name to edit it.
5. Make changes and click Save.
Interface Action
Vlocity Product Designer 1. Click the button, and select Offer Migration Plans.
2. Click in the Search this list field.
Vlocity Product Console In the Product Management table, click the search icon next to Offer Migration Plan.
4. Delete the plan.
Interface Action
Vlocity Product Designer Click the action list for the plan and select Delete.
Interface Action
Vlocity Product Console Click the trash icon.
5. Click Delete to confirm.
Interface Action
Vlocity Product Designer 1. Click the button, and select Offer Migration Plans.
2. Click in the Search this list field.
Vlocity Product Console In the Product Management table, click the search icon next to Offer Migration Plan.
4. Click the migration plan name to edit it.
5. Click the Offer Migration Component Mappings facet.
6. Click the pencil icon for the mapping to change.
7. Make any changes to the Source Product and Target Product properties.
8. Click Save.
Interface Action
Vlocity Product Designer 1. Click the button, and select Offer Migration Plans.
2. Click in the Search this list field.
Vlocity Product Console In the Product Management table, click the search icon next to Offer Migration Plan.
3. Search for the Offer Migration Plan.
4. Click the migration plan name to edit it.
For example, let's say you have a TV Elite product plan that you do not want to offer to east coast
customers. You can define an eligibility rule that prevents all east coast customers from upgrading to the TV
Elite product plan.
The rules API evaluates all the offer migration plans that have been defined for a product within Vlocity
Cart. Next, it checks the valid product families and finds the matching offer migration plans to determine
which products should be displayed. The eligibility rules determine if the plan is eligible or not. If the plan is
not eligible, it is removed.
You can also set up rules to apply change fees during the replacement process. For more information about
change fees, see Applying Change Fees.
Replacing Plans
You can replace an old plan with a new plan.
To replace plans:
1. Go to the Accounts page in Salesforce and select the product to which you want to apply the new plan.
2. Locate the root level asset that contains the plan you want to replace.
3. Click Change to Order or Change to Quote to launch the MACD order process.
4. In the Future Dated Orders window, specify the date and time and click Next.
You will see the line item with an Action type of Existing.
5. In Vlocity Cart, view the plans you want to replace.
6. From the list of qualified products in the selectables list, click Replace.
7. Select the plan you want to replace with the new one and click Apply.
The existing asset status changes to "Disconnect" and the new product plan is added to the cart with a
status of "Add".
8. Click Create Order.
Comparing Plans
To compare plans:
You can compare the Recurring Total of the old asset with the Recurring Total and One Time Total of the
new asset. You can also compare the action and sub-actions of the old and new assets. You cannot view
the attributes for each asset from this view.
The following table provides a summary of the fields that are impacted in the old and new records.
downgrade, you charge her a one-time change fee of $20 because she's making this change within a
month of upgrading.
• First, determine the change fee amount you want to apply when your user decides to change plans.
Determine if this is a one-time fee.
• Next, decide the specific situation to which you will apply the change fee. For example, you may decide
to apply change fees only when users downgrade their plans.
• Then, configure and build rules to trigger the change fees.
• Finally, create the offer migration plan that will apply the change fee based on the configuration rules you
have built.
1. Set up a product with a relationship type and the related product. The change fee product can be
modeled as part of the bundled offering or a stand-alone fee product. For example, you can set the
relationship type to be auto-add whenever a customer wants to downgrade their plan from unlimited
data to limited data. See Create Products in Vlocity Product Console.
2. Define two filters to be triggered when the condition is true for the quote or order:
• Qualification filters.
• Evaluation filters.
See Entity Filter Types.
3. Define rules to be triggered when the condition is true for the quote or order.
• Configuration rules: make sure to link the product relationship and qualification filters to the rule. See
Context Rules and Advanced Rules Frameworks.
Transforming a multiplay offer usually involves reducing the price or improving the service.
A common scenario is upgrading a mobile offer with a better data plan. Initially, the plan may not be
shareable, but you want to change to a family plan with unlimited talk and text, and data plan options, such
as 3 GB, but shared among the members of the plan. The SIM may be shared with up to 10 mobile
numbers, plus roaming and HD streaming. A constraint with a limited plan may be that you need to pay a
higher price when upgrading to 5 GB or 10 GB. With Change of Plan, you can transform the old mobile plan
to the new family plan, with the same or better services and more data.
For example, a customer already subscribes to individual plans for Internet, VoIP, and TV service. You can
merge individual internet and VoIP plans into a Triple Play Bundle that includes Internet, VoIP, and TV by
adding a TV plan, and you can also upgrade the plan to include more data.
At this point, the customer is eligible to migrate the existing top-level Internet Bundle to the Internet Bundle
in a MultiPlay Offers, such as such as Triple Play. The triple play root-level offer contains Internet, VoIP, and
TV bundled as immediate children.
When migrating plans from a source to target, the transform function compares the two product/service
structures to find a match. When a match is found, the transform function uses an action/sub action
combination. The action may be set as Disconnect for the old product, and the sub action is Replace with
the new product or service. For example, the 2 GB service may be a permanent disconnect, and the 3 GB
service may be a permanent Add. This represents a soft disconnect to Order Management so you do not
actually lose your associated device. So, Change of Plan allows you to move from one product bundle to
another, which gives you more flexibility in terms of features, as opposed to one feature, such as a Internet
service, that would only require a MACD order.
As another example, a customer already has two individual mobile plans that are not sharable. The
customer is eligible to migrate an existing individual mobile bundle to a top-level mobile family bundle.
As a service provider, you can merge individual offers that belong to the same family into a new single
sharable service bundle, for example, you can merge individual mobile plans into new sharable mobile
plan. This could also involve merging several disjointed services, such as Internet, TV, mobile, that may
have been purchased at different times, into one service bundle, such as Triple Play. The old customer
assets are marked as inactive and disconnected, and the new assets become active.
Another example of merging disjointed offers may be that you want to disconnect your TV, but the service
provider offers you triple play or a promotion and add VoIP, faster internet, but for $100/mo. The old, lower-
performing package was $60/month.
The old internet gets disconnected and mapped to the new internet. Triple Play, Internet 100MB now
becomes an active asset and increases from $180 per month to $250 per month. New channels are added
for TV. VoIP can be added, but may not be needed.
You can also go back and split the Triple Play into only what you need: Internet and TV (based on price),
but not VoIP, which gets disconnected. There could be a Double-Play offer with TV Plus, for an additional
$5 per month, and Internet for $100 per month.
For example, a customer has already subscribed to a Triple Play Bundle with Internet, VoIP and TV service.
The customer is eligible to migrate the existing top-level Triple Play Bundle to a standalone Internet Bundle,
VoIP and TV Bundle. The triple play root-level offer contains Internet, VoIP and TV bundled as immediate
children. The customer wants to split the single multi-play bundle into Individual Offers that belong to
different product families. To accomplish this, you can split the Triple Play Bundle (Internet, VoIP, TV) into
new Individual Internet, VoIP and TV plans, or you can split the bundle into new Individual Internet and VoIP
plans, and disconnect the existing VoIP plan.
After splitting the bundle, the subscriber may want to merge and upgrade the two remaining services into a
double-play offer that has higher internet speeds or more channels, but at the same price or a slightly
higher price.
You can also split a single, sharable service bundle into Individual Offers that belong to the same family, for
example, you can split an individual Mobile line from a shared service into separate new individual Mobile
plan.
If you want to disconnect all the components of an offer, go to Vlocity Cart and use the 'Delete' Option
against that line item.
1. From the Accounts page, select a customer account. The account page for that customer appears.
2. In the Asset Management section, select the assets you want to migrate.
3. Click Change To Order to initiate the change-order. The Request Datetime dialog appears. Make any
changes, then click Next. The Vlocity Cart appears. You can add new products to the cart at this point.
4. From the Vlocity Cart, click Transform Multiplay Offers.
The Transform Multiplay Offers dialog appears, showing the top-level assets you selected from the
Account page.
If you selected Disconnect to disconnect the Internet offer, for example, then the next page shows
only the TV offer without the Internet offer.
The group number specifies how you want to group the items in the resulting sets that appear on the
next page after you click Next.
For example, if you have two demo TVs and two demo Internets such that there is one TV and one
Internet in each group, the next screen shows you possible combinations of those two items within that
group. You can take those two items and put them together under one group, and two items under
another group.
8. Click Next.
CPQ performs the following actions.
• Runs eligibility and context rules.
• Filters the Price List.
• Finds all possible MultiPlay Bundles having given components as its children.
The transformation process breaks up the existing bundle/structure. Everything in the source bundle
becomes disconnected, creating a new set of items. The grouping actions determine if the bundle and
its items are split, merged, or re-parented. What happens in the target is based on the grouping. For
each group you break up, items will initially be by themselves (unbundled) and the group determines
what gets added. If a child product is pulled out of a bundle, it can be re-parented to a new bundle,
split/made into a top-level item or separate line item, or merged with a new bundle.
For example, you could pull Internet Offer out of a Triple Play bundle. That whole offer becomes
disconnected and the individual offers, such as Internet Offer, become their own line items.
The individual items represent what you have. The group number helps determine what you would like
to upgrade to.
For example, if you put three items into the same group, then the transform function looks for a
multiplay bundle that contains at least all three of the items you have chosen. The resulting page
shows you options of triple play or quad play that contains your three chosen items.
If you have four different groups, then you would have four different options from which to choose.
9. Under the Available Multiplay Bundle Choices, select your desired options.
10. Click Done. The Cart appears with your new products and services, which you can expand to see the
child/related components/items displayed as line items. The Action column shows which items have
been added or disconnected.
Comparing Offers
While replacing an existing bundled offer (Asset) with a new bundled offer, some of the existing products
may be available in the new bundled offer. In such an event, an API returns line item attributes and values
to display on the Comparison UI the attribute and its value from the existing asset are copied onto the
matching target product. In addition, the action, sub action, and asset relationships between the matching
products are set or created to indicate that the existing assets are retained in context of the target offer.
The comparison feature recursively finds all the related items and dependencies so you are not missing
anything in your comparison and so you get an accurate price. For example, you may have had three
double-plays which were transformed to three triple-plays. There may have been items that came from a
separate bundle on the left side that were not intentionally selected for the comparison, but were included in
the target anyways because, for example, an item may relate to another double-play.
A scenario may be that a customer purchases equipment, such as a STB, in 12 installments as part of a TV
Offer for a fixed monthly price. While upgrading the TV offer, the STB continues to stay in the context of the
new TV Offer along with the agreed monthly price and installments. The installment start date and final end
date in the Account Pricing remain the same.
1. On the disconnect action for a line item, click the associated action button and select Compare.
The Compare Changes screen appears and shows the comparison between the current product and
the replacement quote.
2. Select a product in the current bundled Offer. The matching or mapped product in the Replacement
Quote section is highlighted.
Attributes and their values are displayed as read-only for current products and replacement quotes.
You can collapse or expand the attribute section. By default, the section is collapsed. The Asset
Reference identifier appears on the replacement quote that matches the current product.
Compare Changes screen also displays onetime charge and one time total for replacement quotes that
are net new, for example, Action=Add, Subaction != (Reassign, Replace).
If sourceItem has Purchase Date, Start Date, and End Date populated, those would be copied to
targetItem once Order is submitted. Compare view will show these dates if available.
The following is the list of fields to copy from source line item to target line item in an order context and a
quote context:
• ServiceDate, if it is a Reassign. ServiceDate is the standard salesforce date that has a Date label in
daily_jsonv2@vlocity.com.
• vlocity_cmt_BillingAccountId_c, if it is a Reassign or Replace.
• vlocity_cmt_ItemName_c, if it is a Reassign.
• vlocity_cmt_SerialNumber_c, if it is a Reassign.
• vlocity_cmt_ServiceAccountId_c, if it is a Reassign or Replace.
• EndDate (order context only), if it is a Reassign.
1. Click Setup.
2. In the Quick Find / Search field, type Custom Settings.
3. In the search results, under Develop, click Custom Settings.
4. Search for Field Settings. The Field Settings page appears.
5. Beside Field Settings, click Manage. The Field Settings page appears.
6. Click New.
7. Fill the required fields.
The feature name field should match with COPFieldsToCopyDuringCreatingAsset. FieldName is the
custom Field Name of the asset to copy during replacement. In the above figure, CustomField__c of
the Asset object is being copied from the old asset to the new asset.
8. Click Save.
To copy additional fields for Asset, create a new Field Setting for each additional field, where the feature
and the object name remain same.
When submitting an order, if you need additional fields to copy from the old asset to the new asset, use the
COPFieldsToCopyDuringCreatingAsset feature.
When replacing an offer in CPQ, if you need additional fields to copy from source LineItem to target
LineItem, use the COPFieldsToCopyDuringReplace feature.
Communications & Media businesses can have thousands of locations, service accounts, or subscribers for
which you need to generate Quotes or Orders. Vlocity provides a solution to group individual locations,
service accounts, or subscribers and to apply the same product configuration to each group member.
NOTE
The Fall '19 and Winter '20 releases have the following limitations:
The ABC Hotels network contains a range of service locations that require internet services for their
commercial operations in multiple cities in the Netherlands. SitePoint must organize the ABC Hotels
service locations into groups so that the appropriate product can be selected for each group. This allows
SitePoint to quote the best overall price to ABC Hotels.
After they receive a list of all the service locations from ABC Hotels, SitePoint can group the service
locations, add the products to the service location groups, add groups to the Vlocity Cart, price and validate
the quote for multiple service locations, convert the quote to an order, and submit the final order.
Multi-Site Workflow
The following steps provide an overview of the Multi-Site workflow. Go to the relevant section to view details
for each task in the process.
1. Define your location objects, such as Service Points, Premises, and Accounts. See Define Multi-Site
Objects.
2. Configure any customizations you need, such as whether users can choose the single or multiple
structure, which objects can be grouped, and which object fields are displayed. See Configure Multi-
Site Customizations.
3. Create an Opportunity, a master Quote or Order with a single or multiple structure, and groups. See
Create the Opportunity, Quote or Order Structure, and Groups.
4. Apply product configurations to groups, validate and price, and submit.
• For a single master Quote or Order, assign groups to line items, validate, price, and submit in the
Cart. See Validate and Price a Single Quote or Order.
• For multiple child Quotes or Orders, you can assign products, validate, price, and submit in the Cart.
See Validate and Price Multiple Quotes or Orders.
• For multiple child Quotes or Orders, you can assign products in the Cart, then validate, price, and
submit on the groups page. See Validate and Price on the Groups Page.
5. View the resulting Orders and related Assets. See View Multi-Site Orders on the Account Record
Page.
6. Optionally view the total quantity and price for each product. See Configure Quantity Rollup Lists.
See Also
• Large Quotes to Contracts Overview
A Service Point is defined as an entry point for services to a Premises. The service provided to each
Service Point is separately measured. This is useful for services such as phone, internet, or TV.
Complete the following tasks in the order shown. You must create an Account and a Premises before you
create a Service Point. After you create a Service Point, you can associate an Asset with an Account or a
Premises and associate a parent Premises to an existing Premises.
Create a Premises
A Premises represents a complex, building, or house together with its land and outbuildings, occupied by
businesses or tenants. A Premises record can optionally represent a location within a Premises, such as a
particular building on a property, a floor of a building, or some other subset of the larger Premises where
equipment might be deployed.
1. Log in to Salesforce.
Create an Account
1. Log in to Salesforce.
2. Click the + tab to see All Tabs.
3. Click Accounts.
4. Click New.
5. Enter the Account Name.
6. Search for and associate the Premises you created to this Account.
7. Click Save.
NOTE
If the Account has a parent Account, all the service points linked to the parent Account are
retrieved.
• Connected
• Vacant
• Install in Progress
• Inactive
Activation Date Specify the date by which you want the Service Point to be activated.
6. Click Save.
1. Log in to Salesforce.
2. Search for and open the Service Point record you created.
3. Click New Asset.
4. Enter the Asset Name.
5. Search for the Account you created and associate it with the Service Point.
6. Search for the Premises you created and associate it with this Service Point.
7. Click Save.
1. Log in to Salesforce.
2. Search for and open the Premises record to which you want to associate a parent Premises.
3. Click Edit in the Parent Premises field.
What's Next
After you define your location objects, the next step is to Create the Opportunity, Quote or Order Structure,
and Groups.
You don't need to customize the Multi-Site feature if all of the following are true. For the Fall '19 and Winter
'20 releases, only the last two items apply.
• You want to limit users to one structure: a master Quote or Order with child Quotes or Orders.
• You don't need to enable the option of invoking Apply to Group, Validate and Price, and Submit on the
group page.
• You plan to use only Service Point objects for grouping.
• You don't need additional display fields or filters on the group page.
• You don't need to change the group pane, page size, or batch size in Vlocity Cart.
• multiple — Users can only create a master Quote or Order with multiple child Quotes or Orders. This is
the default.
• single — Users can only create a single Quote or Order with line items.
• select — Users can choose which structure to create.
This task does not apply to the Fall '19 and Winter '20 releases.
Enable Apply to Group, Validate and Price, and Submit on the Group Page
You can enable the Apply to Group, Validate and Price, and Submit buttons on the group page. This
saves time and steps by eliminating the need to click these buttons separately for each group in the cart.
This task does not apply to the Winter '20 and Fall '19 releases.
To enable the Apply to Group, Validate and Price, and Submit buttons on the group page:
1. Go to Setup.
• In Lightning Experience, click the gear icon and select Setup from the menu.
• In Salesforce Classic, click the user menu and select Setup from the menu.
2. In the Quick Find field, enter Custom Settings.
3. Click Custom Settings.
4. Click the letter C in the index across the top.
5. To the left of CPQ Configuration Settings, click Manage.
6. Click the letter E in the index across the top.
7. If you don't see EnableMultiSiteBulkAction in the list:
a. Click New.
b. In the Name field, type EnableMultiSiteBulkAction.
c. In the Setup Value field, type true.
8. If you do see EnableMultiSiteBulkAction in the list:
a. To the left of EnableMultiSiteBulkAction, click Edit.
b. Make sure the Setup Value field is set to true.
9. Click Save.
This task does not apply to the Fall '19 and Winter '20 releases.
1. Go to Setup.
2. In the Quick Find box, type meta, and click Custom Metadata Types.
3. Next to CPQ Group Member Type, click Manage Records.
4. Next to the object type you want to activate, click Edit.
5. Click the Active check box.
6. To determine the position of the object's tab on the group page, change the Display Sequence value.
By default, Service Point has a Display Sequence value of 1.
7. Click Save.
1. Go to Setup.
2. In the Quick Find box, type meta, and click Custom Metadata Types.
3. Next to CPQ Group Member Type, click Manage Records.
4. Click New.
5. Fill in the following required fields. Using merge fields for the Vlocity namespace is recommended.
Examples are for the Service Account object type.
IMPORTANT
When you create a custom field setting, only fields you have defined in the field setting are
displayed. Other fields are not displayed in the column headers.
For example, the default set of fields that appear in the display columns for the Service Points table include:
• ServicePoint.MarketIdentifier
• Premises.StreetAddress
• Premises.PostalCode
• Premises.City
• Service Point.UtilityProvider
• Service Point.LoadProfile
• Service Point.AverageMonthlyUsage
• Service Point.VoltageLevel
Other grouping objects, such as Premises or Service Account, have different default fields.
1. Log in to Salesforce.
2. Go to Setup.
3. Search for Custom Settings In the Quick Find box and launch it.
The Custom Settings page is displayed.
4. Go to Field Settings and click Manage to view the field settings.
The Field Settings page is displayed.
5. Click New to add a new field or Edit to modify a field that is displayed by default.
The Field Settings Edit page is displayed.
6. Enter the following information.
You can reference fields of related objects using relationship notation. For example, to reference the City__c
field from the Premises object on the Service Point tab, specify
vlocity_cmt__PremisesId__r.vlocity_cmt__City__c. For details about relationship notation, see
Relationship Notation versus Multiple Extract Steps.
Inclusion When you check this option, the field is included as a column in the table. When you don't check this option, this
field does not appear in the table.
Is Editable This field is not used.
Field Description
Object Name Enter the object API name. For example, the name of the Service Point object is
vlocity_cmt__ServicePoint__c.
Sequence Enter the sequence in which you would like the field value to display.
7. Click Save.
The new field is added to the Field Settings list.
Configure Filters
For any grouping object, you can customize filters.
For example, the default set of fields used to filter Service Points include:
• Service Point.LoadProfile
• Service Point.MeterType
• Service Point.UtilityProvider
• Service Point.ServiceType
• Service Point.VoltageLevel
To configure filters:
3. Click Save.
The new filter is added to the Field Settings list.
1. Log in to Salesforce.
2. Go to the App Launcher.
NOTE
The groupedItem JSON field contains all the default columns that appear in the
service points results list.
6. Click Save.
7. Slide the Activate button to deactivate the multiservice-cpq-group-list card.
8. Add your custom fields in the Input Map section to view the field details from the API.
This is a comma-separated list.
9. Click Activate.
• groupPageSize: Page size for groups returns the number of groups you can view. The default is set to
20 for optimum performance. If you create more than 20 groups, you can click the Load More Groups
button to view the longer list.
• groupedServicePageSize: Page size for groups returns the number of items that are grouped together.
The default is set to 20 for optimum performance. If you add more than 20 within a group, the Load More
button is available. Click it to view the longer list within that group.
• ungroupedServicePageSize: Page size returns the number of individual items that are not grouped.
The default is set to 30 for optimum performance. If you have more than 30 items that are not grouped,
the Next and Previous buttons are available so you can view the longer list of ungrouped items.
When you configure the page size for groups, group members, or ungrouped items, it impacts the number
of results for each item that will appear on the managed group page and the Vlocity Group Cart page.
NOTE
If your org has more than 2,000 records for any grouping object, Vlocity recommends that
you apply filters to retrieve your search results because the maximum query result is set to
2,000 on the Salesforce platform. Using OFFSET is an efficient way to handle large result
sets.
1. Log in to Salesforce.
2. Go to the App Launcher.
3. Search for and open the Vlocity OmniScript Designer.
4. Search for and open the MultiServiceCPQConfiguration script.
5. Click Deactivate Version.
TIP
Vlocity recommends that you keep the batch size low to avoid the max SOQL Salesforce
and heap size limit.
Multi-Service/ApplytoGroup
NOTE
For ApplytoGroup, set the Batch Size to 1. This allows you to copy and update one Quote
or Order at a time.
MultiService/PriceAndValidate
NOTE
For PriceAndValidate, set the Batch Size to 1. This allows you to process one Quote or
Order at a time and price and validate it using Vlocity CPQ.
MultiService/Checkout
NOTE
For Checkout, set the Batch Size to 1. This allows you to process one Quote at a time,
convert it into an Order, and then create assets using Vlocity CPQ.
1. Log in to Salesforce.
2. From the App Launcher, search for Vlocity OmniScript Designer and launch it.
3. Search for ApplytoGroup. The MultiService/ApplytoGroup card is displayed.
4. Create a copy and click the card to open it.
5. Click SetApplytoGroupIPName.
6. Set the BatchSize, for example, Batch Size = 1.
7. Follow steps 4 through 6 to set the batch size for Price and Validate and the Checkout cards.
8. Click Save.
NOTE
In the Fall '19 and Winter '20 releases, you can only create master Quotes with multiple
child Quotes that have Service Points as group members.
The number of contracted months and the price lists configured at the Opportunity level are
propagated to the master Quote or Order. The pricing totals are stored in the Quote or Order group
object.
In the Fall '19 and Winter '20 releases, the command to create a master Quote is Multi-Service Point.
You cannot create a master Order directly.
3. For a Quote, click Single Quote or Multiple Quotes. For an Order, click Single Order or Multiple
Orders. Then click Next.
In the Fall '19 and Winter '20 releases, you don't see this choice, and the Quote is multiple.
IMPORTANT
If you don't see this choice in Fall '20 or a later release, it means that the choice isn't
configured. See Configure Multi-Site Customizations.
4. To create a new Quote or Order, click New. The master Quote or Order is created without any group
members.
To edit an existing Quote or Order, skip to step 6.
5. Enter a Name for the master Quote or Order. For an Order, enter the Order Start Date in the format
mm/dd/yyyy. Click Save.
NOTE
Master Quote or Order names must be unique.
6. Select the master Quote or Order to which you want to add group members and click Next.
1. Select the master Quote or Order you want to clone and click Clone.
2. Enter a new name for the clone.
3. Click Clone.
The cloned master Quote or Order is displayed.
NOTE
A master Quote or Order that you clone must have a unique name.
4. To create or edit groups for the clone, select it and click Next.
Create Groups
1. Select the tab for the objects to group, for example, Service Points.
Depending on how the Account for the Opportunity is configured, you might see tabs for Service
Accounts, Premises, Subscribers, or other objects.
In the Fall '19 and Winter '20 releases, you only see Service Points.
2. Select the objects to add to a group and click Add to Group.
3. Select an existing group or click Add New Group to create a new group.
a. Enter a Group Name.
b. (Optional) Enter a Group Description.
c. Click Save.
The objects are added to the master Quote or Order within the group you created.
For more ways to manage groups and short videos of the steps, see Manage Multi-Site Groups.
What's Next
The next task depends on your single or multiple choice:
• If you chose Single Quote or Single Order, see Validate and Price a Single Quote or Order.
• If you chose Multiple Quote or Multiple Order, see Validate and Price Multiple Quotes or Orders.
In the Fall '19 and Winter '20 releases, this is the only option.
To perform any of the following tasks, you must be on the group page of a master Quote or Order. See
Create the Opportunity, Quote or Order Structure, and Groups.
Depending on how the Account for the Opportunity is configured, you might see tabs for Accounts,
Premises, Subscribers, or other objects.
In the Fall '19 and Winter '20 releases, you only see Service Points.
2. Select the objects to add to a group and click Add to Group.
3. Click Add New Group.
a. Enter a Group Name.
b. (Optional) Enter a Group Description.
c. Click Save.
The objects are added to the master Quote or Order within the group you created.
TIP
If the new group doesn't appear in the list, click Refresh on your browser window or
click Load More Groups.
4. Next, add members to the group. See Adding Service Points to a Group.
NOTE
You can organize objects into one or more groups. You can't add the same object to
multiple groups in the context of the same Opportunity record.
Delete a Group
1. Select one or more groups.
2. Click Delete Group.
3. Click Delete Group in the confirmation window.
NOTE
You can configure the items available in the filters list. The current set of filters is
provided by default.
3. Apply the filters using the available criteria and click Apply Filter.
A list of objects that match your search criteria is displayed.
NOTE
You can also apply filters to grouped objects.
4. (Optional) Slide the Apply Filters on Grouped Items to search for objects that are grouped. A list of
objects that match your search criteria is displayed.
5. Click Clear Filters to start the search again.
• Click the Show filter to view objects that are grouped or assigned to a group. Expand each group to view
the members of that group.
• Click the Hide filter to view objects that are ungrouped or not assigned to a group.
• To configure the default number of groups, members within groups, or ungrouped objects that display in
Vlocity Cart, see Configure Multi-Site Customizations.
The tasks described here apply if both of the following are true:
• You configured the Apply to Group OmniScript as described in Configure Multi-Site Customizations.
• In the Create the Opportunity, Quote or Order Structure, and Groups task, you chose Single Quote or
Single Order.
These tasks do not apply to the Winter '20 and Fall '19 releases.
1. From the group page of the master Quote or Order, click Next.
This takes you to Vlocity Cart.
2. Select the Price List for the products.
3. For each product, click Add to Cart next to the product name.
NOTE
You can add more than one product to the cart and configure each product in the cart.
4. Click Previous if you want to go back and reconfigure the groups, then click Next to return to the cart.
5. On each product line item menu, click Attach Group.
NOTE
If you have a large number of group members, processing may take a while to
complete.
For example, if the maximum quantity for a line item is 10 and the group has 12 members, validation and
group attachment fail.
1. For a master Quote, click Create Order. For a master Order, you don't see this step.
2. Click Submit Order.
IMPORTANT
The Create Order and Submit Order buttons are disabled until every line item has an
attached group.
3. On the Order Submission Results page, click Next. You are redirected to the Account record page.
What's Next
See View Multi-Site Orders on the Account Record Page for details about viewing the Orders and related
Assets on the Account record page.
Optionally, you can customize the submission process to initiate additional workflows such as, for example,
creating an approval process.
The tasks described here apply if you chose Multiple Quote or Multiple Order in the Create the
Opportunity, Quote or Order Structure, and Groups task.
In the Fall '19 and Winter '20 releases, performing these tasks in the cart is your only option for validation,
pricing, and submission.
1. From the group page of the master Quote or Order, click Next.
This takes you to the Vlocity Group Cart. The groups you defined are listed in the left pane.
2. Select the group to which to add products.
3. Select the Price List for the products.
4. For each product, click Add to Cart next to the product name.
NOTE
You can add more than one product to the cart and configure each product in the cart.
NOTE
The products are copied to all the group members. When the processing is complete,
you see individual quotes for each group member. While the batch process is running,
the Price and Validate button in the cart is disabled.
NOTE
If you have a large number of group members, processing may take a while to
complete.
NOTE
Apply to Group is a Vlocity action button that launches the ApplytoGroup OmniScript.
This invokes the MultiServiceApplyToGroupBatch batch processing job, which invokes
the MultiService_ApplyToGroup Integration Procedure.
NOTE
Validate and Price is a Vlocity action button that launches the PriceandValidate
OmniScript. This invokes the MultiServicePriceValidateBatch batch processing job
which invokes the following Vlocity Integration Procedure:
MultiService_ApplyToGroup.
1. After validation and pricing completes for each group, click Create and Submit Orders for Quotes or
Submit Orders for Orders.
2. Click Create and Submit Orders or Submit Orders on the confirmation message window.
After you submit, you are redirected to the Account record page.
IMPORTANT
The Submit button is disabled for the group until the price and validate action is
complete for all members of at least one group.
If you submit before selecting, pricing, and validating products for all groups, only the
completed groups are submitted.
NOTE
The MultiServiceCheckout Action button launches the OmniScript called MultiService/
Checkout. This invokes the Vlocity Batch framework, which invokes the MultiService/
Checkout Integration Procedure. For a master Quote, this creates Orders and
corresponding Assets. For a master Order, this creates only corresponding Assets.
What's Next
See View Multi-Site Orders on the Account Record Page for details about viewing the Orders and related
Assets on the Account record page.
Optionally, you can customize the submission process to initiate additional workflows such as, for example,
creating an approval process.
These tasks do not apply to the Winter '20 and Fall '19 releases.
The tasks described here apply if all of the following are true:
• You configured the Apply to Group OmniScript as described in Configure Multi-Site Customizations.
• You set the EnableMultiSiteBulkAction setting to true as described in Configure Multi-Site
Customizations.
• In the Create the Opportunity, Quote or Order Structure, and Groups task, you chose Multiple Quote or
Multiple Order.
1. From the group page of the master Quote or Order, click Next.
This takes you to the Vlocity Group Cart. The groups you defined are listed in the left pane.
2. Select the group to which to add products.
3. Select the Price List for the products.
4. For each product, click Add to Cart next to the product name.
NOTE
You can add more than one product to the cart and configure each product in the cart.
1. On the groups page, click Apply to Group to copy the selected products for each group to each
member of that group.
2. Click Apply to Group on the confirmation message window.
NOTE
The products are copied to all the group members. When the processing is complete,
you see individual quotes for each group member. While the batch process is running,
the Validate and Price button in the cart is disabled.
TIP
If you have a large number of groups or members, processing may take a while to
complete.
NOTE
Apply to Group is a Vlocity action button that launches the ApplytoGroup OmniScript.
This invokes the MultiServiceApplyToGroupBatch batch processing job, which invokes
the MultiService_ApplyToGroup Integration Procedure.
NOTE
Validate and Price is a Vlocity action button that launches the PriceandValidate
OmniScript. This invokes the MultiServicePriceValidateBatch batch processing job
which invokes the following Vlocity Integration Procedure:
MultiService_ApplyToGroup.
1. After validation and pricing completes for each group, click Create Orders for Quotes or Submit Orders
for Orders.
IMPORTANT
The Submit button is disabled for the group until the validate and price action is
complete for all members of each group.
NOTE
The MultiServiceCheckout Action button launches the OmniScript called MultiService/
Checkout. This invokes the Vlocity Batch framework, which invokes the MultiService/
Checkout Integration Procedure. For a master Quote, this creates Orders and
corresponding Assets. For a master Order, this creates only corresponding Assets.
What's Next
See View Multi-Site Orders on the Account Record Page for details about viewing the Orders and related
Assets on the Account record page.
Optionally, you can customize the check-out process to initiate additional workflows such as, for example,
creating an approval process.
1. In the Account record page, scroll to the Orders section to view a list of new Orders generated in the
Multi-Site process.
You will see either a single master Order or a list of Orders that includes the master and children.
2. Scroll to the Asset Management section to view a list of related Assets that are generated after the
Orders are created.
• If the Order Record Type is Standard Order, it's a single Order with no children
• If the Order Record Type is Group Cart, it's a Multi-Site group Cart
• If the Order Record Type is Master Order, it's a Multi-Site master
• If the Order Record Type is Sub Order, it's a Multi-Site child
Likewise, the Quote Record Type indicates whether a Quote is a standard, group, master, or child Quote.
Add an Order Record Type Column to the Order Related List for Accounts
1. In Lightning Experience, go to Setup, then click Object Manager.
2. In the Quick Find box, type account, then click Account in the object list.
3. Click Page Layouts. Select Edit for the layout for which you want to edit the Order Related List.
4. In the upper-left box, click Related Lists.
5. Scroll to Orders under Related Lists, and click the wrench icon to edit the Related List Properties.
The Related List Properties window appears.
6. In the Available Fields list, select Order Record Type, then click the Add button.
6. Click Save.
7. Click Page Layouts again.
8. Click Page Layout Assignment, then click Edit Assignment.
9. Select the rows for the profiles to which to assign the layout you just edited.
10. Select the layout you just edited from the Page Layout to Use drop-down.
Results
When you view a master Quote or Order record page, the Quote Product Rollups or Order Product Rollups
related list looks something like this:
You can configure how Vlocity CPQ interacts with external (non-Vlocity OM) order management systems.
Sample payloads and known responses such as notification payloads, reason codes, state values, and so
on, are included. Also described is how you can extend or inject and define your own implementation for
integrations in the event the Vlocity default payload formats are not sufficient or you must build different
transport methods for integration.
The Order Management Integration Layer exposes an interface that can accept notifications from order
management systems.
vlocity_cmt.OdinService.notify(List<Object> notificationList)
POST
/odin/v1/notifications
Notification Types
Order Management Integration Layer accepts the following notification types:
• OrderItem Activated
• OrderItem Assetized
• OrderItem In Progress
• OrderItem Rejected
These DataRaptors:
• Map fields from incoming messages to order record or order item record fields.
• Support custom field names and dot notation.
Dot-notation example: Account.PrimaryContactId__r.IsPartner__c will allow you to update a
contact's field from an order.
TIP
DataRaptors can negatively impact performance because of additional DML and SOQL
transactions. If you know the field names that need to be updated and those fields are not
a lookup to a related record, then you can send the field names and their values in the
fields and specify the updateMethod to be directfieldupdate. This slightly improves
performance by avoiding DataRaptor-related DML and SOQL transactions.
Order-Level Notification
Order-level notification messages contain sections that update order record fields. To perform updates,
Order Management Integration Layer requires a DataRaptor named OrderBackSync, which will map the
fields in the incoming notification messages to the corresponding order record fields.
• Order Accepted
• Order Activated
• Order In Progress
• Order Queued
• Order Rejected
• OrderItem Accepted
• OrderItem Activated
• OrderItem Assetized
• OrderItem In Progress
• OrderItem Rejected
Notification Examples
Order Management Integration Layer can send field updates for the following notifications. When the fields
container is included in a notification, the corresponding DataRaptor is invoked: OrderBackSync or
OrderItemBackSync.
Order Activated
Order Management Integration Layer sends this notification when the order management system fulfills
orders that are an original order or a supplemental order. The order management system sends this
notification to CPQ when the order is activated. The optional fields parameter can contain any data that
must be set in order fields.
For example, the following Order Activated notification includes a fields section that contains a list of fields
to update in the order record. It will call the OrderBackSync DataRaptor by default.
[
{
"orderId": "8011U000000Tq5l",
"state": "Activated",
"fields": {
"vlocity_cmt__JeopardyStatus__c": "Green"
}
}
]
[
{
"orderId": "8011U000000Tq5l",
"state": "Activated",
"fields": {
"meta": {
"updateMethod": "directfieldupdate"
},
"vlocity_cmt__JeopardyStatus__c": "Green"
}
}
]
The fields parameter supports the meta parameter and its updateMethod, which can have the
following values:
• dataraptor (the default): Order Management Integration Layer calls the DataRaptor for the object.
• directfieldupdate: Order Management Integration Layer collects the values of all the fields in the
fields section and sets them in the the SObject for which the notification is sent. If the field name that
comes in the notification does not exist on the sObject (Order or OrderItem), then that field is skipped.
Order Management Integration Layer also skips field names with dot notations. This will set the field
names and values exactly as they appear in the notification. The directfieldupdate value supports
field names with and without a specified namespace.
NOTICE
All Order Management Integration Layer notifications support updateMethod and its
directfieldupdate value, including order-level and order-item-level notifications.
You can use Apex code for invoking the Order Activated notification, as shown in the following sample:
OrderItem Activated
Order Management Integration Layer sends the OrderItem Activated notification when the order
management system fulfills order items that are part of either an original order or a supplemental order. The
order management system sends this notification to CPQ when the order item is activated.
The optional fields parameter in the notification message can contain any data that must be set in the order
item fields.
The optional describedBy container can contain any data that must be set to attributes of an order item.
Any attribute that is set is copied to the asset.
[
{
"orderItemId": "8021U000000hv6T",
"state": "Activated",
"fields": {
"vlocity_cmt__DueDate__c": "2019-10-01T10:00:23+10:00",
"vlocity_cmt__JeopardyStatus__c": "Green"
},
"describedBy": {
"IMSI": "00000000",
"MSISDN": "61456273222"
}
}
]
Sample Apex code example for invoking the OrderItem Activated notification:
IMPORTANT
When the OrderItem Activated notification is received, Order Management Integration
Layer updates the fields and attributes for the order item for which the notification is sent. It
also marks the order item and its children (if any) as Activated. This notification does not
create an asset.
With fields:
[
// Supplemental Order Item rejected
{
"orderItemId": "8021U000000hv6T",
"state": "Rejected",
"reasonCode": "PONR",
"reasonDescription": "Point of Non Return is reached"
"fields" :
{
"CustomName__c": "IphoneX125",
"Memory__c": "125GB"
}
},
Without fields:
[
// Supplemental Order Item rejected
{
"orderItemId": "8021U000000hv6T",
"state": "Rejected",
"reasonCode": "PONR",
"reasonDescription": "Point of Non Return is reached"
},
// Supplemental Order rejected
{
"orderId": "8011U000000Tq5l",
"state": "Rejected",
"reasonCode": "PONR",
"reasonDescription": "Point of Non Return is reached"
}
]
Order Rejected
This notification is sent when a supplemental order is created and submitted. The order management
system processes the fulfillment of the supplemental order.
During fulfillment, the order management system might determine that it cannot proceed with the
supplemental order. In such cases, it sends a notification message to CPQ that the supplemental order is
Rejected.
Similar to the Order Activated notification message, an optional fields container is included allowing the
order management system to pass any values for any of the Order fields.
[
{
"orderId": "8011U000000Tq5l",
"state": "Rejected",
"reasonCode": "PONR",
"reasonDescription": "Point of Non Return is reached"
}
]
The following Apex code example shows how to invoke the Order Rejected notification:
OrderItem Rejected
This notification is sent when a supplemental order is created and submitted and the order management
system processes the fulfillment of the supplemental order. During fulfillment, the order management
system might determine that a certain order item in the supplemental order cannot be processed. In such
cases, it sends a notification message to CPQ that the order item in the supplemental order is rejected.
You can optionally include the OrderItem Rejected notification in the Order Rejected payload.
[
{
"orderItemId": "8021U000000hv6T",
"state": "Rejected",
"reasonCode": "PONR",
"reasonDescription": "Point of Non Return is reached"
}
]
The following Apex code example shows how to invoke the OrderItem Rejected notification:
With fields:
[
{
"orderId": "8011U000000Tq5l",
"state": "Accepted",
"fields" :
{
"DueDate__c": "2020-08-28T02:42:19.861Z",
"ThorJeopardyStatus__c": "Green"
}
}
]
Without fields:
[
{
"orderId": "8011U000000Tq5l",
"state": "Accepted",
}
]
With fields:
[
// Supplemental Order Item accepted
{
"orderItemId": "8021U000000hv6T",
"state": "Provisionally Accepted",
"fields" :
{
"CustomName__c": "IphoneX125",
"Memory__c": "125GB"
}
},
// Supplemental Order accepted
{
"orderId": "8011U000000Tq5l",
"state": "Provisionally Accepted",
"fields" :
{
"DueDate__c": "2020-08-28T02:42:19.861Z",
"ThorJeopardyStatus__c":"Green"
}
}
]
Without fields:
[
// Supplemental Order Item accepted
{
"orderItemId": "8021U000000hv6T",
"state": "Provisionally Accepted",
},
// Supplemental Order accepted
{
"orderId": "8011U000000Tq5l",
"state": "Provisionally Accepted",
}
]
Order Accepted
This notification is sent when a supplemental order is created and submitted, and the order management
system processes the fulfillment of the supplemental order. During fulfillment, the order management
system might determine that the supplemental order can be successfully processed The previous order
was successfully frozen and the supplemental order is now being fulfilled. In such cases, the order
management system sends an Order Accepted notification message.
The optional fields container stores any data that must be updated to the Order record.
[
{
"orderId": "8011U000000Tq0H",
"state": "Accepted"
}
]
The following Apex code example shows how to invoke the Order Accepted notification:
OrderItem Accepted
This notification is sent when a supplemental order is created and submitted, and the order management
system processes the fulfillment of the supplemental order. During fulfillment, the order management
system might determine that a particular order item can successfully supersede an order item from a
previous order. In such cases, the order management system sends the OrderItem Accepted notification.
You can optionally include the OrderItem Accepted notification in the Order Accepted payload.
The notification message may optionally contain fields and describedBy containers. The fields container
contains any data that must be updated in the OrderItem record.
The describedBy container stores any data that must be updated in the OrderItem.
[
{
"orderItemId": "8011U000000Tq0H",
"state": "Accepted"
}
]
Order In Progress
This notification is sent when an order is created and submitted to the order management system. The
order management system might send the Order In Progress notification message when processing the
order. It can also send the fields container in the notification message, which contains any data that must
be updated in the order record.
[
{
"orderId": "8021U000000hv6T",
"state": "In Progress",
"PONR": true,
"fields": {
"meta": {
"updateMethod": "directfieldupdate"
},
"vlocity_cmt__JeopardyStatus__c": "Green"
}
}
]
OrderItem In Progress
This notification is sent when an order is created and submitted to the order management system. During
the processing of the order, the order management system might send the OrderItem In Progress
notification message. It can send fields or describedBy container in the notification message. The fields
container can contain any data that must be updated in the order item record. The describedBy container
may contain data that must be updated to attributes of the order item.
[
{
"orderItemId": "8021U000000hv6T",
"state": "In Progress",
"PONR": true,
"fields": {
"meta": {
"updateMethod": "dataraptor"
},
"vlocity_cmt__DueDate__c": "2019-10-01T10:00:23+10:00",
"vlocity_cmt__JeopardyStatus__c": "Green"
},
"describedBy": {
"IMSI": "00000000",
"MSISDN": "61456273222"
}
}
]
OrderItem Assetized
When the order management system is instructed to create an asset before the order item is fulfilled, the
OrderItem Asset notification is called. The notification can send fields or describedBy container in the
notification message. The fields container may contain any data that must be updated in the OrderItem
record. The describedBy container may contain data that muat be updated to attributes of the order item.
[
{
"orderItemId": "8021U000000hv6T",
"state": "Assetize",
"fields": {
"vlocity_cmt__DueDate__c": "2019-10-01T10:00:23+10:00",
"vlocity_cmt__JeopardyStatus__c": "Green"
},
"describedBy": {
"IMSI": "00000000",
"MSISDN": "61456273222"
}
}
]
Order Queued
The order management system sends this notification when the order is queued. The notification message
can optionally contain the fields container. The fields container contains any data that must be updated in
the order record.
[
{
"orderId": "8111U000000Tq6G",
"state": "Queued"
}
]
See Also
DataRaptor Setup for Order Management Integration Layer
"source": "Promotion",
"sequence": 2001,
"requestDate": null,
"pricingVariable": {
"code": "REC_MNTH_STD_PRC_ADJ_PCT"
},
"pricingElement": {
"globalKey": "fbef14ff-6f91-bfc8-6eb7-eac71b0af37b"
},
"orderItemId": "8024R000000p73zQAA",
"orderAppliedPromotionId": "a364R000001lEPIQA2",
"name": "a3D4R000000rNUi",
"fulfilmentStatus": null,
"fields": null,
"estimatedStartDate": null,
"estimatedEndDate": null,
"appliesTo": null,
"amount": null,
"adjustmentValue": -20.00,
"action": "Add"
},
{
"subAction": null,
"source": "Discount",
"sequence": 4001,
"requestDate": null,
"pricingVariable": {
"code": "REC_MNTH_STD_PRC_ADJ_PCT"
},
"pricingElement": null,
"orderItemId": "8024R000000p73uQAA",
"orderAppliedPromotionId": "a364R000001lEPNQA2",
"name": "edbcc744-67c4-d775-842e-60e384aa4eb1",
"fulfilmentStatus": null,
"fields": null,
"estimatedStartDate": null,
"estimatedEndDate": null,
"appliesTo": null,
"amount": null,
"adjustmentValue": -10.00,
"action": "Add"
},
{
"subAction": null,
"source": "Discount",
"sequence": 4001,
"requestDate": null,
"pricingVariable": {
"code": "OT_STD_PRC_ADJ_PCT"
},
"pricingElement": null,
"orderItemId": "8024R000000p73uQAA",
"orderAppliedPromotionId": "a364R000001lEPNQA2",
"name": "edbcc744-67c4-d775-842e-60e384aa4eb1",
"fulfilmentStatus": null,
"fields": null,
"estimatedStartDate": null,
"estimatedEndDate": null,
"appliesTo": null,
"amount": null,
"adjustmentValue": -10.00,
"action": "Add"
},
{
"subAction": null,
"source": "Agent",
"sequence": 3001,
"requestDate": null,
"pricingVariable": {
"code": "REC_MNTH_STD_PRC_ADJ_ABS"
},
"pricingElement": null,
"orderItemId": "8024R000000p73vQAA",
"orderAppliedPromotionId": null,
"name": "a3D4R000000rNUr",
"fulfilmentStatus": null,
"fields": null,
"estimatedStartDate": null,
"estimatedEndDate": null,
"appliesTo": null,
"amount": null,
"adjustmentValue": -2.00,
"action": "Add"
}
],
"orderItems": [
{
"supplementalAction": null,
"supersededOrderItemId": null,
"subAction": "Reassign",
"specifiedBy": {
"productName": "OdinTel Broadband Connection",
"globalKey": "d2f3674e-4fa3-ebb3-a2e3-fe23f596ac44"
},
"serviceAccountName": "OdinCustomer",
"serviceAccountId": "0014R00002gbHwTQAU",
"quantity": 1.00,
"previousSupplementalAction": null,
"orderItemId": "8024R000000p73qQAA",
"orderId": "8014R000000AQGrQAO",
"lineNumber": "0001.0001",
"isFreshCancellation": false,
"fulfilmentStatus": null,
"firstVersionOrderItemId": null,
"fields": {
"Order.Account.Name": "OdinCustomer"
},
"describedBy": null,
"billingAccountName": "OdinCustomer",
"billingAccountId": "0014R00002gbHwTQAU",
"assetReferenceId": "9da4740e-2cd8-321b-e03f-79845954ed5b",
"action": "Disconnect"
},
{
"supplementalAction": null,
"supersededOrderItemId": null,
"subAction": "Reassign",
"specifiedBy": {
"productName": "OdinTel provided NetGear Wifi Router",
"globalKey": "7352c8a7-24c5-6a1c-c3ed-806cffa59367"
},
"serviceAccountName": "OdinCustomer",
"serviceAccountId": "0014R00002gbHwTQAU",
"quantity": 1.00,
"previousSupplementalAction": null,
"orderItemId": "8024R000000p73rQAA",
"orderId": "8014R000000AQGrQAO",
"lineNumber": "0001.0002",
"isFreshCancellation": false,
"fulfilmentStatus": null,
"firstVersionOrderItemId": null,
"fields": {
"Order.Account.Name": "OdinCustomer"
},
"describedBy": null,
"billingAccountName": "OdinCustomer",
"billingAccountId": "0014R00002gbHwTQAU",
"assetReferenceId": "4381eba6-e5f5-55a9-3d56-36ce3eded59f",
"action": "Disconnect"
},
{
"supplementalAction": null,
"supersededOrderItemId": null,
"subAction": "Replace",
"specifiedBy": {
"productName": "OdinTel Student Internet Offer",
"globalKey": "447e4627-925d-5279-6973-1532a8a01cc4"
},
"serviceAccountName": "OdinCustomer",
"serviceAccountId": "0014R00002gbHwTQAU",
"quantity": 1.00,
"previousSupplementalAction": null,
"orderItemId": "8024R000000p73pQAA",
"orderId": "8014R000000AQGrQAO",
"lineNumber": "0001",
"isFreshCancellation": false,
"fulfilmentStatus": null,
"firstVersionOrderItemId": null,
"fields": {
"Order.Account.Name": "OdinCustomer"
},
"describedBy": null,
"billingAccountName": "OdinCustomer",
"billingAccountId": "0014R00002gbHwTQAU",
"assetReferenceId": "41b97b5c-2382-1a45-563c-409e08b4402a",
"action": "Disconnect"
},
{
"supplementalAction": null,
"supersededOrderItemId": null,
"subAction": "Replace",
"specifiedBy": {
"productName": "OdinTel Internet Offer",
"globalKey": "afb2cc8b-d89b-50d3-6c5d-b08924f0aee0"
},
"serviceAccountName": "OdinCustomer",
"serviceAccountId": "0014R00002gbHwTQAU",
"quantity": 1.00,
"previousSupplementalAction": null,
"orderItemId": "8024R000000p73uQAA",
"orderId": "8014R000000AQGrQAO",
"lineNumber": "0002",
"isFreshCancellation": false,
"fulfilmentStatus": null,
"firstVersionOrderItemId": null,
"fields": {
"Order.Account.Name": "OdinCustomer"
},
"describedBy": null,
"billingAccountName": "OdinCustomer",
"billingAccountId": "0014R00002gbHwTQAU",
"assetReferenceId": "ba32e205-ed5c-3a81-7262-b5e865fa9475",
"action": "Add"
},
{
"supplementalAction": null,
"supersededOrderItemId": null,
"subAction": "Reassign",
"specifiedBy": {
"productName": "OdinTel Broadband Connection",
"globalKey": "d2f3674e-4fa3-ebb3-a2e3-fe23f596ac44"
},
"serviceAccountName": "OdinCustomer",
"serviceAccountId": "0014R00002gbHwTQAU",
"quantity": 1.00,
"previousSupplementalAction": null,
"orderItemId": "8024R000000p73vQAA",
"orderId": "8014R000000AQGrQAO",
"lineNumber": "0002.0001",
"isFreshCancellation": false,
"fulfilmentStatus": null,
"firstVersionOrderItemId": null,
"fields": {
"Order.Account.Name": "OdinCustomer"
},
"describedBy": null,
"billingAccountName": "OdinCustomer",
"billingAccountId": "0014R00002gbHwTQAU",
"assetReferenceId": "0d31567b-68eb-e244-52b0-e5fbd87cf086",
"action": "Add"
},
{
"supplementalAction": null,
"supersededOrderItemId": null,
"subAction": "Reassign",
"specifiedBy": {
"productName": "OdinTel provided NetGear Wifi Router",
"globalKey": "7352c8a7-24c5-6a1c-c3ed-806cffa59367"
},
"serviceAccountName": "OdinCustomer",
"serviceAccountId": "0014R00002gbHwTQAU",
"quantity": 1.00,
"previousSupplementalAction": null,
"orderItemId": "8024R000000p73wQAA",
"orderId": "8014R000000AQGrQAO",
"lineNumber": "0002.0002",
"isFreshCancellation": false,
"fulfilmentStatus": null,
"firstVersionOrderItemId": null,
"fields": {
"Order.Account.Name": "OdinCustomer"
},
"describedBy": null,
"billingAccountName": "OdinCustomer",
"billingAccountId": "0014R00002gbHwTQAU",
"assetReferenceId": "a15fa8bd-9793-9c03-ff09-0f7544498247",
"action": "Add"
},
{
"supplementalAction": null,
"supersededOrderItemId": null,
"subAction": null,
"specifiedBy": {
"productName": "OdinTel 4g Data",
"globalKey": "5de352ac-8764-2666-7cb9-bdf234421b6a"
},
"serviceAccountName": "OdinCustomer",
"serviceAccountId": "0014R00002gbHwTQAU",
"quantity": 1.00,
"previousSupplementalAction": null,
"orderItemId": "8024R000000p73zQAA",
"orderId": "8014R000000AQGrQAO",
"lineNumber": "0003",
"isFreshCancellation": false,
"fulfilmentStatus": null,
"firstVersionOrderItemId": null,
"fields": {
"Order.Account.Name": "OdinCustomer"
},
"describedBy": null,
"billingAccountName": "OdinCustomer",
"billingAccountId": "0014R00002gbHwTQAU",
"assetReferenceId": "674e2819-89f3-218a-215c-604b823142c7",
"action": "Add"
}
],
"orderItemRelationships": [
{
"relationshipType": "Replacement",
"relatedOrderItemId": "8024R000000p73pQAA",
"relatedAssetReferenceId": null,
"productRelationshipIdentifier": null,
"orderItemId": "8024R000000p73uQAA",
"orderId": "8014R000000AQGrQAO",
"action": null
},
{
"relationshipType": "Reassignment",
"relatedOrderItemId": "8024R000000p73qQAA",
"relatedAssetReferenceId": null,
"productRelationshipIdentifier": null,
"orderItemId": "8024R000000p73vQAA",
"orderId": "8014R000000AQGrQAO",
"action": null
},
{
"relationshipType": "Reassignment",
"relatedOrderItemId": "8024R000000p73rQAA",
"relatedAssetReferenceId": null,
"productRelationshipIdentifier": null,
"orderItemId": "8024R000000p73wQAA",
"orderId": "8014R000000AQGrQAO",
"action": null
}
],
"orderId": "8014R000000AQGrQAO",
"orderAppliedPromotions": [
{
"subAction": null,
"sequence": null,
"requestDate": null,
"reasonForCancellation": null,
"promotionDefinition": {
"globalKey": "b657f2d7-0c35-6ea5-730c-6cce9ed2b809"
},
"pricingStartDate": null,
"pricingEndDate": null,
"name": "a364R000001lEPI",
"fulfilmentStatus": null,
"fields": null,
"discount": {
},
"commitmentStartDate": null,
"commitmentEndDate": null,
"appliesTo": null,
"action": "Add"
},
{
"subAction": null,
"sequence": null,
"requestDate": null,
"reasonForCancellation": null,
"promotionDefinition": null,
"pricingStartDate": null,
"pricingEndDate": null,
"name": "edbcc744-67c4-d775-842e-60e384aa4eb1",
"fulfilmentStatus": null,
"fields": null,
"discount": {
"id": "a394R000000rcVlQAI",
"source": "OrderDiscount__c",
"referenceNumber": "edbcc744-67c4-d775-842e-60e384aa4eb1"
},
"commitmentStartDate": null,
"commitmentEndDate": null,
"appliesTo": null,
"action": "Add"
}
],
"isActiveOrderVersion": false,
"fulfilmentStatus": null,
"firstVersionOrderId": null,
"fields": {
"Account.Name": "OdinCustomer"
},
"accountName": "OdinCustomer",
"accountId": "0014R00002gbHwTQAU"
}
]
}
List<String>> {
'Order' => new List<String> {
'Account.Name'
},
'OrderItem' => new List<String> {
'Order.Account.Name'
}
};
System.debug(orderRequest.serialize());
Trimmed to 15 characters
These are
related to
Change of
Plan.
vlocity_cmt__SupplementalAction__c supplementalAction String
Does not exist in salesforce. This value is computed while the order request is isFreshCancellation Boolean
generated.
Does not exist in the record. This value is retrieved using dot notation from previousSupplementalAction String • null
vlocity_cmt__SupersededOrderItemId__r.vlocity_cmt__SupplementalAction__c • No
Change
• Amend
• Cancel
• Create
Trimmed to 15 characters
vlocity_cmt__AccountDiscountId__c AccountDiscountid String (ID) Salesforce ID
Trimmed to 15 characters
vlocity_cmt__Action__c Action String • Add
• Change
• Disconnect
vlocity_cmt__AppliesTo__c AppliesTo String • Account
• Asset
• Contract
• Multiple Assets
vlocity_cmt__AssetId__c AssetId String (ID) Salesforce ID
Trimmed to 15 characters
vlocity_cmt__PricingEndDate__c BenefitEndDate DateTime yyyy-MM-ddTHH:mm:ss.SSS+/-HHmm
or yyyy-MM-ddTHH:mm:ss.SSSZ
vlocity_cmt__PricingStartDate__c BenefitStartDate DateTime yyyy-MM-ddTHH:mm:ss.SSS+/-HHmm
or yyyy-MM-ddTHH:mm:ss.SSSZ
vlocity_cmt__CommitmentEndDate__c CommitmentEndDate DateTime yyyy-MM-ddTHH:mm:ss.SSS+/-HHmm
or yyyy-MM-ddTHH:mm:ss.SSSZ
vlocity_cmt__CommitmentStartDate__c CommitmentStartDate DateTime yyyy-MM-ddTHH:mm:ss.SSS+/-HHmm
or yyyy-MM-ddTHH:mm:ss.SSSZ
vlocity_cmt__ContractId__c ContractId String (ID) Salesforce ID
vlocity_cmt__ContractDiscountId__c ContractDiscountId String (ID) Salesforce ID
IMPORTANT
Field values that include Salesforce IDs are truncated if they 15 characters.
Example of a Freeze Order request sent from Order Management Integration Layer to the order
management system:
{
"orders": [{
"orderId": "8016g000000LD9RAAW"
}]
}
In response to the Freeze Order request, the following response might be provided by the order
management system indicating that the freeze request has been accepted by the order management
system:
[{
"orderId": "8011U000000Tq5l",
"state": "Accepted",
}]
In the above example, the orderId field is mandatory and should contain the Salesforce ID of the order
that is frozen. The state is also mandatory and should contain either Accepted or Rejected. No other
values are recognized by Order Management Integration Layer.
[
// Supplemental Order Item rejected
{
"orderItemId": "8021U000000hv6T",
"state": "Rejected",
"reasonCode": "PONR",
"reasonDescription": "Point of Non Return is reached"
},
// Supplemental Order rejected
{
"orderId": "8011U000000Tq5l",
"state": "Rejected",
"reasonCode": "PONR",
"reasonDescription": "Point of Non Return is reached"
},
]
In the previous example, orderId is mandatory and should contain the Salesforce ID of the order that is
frozen. State is mandatory and should contain the either Accepted or Rejected. No other values are
recognized by Order Management Integration Layer.
The reasonCode field is mandatory if state = Rejected. The valid value for reasonCode is: PONR (point
of no return).
The reasonDescription field is optional. It should contain text that describes the reason for the
rejection.
Example Unfeeze Order request sent from Order Management Integration Layer to the order management
system:
{
"orders": [{
"orderId": "8016g000000LD9RAAW"
}]
}
The order management system might provide the following response indicating that the Unfreeze Order
request has been accepted by the order management system:
[{
"orderId": "8011U000000Tq5l",
"state": "Accepted",
}]
The orderId field is mandatory and should contain the Salesforce ID of the order that is frozen. The state
is also mandatory and should contain Accepted. No other values are recognized by Order Management
Integration Layer.
See Also
Unfreeze Order
Pre-hooks execute before the actual handler API executes. Post-hooks execute after the actual handler API
executes.
Here is an example of how to write a hook for an Order Item Assetize Notification:
if( methodName.equalsIgnoreCase('processNotifications.PreInvoke'))
{
processNotifications_PreInvoke(methodName, input,
output,options);
return true;
}
if( methodName.equalsIgnoreCase('processNotifications.PostInvoke')) {
processNotifications_PostInvoke(methodName, input,
output,options);
return true;
}
return false;
options) {
//This method gets called after processNotifications
List<Object> notificationList = (List<Object>)
input.get('notificationList');
List<Map<String, Object>> notifMapList =
convertToListOfMap(notificationList);
for (Map<String, Object> oneNotifMap : notifMapList)
{
//Write your logic here
}
}
Cart-Based APIs
Vlocity CPQ's Cart-Based APIs enable client application users to shop for and order products and services.
The Cart-Based APIs provide a layer of abstraction between client application development and the
configuration of the underlying CPQ logic.
For Cart-based Swagger reference information, see Cart-Based API Swagger Reference.
https://{instance}.salesforce.com/services/apexrest/{namespace}
Where:
• instance identifies the Salesforce instance that hosts your Salesforce organization (org)
• namespace identifies the Vlocity app package, such as vlocity_cmt
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.
Concurrent API request limits govern the number of concurrent inbound requests (or calls) with a duration
of 20 seconds or longer. Vlocity Omnichannel Web APIs are designed to complete calls much faster than
20 seconds, with the possible exception of a POST of bulk data to Salesforce using a DataRaptor API.
Therefore, this limit does not usually apply.
For more information about API limits, see API Limits 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 in the Force.com
Apex Code Developer Guide.
Non-Alphanumeric Characters
Ensure that API input expressions containing non-alphanumeric characters are preceded with var:. For
example, to use an input expression of "DIMENSION-33269", specify var:"DIMENSION-33269"
instead.
See Also
Omnichannel Web APIs
For more about Vlocity's guest user implementation, see Guest User Enhancements Overview.
Beginning with CME Spring '20 Minor Release, Vlocity 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.
Cart-Based APIs
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
POST /carts
/cpq/carts/*
/cpq/carts/*/attributes
Get Filterable Attributes
GET /cpq/carts/{encrypted_cart_ID}/attributes
/cpq/carts/*/cancel
• Cancel Order
POST /cpq/carts/{encrypted_cart_ID}/cancel
• Create Supplemental Order
POST /cpq/carts/{encrypted_order_ID}/cancel
• Send Updates on Cancellations
PUT /cpq/carts/{encrypted_cart_ID}/cancel
• Submit a Cancel Order Request
POST /v2/cpq/carts/{encrypted_order_ID}/cancel
/cpq/carts/*/items
/cpq/carts/*/items/checkout
• Checkout Items in Cart
POST /cpq/carts/{encrypted_cart_ID}/items/checkout
• Check Status of the Cart
GET /cpq/carts/{encrypted_cart_ID}/items/checkout
/cpq/carts/*/items/*/itemattributes
Update Item Attributes
PUT /cpq/carts/{encrypted_cart_ID}/items/{itemId}/itemattributes)
/cpq/carts/*/items/*/pricing
• Apply Adjustment
POST /cpq/carts/{encrypted_cart_ID}/items/{itemId}/pricing
• Applies an Adjustment (Discount, Markup, or Override to a Price)
PUT /cpq/carts/{encrypted_cart_ID}/items/{itemId}/pricing
• Delete Adjustment
DELETE /cpq/carts/{encrypted_cart_ID}/items/{itemId}/pricing
• Get Price Waterfall for Price
GET /cpq/carts/{encrypted_cart_ID}/items/{itemId}/pricing
/cpq/carts/*/price
• Price Items in Cart (Query)
GET /cpq/carts/{encrypted_cart_ID}/price
• Run Pricing for Items to Cart
POST /cpq/carts/{encrypted_cart_ID}/price
/cpq/carts/*/pricelists
Get Price Lists for Cart
GET /cpq/carts/{encrypted_cart_ID}/pricelists
/cpq/carts/*/products
• Get Details of Product
GET /cpq/carts/{encrypted_cart_ID}/products/{pricebookEntryId}
• Get List of Products
GET /cpq/carts/{encrypted_cart_ID}/products
• Get Products by ID
GET /v2/cpq/carts/{encrypted_cart_ID}/products?{id}&includeAttachment=[true|
false]
/cpq/carts/*/promotions
• Add Promotion to Cart
POST /cpq/carts/{encrypted_cart_ID}/promotions
• Delete Applied Promo Items
DELETE /cpq/carts/{encrypted_cart_ID}/promotions
• Get Applied or Available Promotions for Cart
GET /cpq/carts/{encrypted_cart_ID}/promotions
• Get Cart Promotions
GET /cpq/carts/{encrypted_cart_ID}/promotions
• Post Cart Promotion Items
POST /cpq/carts/{encrypted_cart_ID}/promotions
/cpq/catalogs/*
Get Catalog Information
GET /cpq/catalogs
Digital Commerce APIs that use a context key must encrypt them.
/carts
Create Cart from Basket
POST /carts
/catalogs/*/basket/*
• Create Basket with BasketAction
POST /catalogs/{catalogcode}/basket
• Get Basket Details API
GET /catalogs/{catalogcode}/basket/{basketkey}
• Update Basket Contents API
POST /catalogs/{catalogcode}/basket/{basketkey}
/catalogs/*/offers/*
• Get Offers by Catalog API
GET /catalogs/{catalogcode}/offers
• Get Offer Details API
GET /catalogs/{catalogcode}/offers/{offercode}
See Also
• Salesforce's Guest User Record Access Development Best Practices
• Salesforce's Guest User Security Policies and Timelines
• Give Secure Access to Unauthenticated Users with the Guest User Profile
• Salesforce Guest User - How to Test and Update Sharing Settings
NOTE
If Swagger does not render, refresh this page.
https://docs.vlocity.com/api/cme/v2/swagger-cpqapi.yaml
API responses 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.
NOTE
As of the CME Spring '17 release, OmniCPQServiceWrapper is deprecated. Vlocity
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
createOpportunity createCart Create Cart
createOrder createCart Create Cart
createQuote createCart Create Cart
deleteItem deleteCartsItems Remove Items from Cart
getProducts getCartsProducts Get List of Products
submitOpportunity checkout Checkout Items in Cart
submitOrder checkout Checkout Items in Cart
submitQuote checkout Checkout Items in Cart
updateItem putCartsItems Update Items in Cart
You must use the fieldsToUpdate parameter to update any default line item value.
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, UserSecurity Class and CPQ and Digital Commerce Changes
for Guest Users.
Remote Method
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.
REST Handler
APIItemsCartsCpqV2
Package
Communication (vlocity_cmt)
Resource Information
Response Format JSON
Resource URL /services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/items
Example Request
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": {
"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
}
NOTE
For more information about levelBasedApproach, see Configuring Cart Item Refresh
Levels.
Example Result
{
"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": [],
"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": {}
},
...
NOTE
An entire result can be thousands of lines long. This example has been truncated.
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, UserSecurity Class and CPQ and Digital Commerce Changes
for Guest Users.
Remote Method
postCartsPromoItems
REST Handler
APIPromotionsCartsCpqV2
Package
Communication (vlocity_cmt)
Resource Information
Response Format JSON
Resource URL /services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/promotions
Example Request
POST
{
"items": [
{
"itemId": "a30460000001vbgAAA"
}
],
"price": false,
"validate": false
}
Example Response
{
"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 to Cart
Add a product to the cart.
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.
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, UserSecurity Class and CPQ and Digital Commerce Changes
for Guest Users.
Remote Method
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
APIItemsCartsCpqV2
The following example illustrates how to call this API from Apex code.
Package
Communication (vlocity_cmt)
Resource Information
Response Format JSON
Resource URL /v2/cpq/carts/*/items
Example: /services/apexrest/{namespace}/v2/cpq/carts/801360000000oQ9/items
Example Request
{
"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
{
"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]
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.
POST /v2/cpq/carts/{cart_ID}/items/{ID}/pricing
NOTE
Prior to the Fall '20 release, the applyAdjustment 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 applyAdjustment 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, UserSecurity Class and CPQ and Digital Commerce Changes
for Guest Users.
Remote Method
applyAdjustment
Package
Communication (vlocity_cmt)
Resource Information
Example Request
POST /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000gmxY/items/
80246000000gXh2/pricing
{
"adjustments": [
{
"AdjustmentValue": -10,
"AdjustmentMethod": "Absolute",
"DetailType": "ADJUSTMENT",
"Field": "nv_cmt_dev__OneTimeCharge__c"
}
]
}
Example Result
{
"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=80146000000
h5jmAAA&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.
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.
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 and Setting Up Supplemental Order Support for OM and OM Plus Fall ‘19 (or
the instructions for your pre-CME Winter '20 release). This API does not use Order Management
Integration Layer 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, UserSecurity Class and CPQ and Digital Commerce Changes
for Guest Users.
Remote Method
cancelCart
REST Handler
APICancelCartsCPQV2
CpqAppHandler
{"methodName":"cancelCart", "cartId":"80146000000iwCx"}
Package
Communication (vlocity_cmt)
Resource Information
Example Request
POST /services/apexrest/v2/cpq/carts/{cart_ID}/cancel
{}
See Also
• 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
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, UserSecurity Class and CPQ and Digital Commerce Changes
for Guest Users.
Remote Method
getCarts
REST Handler
CpqCreateCartActionV2
Resource Information
Response Format JSON
Resource URL /services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/items/checkout
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):
• 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.
{
"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.
{
"totalSize": 0,
"messages": [
{
"code": "214",
"severity": "ERROR",
"message": "The following line items are not activated:
8021N00000BS6TFQA1,8021N00000BS6VPQA1,8021N00000BS6VQQA1,8021N00000BS6TGQA1,802
1N00000BS6THQA1,8021N00000BS6TKQA1,8021N00000BS6TLQA1,8021N00000BS6TMQA1,8021N0
0000BS6TNQA1"
}
]
}
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.
{
"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.
POST /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, UserSecurity Class and CPQ and Digital Commerce Changes
for Guest Users.
Remote Method
checkout
REST Handler
APICheckoutItemsCartsCPQV2
ContextId is required for the Checkout Items in Cart remote action, which is used in the Guided Selling
OmniScript.
Package
Communication (vlocity_cmt)
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
Example Responses
Example 26. Submit Opportunity
{
"totalSize":1,
"messages":[],
"records":
[
{
"messages":[],
"displaySequence":-1,
"id":"0Q01I000000TvNmSAK",
"objectType":"Quote"
}
]
}
}
]
}
POST /v2/cpq/carts/{cart_ID}/items/clone
Remote Method
cloneItems
REST Handler
CpqCloneCartItemActionV2
Package
Communication (vlocity_cmt)
Resource Information
Response Format JSON
Resource URL /services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/items/clone
Example Request
POST
{
"items": [
{
"itemId": "item_ID"
}
]
}
Example Result
{
"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" => {
"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" =>
"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__OneTimeTota
l__c"
}, "remote" => {
"params" => {
"methodName" => "getPriceDetail", "fields" =>
"vlocity_cmt__OneTimeTotal__c", "id" => "8026A000000cCaQQAU", "cartId" =>
"8016A000000bwDJQAY"
}
}, "client" => {
"records" => [], "params" => {}
}
}
}
},
"vlocity_cmt__RecurringTotal__c" => {
}, "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__RecurringTo
tal__c"
}, "remote" => {
"params" => {
"methodName" => "getPriceDetail", "fields" =>
"vlocity_cmt__RecurringTotal__c", "id" => "8026A000000cCaQQAU", "cartId" =>
"8016A000000bwDJQAY"
}
}, "client" => {
"records" => [], "params" => {}
}
}
}
},
NOTE
This example result has been truncated.
Create Cart
Create an opportunity, order, or quote based on the header object.
POST /v2/carts
Remote Method
createCart
REST Handler
CpqCreateCartActionV2
"Name": "Telco"
}, {
"AccountId": "00141000009erCBAAY"
}],
"subaction": "createQuote",
"fields": "Id,Name"
}
Package
Communication (vlocity_cmt)
Resource Information
Response Format JSON
Resource URL /services/apexrest/{namespace}/v2/carts
Example Requests
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",
"subaction": "createOppty",
"fields": "Id,Name,StageName"
}
POST /services/apexrest/vlocity_cmt/v2/carts
Body:
{
"subaction":"assetToOrder",
"id":"01t36000000pfcKAAQ,02i6A000000YEXN",
"accountId":"0016A0000072D3y",
"requestDate":"2019-12-01"
}
See Also
POST /v2/carts
Remote Method
assetToOrder
REST Handler
APICreateCartsCpqV2
CpqAppHandler
{
"methodName":"assetToOrder",
"id":"01t36000000pfcKAAQ,01t36000000pfcKAAR",
"accountId":"801360000008eNU",
"requestDateTime":"2021-10-7"
}
Package
Communication (vlocity_cmt)
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:
{
"subaction": "assetToOrder",
"id": "02i3O000006PrKSQA0",
"accountId": "0013O00000N6TEN",
"requestDateTime": "2021-11-10 10:24:04"
}
{
"subaction": "assetToOrder",
"id": "02i3O000006PrKSQA0",
"accountId": "0013O00000N6TEN",
"requestDateTime": "=NOW()"
}
Example Response
{
"totalSize": 0,
"messages": [],
"records": [
{
"messages": [],
"displaySequence": -1,
"cartId": "8014T000000MF5EQAW"
}
]
}
POST /v2/cpq/carts/{cart_ID}/sites
Remote Method
newSite
REST Handler
APISitesCartsCpqV2
CpqAppHandler
{
"methodName": "newSite",
"cartId": "801360000008eNU",
"objectType":"Account"
"inputFields":[{"value":"Test1234","fieldName":"name"}],
"fields":"Name,vlocity_cmt__Active__c"
}
Package
Communication (vlocity_cmt)
Resource Information
Response Format JSON
Resource URL /services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/sites
Example Request
POST
{
"objectType": "Account",
"inputFields": [{
"value": "Test1234",
"fieldName": "name"
}],
"fields": "Name,vlocity_cmt__Active__c"
}
Example Response
{
"totalSize" => 1,
"messages" => [],
"records" => [{
"messages" => [],
"displaySequence" => -1,
"Name" => "Test1234"
}]
}
POST /v2/stringtranslations/
Handles the API request and finds the implementation for the request.
Remote Method
createStringTranslations
Package
Communication (vlocity_cmt)
Example Response
{
"totalSize": 0,
"messages": [{
"code": "904",
"severity": "INFO",
"message": "Saved successfully."
}]
}
For releases prior to CME Winter '20, any supplemental order is treated as an order cancellation. See In-
Flight Order Cancellation.
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, UserSecurity Class and CPQ and Digital Commerce Changes
for Guest Users.
Remote Method
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.
// 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)
Resource Information
Response Format JSON
Resource URL /services/apexrest/{namespace}/v2/cpq/carts/{order_ID}/cancel
Example Request
POST
/services/apexrest/v2/cpq/carts/{order_ID}/cancel
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.
Code Description
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
Delete Adjustment
Delete an applied price adjustment for a line item in the cart, such as a discount, mark up, or override.
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, UserSecurity Class and CPQ and Digital Commerce Changes
for Guest Users.
Remote Method
deleteAdjustment
Package
Communication (vlocity_cmt)
Resource Information
Response Format JSON
Resource URL /services/apexrest/{namespace}/v2/cpq/carts/{cartId}/items/{id}/pricing/{adjustmentId}
Example Request
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
{
"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=80146000000
h5jmAAA&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
},
NOTE
This example has been truncated.
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. See Guest User
Technical Details. For additional information, UserSecurity Class and CPQ and Digital Commerce Changes
for Guest Users.
Remote Method
deletePromotionItems
REST Handler
APIPromotionsCartsCpqV2
Package
Communication (vlocity_cmt)
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/801f40000012NEIAA2/promotions
Request Body:
{
"id": "a2Lf40000008nL5EAI",
"cartId": "801f40000012NEIAA2",
"methodName": "deleteAppliedPromoItems",
"price": true,
"validate": true
}
Example Response
{
"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"
}
]
}
}
}
}
}
DELETE /v2/stringtranslations/ID
Remote Method
deleteStringTranslations
Package
Communication (vlocity_cmt)
Apex Method
Use this method with the supplemental order's ID as input (supplementalOrdId) to discard a
supplemental order request.
See Also
• Create Supplemental Order
• Unfreeze Order
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.
GET /v2/cpq/carts/{cart_ID}/items/{item_ID}/expand
Remote Method
getExpandedItems
Handlers
REST Endpoint: APIExpandItemCartsCpqv2.cls
Implementation: CpqExpandCartItemActionV2.cls
productHierarchyPath:"01t36000004hM92AAE<01t36000004hM8xAAE"
itemId: 80236000009E2InAAK
cartId: 80136000000OXQvAAO
}
Package
Communication (vlocity_cmt)
Resource Information
Response Format JSON
Resource URL /services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/items/{item_ID}/expand
Example Request
GET /services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000iwCx/
items/80236000009E2InAAK/expand?
productHierarchyPath=01t36000004hM92AAE<01t36000004hM8xAAE
Example Result
{
"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=01t360
00004hM92AAE<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": []
}
}]
}
}]
}
Freeze Order
Freeze the order's fulfillment in the order management system.
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
OriginalOrderCancellationStatusChanges 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
preValidate
REST Handler
APIPrevalidateCartsCPQV2
Apex
public static void preValidate(Id orderId)
{
Package
Communication (vlocity_cmt)
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 Vlocity-
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
• OdinAPIHandler
• Unfreeze Order
GET /v2/accounts/{account_ID}
Remote Method
getAccounts
Handlers
REST Endpoint: APIAccountsV2.cls
Implementation: CpqGetAccountsActionV2.cls
Package
Communication (vlocity_cmt)
Resource Information
Response Format JSON
Resource URL /services/apexrest/{namespace}/v2/accounts/{account_ID}
Example Request
GET
/services/apexrest/vlocity_cmt/v2/accounts/0011I000007lzDO?fields=OwnerId,Name
Example Response
{
"totalSize": 1,
"messages": [],
"records": [
{
"messages": [],
"displaySequence": -1,
"OwnerId": "0051I000000Qvb4QAC",
"Name": "AR3"
}
]
}
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:
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, UserSecurity Class and CPQ and Digital Commerce Changes
for Guest Users.
Remote Method
getPromotionList
REST Handler
APIPromotionsCartsCpqV2
Package
Communication (vlocity_cmt)
Resource Information
Response Format JSON
Resource URL /services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/promotions
Example Request
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
{
"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 /v2/accounts/{account_ID}/promotions
Remote Method
getAppliedPromotionsByAccount
Handlers
REST Endpoint: APIAppliedPromotionsAccountsV2.cls
Implementation: CpqAppliedPromotionsAccountActionV2.cls
Package
Communication (vlocity_cmt)
Resource Information
Response Format JSON
Resource URL /services/apexrest/vlocity_cmt/v2/cpq/carts/{account_ID}/promotions?
subaction=getPromotionsAppliedToCart
Example Request
GET /services/apexrest/vlocity_cmt/v2/cpq/carts/801360000000oQ9/promotions
Example Response
{
"totalSize": 1,
"messages": [],
"records": [
{
"messages": [],
"displaySequence": -1,
"Id": {
"value": "a1if4000000Z1wTAAS",
"previousValue": null,
"originalValue": null,
"messages": [],
"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 /v2/assets/{ID}/pricing?accountId={account_ID}
Remote Method
getAssetPriceDetail
Handlers
REST endpoint: APIAssetsPricingV2.cls
Implementation: CpqAssetsAccountsActionV2.cls
"id": "02i46000000htMrAAI",
"accountId": "0014600000qExFDAA0",
"effectiveAssetsDateFilter": "2017-11-06T00:00:00Z"
}
Package
Communication (vlocity_cmt)
Resource Information
Response Format JSON
Resource URL /services/apexrest/{namespace}/v2/assets/{ID}/pricing?accountId={account_ID}
Example Request
GET
/services/apexrest/vlocity_cmt/v2/assets/02i46000000htMrAAI/pricing?
accountId=0014600000qExFDAA0&effectiveAssetsDateFilter=2017-11-06T00:00:00Z
Example Response
{
"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 /v2/assets/{ID}/pricing?accountId={account_ID}
Remote Method
getAssetsByAccount
Handlers
REST Endpoint: APIAssetsContractsV2.cls
Implementation: CpqAssetsContractsActionV2.cls
Package
Communication (vlocity_cmt)
Resource Information
Response Format JSON
Resource URL /services/apexrest/{namespace}/v2/accounts/{account_ID}/assets
Example Request
GET /services/apexrest/vlocity_cmt/v2/accounts/0011I000007lzDO/assets?
pagesize=2&includes=noContractAssets&effectiveAssetsDateFilter=2019-04-05T07:00
:00.000Z
Example Response
{
"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 /v2/contracts/{contract_ID}/assets
Remote Method
getAssetsByContract
Handlers
REST Endpoint: APIAssetsContractsV2.cls
Implementation: CpqAssetsContractsActionV2.cls
Package
Communication (vlocity_cmt)
Resource Information
Response Format JSON
Resource URL /services/apexrest/{namespace}/v2/contracts/{contract_ID}/assets
Example Request
GET
/services/apexrest/vlocity_cmt/v2/contracts/8001I0000000Thq/assets?
pagesize=2&includes=noContractAssets&effectiveAssetsDateFilter=2020-04-05T07:00
:00.000Z
Example Response
{
"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&ef
fectiveAssetsDateFilter=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&e
ffectiveAssetsDateFilter=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": [],
"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__RecurringCalculate
dPrice__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 /v2/cpq/carts/{cart_ID}/sites?id={item_ID},lookupField={field_name},
[fields]={field names to return}
Remote Method
getAvailableSites
REST Handler
APISitesCartsCpqV2
CpqAppHandler
{
"methodName": "priceCart",
"cartId": "801360000008eNU",
"id":"01t36000000pfcKAAQ"
"lookupField": "vlocity_cmt__BillingAccountId__c"
}
Package
Communication (vlocity_cmt)
Example Request
GET
/services/apexrest/vlocity_cmt/v2/cpq/carts/8014100000009fU/sites
Example Result
{
"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,
GET /v2/cpq/carts/{cart_ID}/items?
query={query}&lastRecordId=(n)&pagesize={n}&filters={filter}&fields={field1,fie
ld2}&validate={true/false}&price={true/false}
Vlocity does not support fieldset as a parameter for this API. 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 Vlocity 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, UserSecurity Class and CPQ and Digital Commerce Changes
for Guest Users.
Remote Method
getCartsItems
REST Handler
APIItemsCartsCpqV2
Package
Communication (vlocity_cmt)
Resource Information
Response JSON
Format
Resource /services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/items?
URL query={query}&lastRecordId=(n)&pagesize={n}&filters={filter}&fields={field1,field2}&validate={true/
false}&price={true/false}
Example Request
GET
/services/apexrest/vlocity_cmt/v2/cpq/carts/80141000000Cg8H/items?pagesize=5
Example Response
{
"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",
"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": [],
"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
• Adding a New Column to Vlocity Cart
• Configuring Dual Data Sources
• Configuring OmniScript for Guided Selling
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, UserSecurity Class and CPQ and Digital Commerce Changes
for Guest Users.
Remote Method
getCartsPromotions
Handlers
REST Endpoint: APIPromotionsCartsCpqV2.cls
Implementation: EPCPromotionRuntimeService.cls
Package
Communication (vlocity_cmt)
Resource Information
Response Format JSON
Resource URL /services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/promotions
Example Request
GET /services/apexrest/vlocity_cmt/v2/cpq/carts/8011I000000TUaK/promotions?
query=iphone&sortBy=Id&filters=vlocity_cmt__Code__c:Root-Promo
Example Response
{
"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"
}
]
}
• Pricing information, such as total one-time charge and total recurring charge
• Account information associated with this cart
• If this cart includes a multi-site order, available sites
• Links to further actions, such as check out
GET /v2/cpq/carts/{cart_ID}?headerFieldSet={field_set_feature}&validate={true|
false}&price={true|false}
Get Cart Details returns all fields from the Opportunity, Order, or Quote, except for the following fields:
• IsDeleted
• CreatedDate
• CreatedById
• LastModifiedDate
• LastModifiedById
• SystemModstamp
• LastActivityDate
• CleanStatus
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 Vlocity 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, UserSecurity Class and CPQ and Digital Commerce Changes
for Guest Users.
Remote Method
getCarts
REST Handler
APICartsCpqV2
Package
Communication (vlocity_cmt)
Resource Information
Response Format JSON
Resource URL /services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}?
headerFieldSet={field_set_feature}&validate={true|false}&price={true|false}
Example Request
GET
/services/apexrest/vlocity_cmt/v2/cpq/carts/80141000000Cg8H
Example Result
{
"totalSize": 1,
"messages": [],
"records": [{
"messages": [],
"displaySequence": -1,
"details": {
"totalSize": 1,
"messages": [],
"records": [{
"messages": [],
"actions": {
"checkout": {
"rest": {
"params": {},
"method": "POST",
"link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/
80141000000Cg8HAAS/checkout"
},
"remote": {
"params": {
"cartId": "80141000000Cg8HAAS",
"methodName": "checkout"
}
},
"client": {
"params": {}
}
}
},
"displaySequence": -1,
"Id": "80141000000Cg8HAAS",
"Status": "Draft",
"OrderNumber": "00000965",
"Account.Name": "Telco test",
"EffectiveRecurringTotal__c": 0.00,
"EffectiveOneTimeTotal__c": 5.00,
"EffectiveOrderTotal__c": 5.00,
"ObjectType": "Order"
}]
},
"sites": {
"totalSize": 0,
"messages": [{
"severity": "ERROR",
"messageId": null,
"message": "No Results Found.",
"code": "101",
"actions": {}
}],
"actions": {
"newsite": {
"rest": {
"params": {},
"method": "POST",
"link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/
80141000000Cg8HAAS/sites"
},
"remote": {
"params": {
"type": "Service",
"methodName": "newSite"
}
},
"client": {
"params": {}
}
}
}
}
}]
}
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 custom object named VlocityAPIMetadata and set its
API name to getCatalogHierarchy. In the field named APIParams, 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}). To return all records when no page size is specified in the call, set the APIParams
fields to -1. To restore the default page size to 20, set the APIParams field to null or delete the
VlocityAPIMetadata custom object.
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, UserSecurity Class and CPQ and Digital Commerce Changes
for Guest Users.
Remote Method
getCatalogHierarchy
REST Handler
APICatalogsCpqV2
Package
Communication (vlocity_cmt)
Resource Information
Response Format JSON
Resource URL /services/apexrest/{namespace}/v2/cpq/catalogs?
catalogId={catalog_ID}&ContextId={cart_ID}
Examples
"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"
}
]
}
GET /services/apexrest/vlocity_cmt/v2/cpq/catalogs?pagesize=1
"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"
}
]
}
"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 /v2/assets/{ID}/pricing?accountId={account_ID}
Remote Method
getContracts
Handlers
REST Endpoint: APIContractsAccountsV2.cls
Implementation: CpqContractsAccountsActionV2.cls
Package
Communication (vlocity_cmt)
Resource Information
Response Format JSON
Resource URL /services/apexrest/{namespace}/v2/accounts/{account_ID}
Example Request
GET
/services/apexrest/vlocity_cmt/v2/accounts/0011I000007lzDO/contracts
Example Response
{
"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 /v2/cpq/carts/{cart_ID}/products/{pricebook_entry_ID}?
include=qualifications&ruleType=Qualification
or
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, UserSecurity Class and CPQ and Digital Commerce Changes
for Guest Users.
Remote Method
getRuleMessages
REST Handler
APIProductsCartsCpqV2
Package
Communications (vlocity_cmt)
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
GET
/services/apexrest/vlocity_cmt/v2/cpq/carts/801f4000000kCNPAA2/products/
01uf4000000sMtjAAE?include=qualifications&ruleType=Qualification
Example Response
{
"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 /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, UserSecurity Class and CPQ and Digital Commerce Changes
for Guest Users.
Remote Method
getCartsAttributes
REST Handler
APICartsAttributesCpqV2
CpqAppHandler
Package
Communication (vlocity_cmt)
Resource Information
Response Format JSON
Resource URL /services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/attributes
Example Request
GET
/services/apexrest/vlocity_cmt/v2/cpq/carts/80136000000siLM/attributes
Example Response
"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 /v2/cpq/carts/{cart_ID}/items?id={item_ID},{item_ID}&validate={true|false}
Remote Method
getCartsItemsById
REST Handler
APIItemsCartsCpqV2
Package
Communication (vlocity_cmt)
Resource Information
Response Format JSON
Resource URL /services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/items?
id=80236000000Z0QNAA0,01t36000000pfcKAAQ&validate=true
Example Request
GET
/services/apexrest/vlocity_cmt/v2/cpq/carts/80136000000aSTqAAM/items?
id=80236000000Z0QNAA0,01t36000000pfcKAAQ&validate=true
Example Result
{
"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
An entire result can be thousands of lines long. This example has been truncated.
NOTE
In Vlocity CMT V15, if the page size is set to 20, the API does not return images.
• Product IDs
GET /v2/cpq/carts/{cart_ID}/products?
query={query}&attributes={attribute_code:value}&lastRecordId={record_ID}&pagesi
ze={n}&includeAttachment={true|
false}&category={category}&filters={filters}&includeIneligible={true|false}
The value specified for attribute_code must be the ID of the value, not the label or display text.
Use the includeIneligible=true parameter if you are using context rules to control product visibility in the
product list. This will add a Category node to the response, which will contain two sub-nodes: Qualified and
Disqualified. If you want to display only the qualified products, you can select the list of products in the
Qualified sub-node.
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:
GET /services/apexrest/vlocity_cmt/v2/cpq/carts/8011N000002BL2P/products?
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, UserSecurity Class and CPQ and Digital Commerce Changes
for Guest Users.
Remote Method
getCartsProducts
REST Handler
APIProductsCartsCpqV2
Package
Communication (vlocity_cmt)
Resource Information
Response Format JSON
Resource URL /services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/products
Example Request
GET
/services/apexrest/vlocity_cmt/v2/cpq/carts/80141000000Cg8H/products?pagesize=5
Example Response
{
"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",
"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",
"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 /v2/listsofvalues?
listkeys={type_of_list}&cartId={cart_ID}&id={line_item_ID}&fields={field_name}&
PricingVariableCode={price_variable_code}
Remote Method
getListsOfValues
Package
Communication (vlocity_cmt)
Resource Information
Response Format JSON
Resource URL /services/apexrest/{namespace}/v2/listsofvalues
Example Request
GET
/services/apexrest/vlocity_cmt/v2/listsofvalues?
listkeys=AdjustmentCodes&cartId=80146000000goGvAAI&id=80246000000gaR9AAI&fields
=vlocity_cmt__OneTimeCharge__c&PricingVariableCode=OT_STD_PRC
Example Response
{
"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
GET
/services/apexrest/vlocity_cmt/v2/listsofvalues?listkeys=TimePlans,TimePolicies
Example Response
{
"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 /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, UserSecurity Class and CPQ and Digital Commerce Changes
for Guest Users.
Remote Method
getPriceLists
REST Handler
REST Endpoint: APIPriceListsCpqV2.cls
Implementation: CpqGetPriceListsActionV2.cls
Package
Communication (vlocity_cmt)
Resource Information
Response Format JSON
Resource URL /services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/pricelists
Example Request
GET
/services/apexrest/vlocity_cmt/v2/cpq/carts/8011I000000TUaK/pricelists?
pagesize=10
Example Response
{
"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 /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, UserSecurity Class and CPQ and Digital Commerce Changes
for Guest Users.
Remote Method
getPriceDetail
Package
Communication (vlocity_cmt)
Resource Information
Example Request
GET
/services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000goGv/items/
80246000000gZfO/pricing?fields=vlocity_cmt__OneTimeCharge__c
Example Response
{
"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.
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, UserSecurity Class and CPQ and Digital Commerce Changes
for Guest Users.
Remote Method
getCartsProductsById
REST Handler
APIProductsCartsCpqV2
id: 991360000008eNU,
includeAttachment: true,
fields: Product2.vlocity_cmt__CustomField__c
}
Package
Communication (vlocity_cmt)
Example Request
GET
/v2/cpq/carts/{cart_ID}/products?
id=01t36000000pfcKAAQ,01t36000000pfcKAAQ&includeAttachment=true
Example Response
{
"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" => {
},
"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" => {
},
"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",
"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" => []
},
NOTE
This example result has been truncated.
GET /v2/cpq/carts/{cart_ID}
Remote Method
getPromotionsAppliedToCart
REST Handlers
• REST endpoint: APIPromotionsCartsCpqV2.cls
• Implementation: CpqAppliedPromotionsCartsActionV2.cls
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)
Resource Information
Response Format JSON
Resource URL /services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/promotions?
subaction=getPromotionsAppliedToCart
Example Request
GET
/services/apexrest/vlocity_cmt/v2/cpq/carts/801360000000oQ9/promotions
Example Response
{
"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=tru
e"
},
"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 /v2/stringtranslations/{domain}/{local_code}
Remote Method
getDictionary
Package
Communication (vlocity_cmt)
To take advantage of web caching, copy the value of the ETag that is returned in the response header, and
assign this value to If-None-Match in the request header of subsequent requests.
Example Response
{
"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 <description> for P ^ P promotion": "this is <description> for
P ^ P promotion <fr>",
"this is <description> for May & June": "this is <description> 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 /v2/stringtranslations/ID[,ID...]
Remote Action
APIHandler
Remote Method
getStringTranslations
Package
Communication (vlocity_cmt)
Resource Information
Response Format JSON
Resource URL /services/apexrest/{namespace}/v2/stringtranslations
Example Response
{
"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]
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, UserSecurity Class and CPQ and Digital Commerce Changes
for Guest Users.
Remote Method
postCartsPromoItems
REST Handler
APIPromotionsCartsCpqV2
Package
Communication (vlocity_cmt)
Resource Information
Response Format JSON
Resource URL /services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/promotions
Example Request
POST
/services/apexrest/vlocity_cmt/v2/cpq/carts/801f40000012NEIAA2/promotions
BODY:
{
"items": [
{
"itemId": "a2ff4000000Li5eAAC"
}
],
"promotionId": "a2ff4000000Li5eAAC",
"cartId": "801f40000012NEIAA2",
"methodName": "postCartsPromoItems"
}
Example Response
{
"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
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, UserSecurity Class and CPQ and Digital Commerce Changes
for Guest Users.
Remote Method
getCartLineItemPrices
REST Handlers
CpqAppHandler
{
"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)
Resource Information
Example Request
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
{
"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"
}
]
}
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.
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, UserSecurity Class and CPQ and Digital Commerce Changes
for Guest Users.
Remote Method
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
APIItemsCartsCpqV2
}
id = orderLineItem.Id, quoteLineItem.Id, opportunityLineItem.Id
Package
Communication (vlocity_cmt)
Resource Information
Response Format JSON
Resource URI /services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/items/{itemId}
Example Request
DELETE
/services/apexrest/vlocity_cmt/v2/cpq/carts/80141000000Cg8H/items/
80241000000Ha4a
Example Response
{
"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"
}
}
}
}
}
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, UserSecurity Class and CPQ and Digital Commerce Changes
for Guest Users.
Remote Method
priceCart
REST Handler
APIPriceCartsCpqV2
Package
Communication (vlocity_cmt)
Resource Information
Response Format JSON
Resource URL /services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/price
Example Request
POST
/services/apexrest/vlocity_cmt/v2/cpq/carts/80141000000Cg8H/price
Example Response
{
"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",
POST /v2/cpq/carts/{order_ID}/cancel
For CME Winter '20 and later releases, the Cancel button is used to cancel an in-flight order.
For releases prior to CME Winter '20, the Cancel Order button is used to invoke the submitCancelOrder
API, create a supplemental order, and submit the order to Vlocity Order Management.
The submitCancelOrder API uses the Supplemental Order interface implementations that predate the CME
Winter '20 release, including SupplementalOrderService and XOMSupplementalOrderLifeCycle. See In-
Flight Order Cancellation.
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, UserSecurity Class and CPQ and Digital Commerce Changes
for Guest Users.
Apex Method
Use this method with the supplemental order's ID as input (supplementalOrdId) to submit a cancel
order request.
// traverse the result that was returned, to find the supplemental order
id.
vlocity_cmt.JSONResult result = (vlocity_cmt.JSONResult)
outputMap.get('result');
}
Package
Communication (vlocity_cmt)
Resource Information
Response Format JSON
Example Request
POST
/services/apexrest/v2/cpq/carts/{order_ID}/cancel
See Also
• Cancel Order
• Create Supplemental Order
• In-Flight Order Cancellation
Unfreeze Order
Unfreezes a previously frozen order.
POST /v2/cpq/carts/{order_ID}/unfreeze
For CME Winter '20 and later releases, create an unfreeze order request to the order management system.
A Freeze Order API request may have frozen order fulfillment. If the user decides not to submit a
supplemental order, you can use the unfreezeOrder API to unfreeze the order's fulfillment.
If the order management system sends the Accepted response, the OrderStatus__c field is set to In
Progress.
Apex Method
Use this method with the current order's ID as input (currentOrdId) to unfreeze a frozen order fulfillment.
Package
Communication (vlocity_cmt)
Resource Information
Response Format JSON
Resource URL /services/apexrest/{namespace}/v2/cpq/carts/{order_ID}/unfreeze
Example Request
POST
/services/apexrest/v2/cpq/carts/{order_ID}/unfreeze
See Also
• Cancel Order
• Create Supplemental Order
To persist changes after calling this API, you must call the Update Items in Cart API.
PUT /v2/cpq/carts/{cart_ID}/items/{item_ID}/itemAttributes
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, UserSecurity Class and CPQ and Digital Commerce Changes
for Guest Users.
Remote Method
putItemAttributes
Handlers
• REST endpoint: APIItemAttributesItemsCartsCpqV2.cls
• Implementation: CpqModifyAttributeActionV2.cls
Package
Communication (vlocity_cmt)
Resource Information
Response Format JSON
Resource URL /services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/items/{item_ID}/itemAttributes
Example Request
PUT
/services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000iwCx/items/
80236000009E2InAAK/itemAttributes
"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__IsConfigurable__c": true,
"vlocity_cmt__Type__c": "None",
"vlocity_cmt__SubType__c": "None",
"Id": "01t410000032V0sAAE",
"vlocity_cmt__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__Type__c": "None",
"vlocity_cmt__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": [],
Example Response
{
"totalSize": 1,
"messages": [{
"severity": "INFO",
"messageId": null,
"message": "No attributes to be modified.",
"code": "162",
"bundleId": null,
"actions": {}
}],
"records": [{
"messages": [],
"displaySequence": -1,
"Id": {
"value": "80241000006AutkAAC",
"previousValue": null,
"originalValue": null,
"messages": [],
"label": "Order Product ID",
"hidden": false,
"fieldName": "Id",
"editable": false,
"dataType": "ID",
"actions": {}
},
"Product2": {
"attributes": {
"url": "/services/data/v41.0/sobjects/Product2/01t410000032V0sAAE",
"type": "Product2"
},
"Name": "City2City",
"vlocity_cmt__IsConfigurable__c": true,
"vlocity_cmt__Type__c": "None",
"vlocity_cmt__SubType__c": "None",
"Id": "01t410000032V0sAAE",
"vlocity_cmt__JSONAttribute__c": null
},
"PricebookEntry": {
"attributes": {
"url": "/services/data/v41.0/sobjects/PricebookEntry/
01u41000004eEY1AAM",
"type": "PricebookEntry"
},
"Product2Id": "01t410000032V0sAAE",
"Pricebook2Id": "01s41000007liRQAAY",
"Id": "01u41000004eEY1AAM",
"Product2": {
"vlocity_cmt__IsConfigurable__c": true,
"vlocity_cmt__Type__c": "None",
"ProductCode": "City2City",
"Id": "01t410000032V0sAAE",
"Name": "City2City",
"attributes": {
"url": "/services/data/v41.0/sobjects/Product2/01t410000032V0sAAE",
"type": "Product2"
}
},
"value": {
"Product2": {
"Id": "01t410000032V0sAAE",
"Name": "City2City",
"attributes": {
"url": "/services/data/v41.0/sobjects/Product2/01t410000032V0sAAE",
"type": "Product2"
}
},
"Id": "01u41000004eEY1AAM",
"Product2Id": "01t410000032V0sAAE",
"attributes": {
"url": "/services/data/v41.0/sobjects/PricebookEntry/
01u41000004eEY1AAM",
"type": "PricebookEntry"
}
}
},
"PricebookEntryId": {
"value": "01u41000004eEY1AAM",
"previousValue": null,
"originalValue": null,
"messages": [],
"label": "Price Book Entry ID",
"hidden": false,
"fieldName": "PricebookEntryId",
"editable": false,
"dataType": "REFERENCE",
"actions": {}
},
"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"
}]
}
}]
}
}]
}
• Item quantity
• Attribute values for the items
• Any other updatable field on the line item, such as Service Account ID or Billing Account ID
NOTE
Update Line Items in Cart replaces the OmniCPQServiceWrapper updateItem 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, UserSecurity Class and CPQ and Digital Commerce Changes
for Guest Users.
URI
/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/items
HTTP Method
PUT
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
Remote Method
putCartsItems
{
methodName:putCartsItems,
cartId:801360000008eNU,
items:[ {itemJSON} ]
}
In the request, itemJSON is the actual JSONRecord that is being updated. This JSONRecord is provided
by the response to an Add Items to Cart or Get Cart Items API call. Based on that response, update the
record or record attribute.
],
"label": "Order Product ID",
"hidden": false,
"fieldName": "Id",
"editable": false,
"dataType": "ID",
"alternateValues": null,
"actions": {
}
},
"Pricebook2Id": "01s6g000008hmAUAAY",
"Product2Id": "01t6g000003DpXAAA0",
"ProductCode": "Phone1",
"UnitPrice": {
"value": 0,
"previousValue": null,
"originalValue": null,
"messages": [
],
"label": "Unit Price",
"hidden": true,
"fieldName": "UnitPrice",
"editable": false,
"dataType": "CURRENCY",
"alternateValues": null,
"actions": {
}
},
"Name": "Phone1",
"IsActive": true,
"vlocity_cmt__RecurringPrice__c": 0,
"Product2": {
"attributes": {
"type": "Product2",
"url": "/services/data/v48.0/sobjects/Product2/01t6g000003DpXAAA0"
},
"Name": "Phone1",
"vlocity_cmt__IsConfigurable__c": false,
"vlocity_cmt__Type__c": "None",
"vlocity_cmt__SubType__c": "None",
"RecordTypeId": "0126g000001Ktw7AAC",
"Id": "01t6g000003DpXAAA0",
"vlocity_cmt__JSONAttribute__c": null
},
"productId": "01t6g000003DpXAAA0",
"defaultQuantity": 1,
"minQuantity": 0,
"maxQuantity": 2,
"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": 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": "01t6g000003DpXAAA0",
"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/v48.0/sobjects/
Product2/01t6g000003DpXAAA0"
},
"Name": "Phone1",
"Id": "01t6g000003DpXAAA0",
"RecordTypeId": "0126g000001Ktw7AAC"
}
},
"productHierarchyPath": "01t6g000003DpXAAA0",
"name": "Phone1",
"isVirtualItem": false,
"action": "Add",
"hasChildren": false,
"SellingPeriod": "Present",
"itemType": "lineItem",
"PricebookEntryId": {
"value": "01u6g000002qmvOAAQ",
"previousValue": null,
"originalValue": null,
"messages": [
],
"label": "Price Book Entry ID",
"hidden": false,
"fieldName": "PricebookEntryId",
"editable": false,
"dataType": "REFERENCE",
"alternateValues": null,
"actions": {
}
},
"Quantity": {
"value": 2,
"previousValue": null,
"originalValue": null,
"messages": [
],
"label": "Quantity",
"hidden": false,
"fieldName": "Quantity",
"editable": true,
"dataType": "DOUBLE",
"alternateValues": null,
"actions": {
}
},
"vlocity_cmt__OneTimeTotal__c": {
"value": 0,
"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__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__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__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__BillingAccountId__c": {
"value": "0016g00000NXwrqAAD",
"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": null,
"link": null
},
"remote": {
"params": {
"methodName": "getAvailableSites",
"lookupField": "vlocity_cmt__billingaccountid__c",
"id": "8026g000001e9vVAAQ",
"cartId": "8016g000001EYYfAAO"
}
},
"client": {
"records": [
],
"params": {
}
}
}
}
},
"vlocity_cmt__ServiceAccountId__c": {
"value": "0016g00000NXwrqAAD",
"previousValue": null,
"originalValue": null,
"messages": [
],
"label": "Service Account",
"hidden": false,
"fieldName": "vlocity_cmt__ServiceAccountId__c",
"editable": true,
"dataType": "REFERENCE",
"alternateValues": null,
"actions": {
"availablesites": {
"rest": {
"params": {
},
"method": null,
"link": null
},
"remote": {
"params": {
"methodName": "getAvailableSites",
"lookupField": "vlocity_cmt__serviceaccountid__c",
"id": "8026g000001e9vVAAQ",
"cartId": "8016g000001EYYfAAO"
}
},
"client": {
"records": [
],
"params": {
}
}
}
}
},
"vlocity_cmt__ProductHierarchyPath__c": {
"value": "01t6g000003DpXAAA0",
"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__LineNumber__c": {
"value": "0001",
"previousValue": null,
"originalValue": null,
"messages": [
],
"label": "LineNumber",
"hidden": true,
"fieldName": "vlocity_cmt__LineNumber__c",
"editable": false,
"dataType": "STRING",
"alternateValues": null,
"actions": {
}
},
"vlocity_cmt__RootItemId__c": {
"value": "6710c5b9-d9ed-c47b-cf50-37e69ac42664",
"previousValue": null,
"originalValue": null,
"messages": [
],
"label": "RootItemId",
"hidden": true,
"fieldName": "vlocity_cmt__RootItemId__c",
"editable": false,
"dataType": "STRING",
"alternateValues": null,
"actions": {
}
},
"vlocity_cmt__Product2Id__c": {
"value": "01t6g000003DpXAAA0",
"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": null,
"link": null
},
"remote": {
"params": {
"methodName": "getAvailableSites",
"lookupField": "vlocity_cmt__product2id__c",
"id": "8026g000001e9vVAAQ",
"cartId": "8016g000001EYYfAAO"
}
},
"client": {
"records": [
],
"params": {
}
}
}
}
},
"ListPrice": {
"value": 0,
"previousValue": null,
"originalValue": null,
"messages": [
],
"label": "List Price",
"hidden": true,
"fieldName": "ListPrice",
"editable": false,
"dataType": "CURRENCY",
"alternateValues": null,
"actions": {
}
},
"vlocity_cmt__OneTimeCharge__c": {
"value": 0,
"previousValue": null,
"originalValue": null,
"messages": [
],
"label": "One Time Charge",
"hidden": true,
"fieldName": "vlocity_cmt__OneTimeCharge__c",
"editable": false,
"dataType": "CURRENCY",
"alternateValues": {
},
"actions": {
}
},
"vlocity_cmt__OneTimeCalculatedPrice__c": {
"value": 0,
"previousValue": null,
"originalValue": null,
"messages": [
],
"label": "One Time Calculated Price",
"hidden": true,
"fieldName": "vlocity_cmt__OneTimeCalculatedPrice__c",
"editable": false,
"dataType": "CURRENCY",
"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": {
}
},
"vlocity_cmt__RecurringCharge__c": {
"value": 0,
"previousValue": null,
"originalValue": null,
"messages": [
],
"label": "Recurring Charge",
"hidden": true,
"fieldName": "vlocity_cmt__RecurringCharge__c",
"editable": false,
"dataType": "CURRENCY",
"alternateValues": null,
"actions": {
}
},
"vlocity_cmt__RecurringCalculatedPrice__c": {
"value": 0,
"previousValue": null,
"originalValue": null,
"messages": [
],
"label": "Recurring Calculated Price",
"hidden": true,
"fieldName": "vlocity_cmt__RecurringCalculatedPrice__c",
"editable": false,
"dataType": "CURRENCY",
"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": {
}
},
"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,
"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,
"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__AssetReferenceId__c": {
"value": "6710c5b9-d9ed-c47b-cf50-37e69ac42664",
"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__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": {
}
},
"OrderId": {
"value": "8016g000001EYYfAAO",
"previousValue": null,
"originalValue": null,
"messages": [
],
"label": "Order ID",
"hidden": false,
"fieldName": "OrderId",
"editable": false,
"dataType": "REFERENCE",
"alternateValues": null,
"actions": {
}
},
"PricebookEntry": {
"attributes": {
"type": "PricebookEntry",
"url": "/services/data/v48.0/sobjects/PricebookEntry/
01u6g000002qmvOAAQ"
},
"Product2Id": "01t6g000003DpXAAA0",
"Pricebook2Id": "01s6g000008hmAUAAY",
"Id": "01u6g000002qmvOAAQ",
"Product2": {
"attributes": {
"type": "Product2",
"url": "/services/data/v48.0/sobjects/
Product2/01t6g000003DpXAAA0"
},
"Name": "Phone1",
"Id": "01t6g000003DpXAAA0",
"ProductCode": "Phone1",
"vlocity_cmt__Type__c": "None",
"vlocity_cmt__IsConfigurable__c": false,
"RecordTypeId": "0126g000001Ktw7AAC"
}
},
"vlocity_cmt__ServiceAccountId__r": {
"attributes": {
"type": "Account",
"url": "/services/data/v48.0/sobjects/Account/0016g00000NXwrqAAD"
},
"Name": "StarTelco",
"Id": "0016g00000NXwrqAAD",
"RecordTypeId": "0126g000001KtvLAAS"
},
"vlocity_cmt__BillingAccountId__r": {
"attributes": {
"type": "Account",
"url": "/services/data/v48.0/sobjects/Account/0016g00000NXwrqAAD"
},
"Name": "StarTelco",
"Id": "0016g00000NXwrqAAD",
"RecordTypeId": "0126g000001KtvLAAS"
},
"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__InCartQuantityMap__c": {
"value": null,
"previousValue": null,
"originalValue": null,
"messages": [
],
"label": "InCartQuantityMap",
"hidden": true,
"fieldName": "vlocity_cmt__InCartQuantityMap__c",
"editable": false,
"dataType": "TEXTAREA",
"alternateValues": null,
"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",
"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__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": {
}
},
"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__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__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__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": {
}
},
"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__SupersededOrderItemId__c": {
"value": null,
"previousValue": null,
"originalValue": null,
"messages": [
],
},
"method": null,
"link": null
},
"remote": {
"params": {
"methodName": "getAvailableSites",
"lookupField": "vlocity_cmt__supersededorderitemid__c",
"id": "8026g000001e9vVAAQ",
"cartId": "8016g000001EYYfAAO"
}
},
"client": {
"records": [
],
"params": {
}
}
}
}
},
"vlocity_cmt__FirstVersionOrderItemId__c": {
"value": null,
"previousValue": null,
"originalValue": null,
"messages": [
],
"label": "First Order Product Version",
"hidden": false,
"fieldName": "vlocity_cmt__FirstVersionOrderItemId__c",
"editable": true,
"dataType": "REFERENCE",
"alternateValues": null,
"actions": {
"availablesites": {
"rest": {
"params": {
},
"method": null,
"link": null
},
"remote": {
"params": {
"methodName": "getAvailableSites",
"lookupField": "vlocity_cmt__firstversionorderitemid__c",
"id": "8026g000001e9vVAAQ",
"cartId": "8016g000001EYYfAAO"
}
},
"client": {
"records": [
],
"params": {
}
}
}
}
},
"vlocity_cmt__FulfilmentStatus__c": {
"value": null,
"previousValue": null,
"originalValue": null,
"messages": [
],
"label": "Fulfilment Status",
"hidden": false,
"fieldName": "vlocity_cmt__FulfilmentStatus__c",
"editable": true,
"dataType": "PICKLIST",
"alternateValues": null,
"actions": {
}
},
"productCategories": {
"totalSize": 0,
"messages": [
]
},
"vlocity_cmt__UsageQuantity__c": {
"value": 1
},
"vlocity_cmt__EffectiveQuantity__c": {
"value": 1
},
"fieldValidationMessageList": [
],
"processingLine": true
}
]
},
"filters": null,
"fields": null,
"cartId": "8016g000001EYYfAAO",
"price": true,
"validate": true,
"includeAttachment": false,
"pagesize": 10,
"lastRecordId": null,
"hierarchy": -1,
"query": null
}
REST Handler
APIItemsCartsCpqV2
{
methodName:putCartsItems,
cartId:801360000008eNU,
items:[ {itemJSON} ]
}
In the request, itemJSON is the actual JSONRecord that is being updated. This JSONRecord is provided
by the response to an Add Items to Cart or Get Cart Items API call. Based on that response, update the
record or record attribute.
Example Response
{
"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": "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": 20,
"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": 20,
"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": 20,
"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=20&includeAttachment=false&validate=true&price=true"
},
"remote": {
"params": {
"price": true,
"validate": true,
"filters": null,
"includeAttachment": false,
"pagesize": 20,
"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,
"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,
"minQuantity": 0,
"maxQuantity": 99999,
"groupMinQuantity": 0,
"groupMaxQuantity": 99999,
"sequenceNumber": 1,
"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,
"itemType": "lineItem",
"PricebookEntryId": {
"value": "01u41000001QPtsAAG",
"messages": [],
"label": "Price Book Entry ID",
"hidden": false,
"fieldName": "PricebookEntryId",
"editable": false,
"dataType": "REFERENCE",
"actions": {}
},
"Quantity": {
"value": 1,
"messages": [],
"label": "Quantity",
"hidden": false,
"fieldName": "Quantity",
"editable": true,
"dataType": "DOUBLE",
"actions": {}
},
"vlocity_cmt__OneTimeTotal__c": {
"value": 1,
"messages": [],
"label": "One Time Total",
"hidden": false,
"fieldName": "vlocity_cmt__OneTimeTotal__c",
"editable": false,
"dataType": "CURRENCY",
"actions": {}
},
"vlocity_cmt__RecurringTotal__c": {
"value": 0,
"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": [],
},
"vlocity_cmt__OneTimeCalculatedPrice__c": {
"value": 1,
"messages": [],
"label": "One Time Calculated Price",
"hidden": false,
"fieldName": "vlocity_cmt__OneTimeCalculatedPrice__c",
"editable": true,
"dataType": "CURRENCY",
"actions": {}
},
"vlocity_cmt__OneTimeManualDiscount__c": {
"value": 0,
"messages": [],
"label": "One Time Manual Discount",
"hidden": false,
"fieldName": "vlocity_cmt__OneTimeManualDiscount__c",
"editable": true,
"dataType": "PERCENT",
"actions": {}
},
"vlocity_cmt__RecurringCharge__c": {
"value": 0,
"messages": [],
"label": "Recurring Charge",
"hidden": false,
"fieldName": "vlocity_cmt__RecurringCharge__c",
"editable": false,
"dataType": "CURRENCY",
"actions": {}
},
"vlocity_cmt__RecurringCalculatedPrice__c": {
"value": 0,
"messages": [],
"label": "Recurring Calculated Price",
"hidden": false,
"fieldName": "vlocity_cmt__RecurringCalculatedPrice__c",
"editable": true,
"dataType": "CURRENCY",
"actions": {}
},
"vlocity_cmt__RecurringManualDiscount__c": {
"value": 0,
"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
• Add Items to Cart
• Get Cart Items
PUT /v2/stringtranslations/
Remote Parameters
[
{
"Id": "",
"vlocity_cmt__Translation__c": "",
"vlocity_cmt__StringId__c": "",
"vlocity_cmt__LocaleCode__c": ""
},
{
"Id": "",
"vlocity_cmt__Translation__c": "",
"vlocity_cmt__StringId__c": "",
"vlocity_cmt__LocaleCode__c": ""
}
]
Remote Method
updateStringTranslations
Package
Communication (vlocity_cmt)
Example Response
{
"totalSize": 0,
"messages": [{
"code": "904",
"severity": "INFO",
"message": "Updated successfully."
}]
}
POST /v2/cpq/carts/{cart_ID}/validate
Vlocity provides multiple implementations for product validation and pricing interfaces. The product
validation implementation will typically run the configuration rules and the pricing implementations will run
the pricing rules.
Remote Method
runCartValidation
REST Handler
validate
vlocity_cmt.CardCanvasController
Method:
"validate": true
}
String options: {
"vlcClass": "vlocity_cmt.CpqAppHandler"
}
Package
Communication (vlocity_cmt)
Resource Information
Response Format JSON
Resource URL /v2/cpq/carts/{cart_ID}/validate
Example: /services/apexrest/vlocity_cmt/v2/cpq/carts/801360000000oQ9/validate
Example Request
{
"cartId": "8011N00000157LkQAI",
"methodName": "runCartValidation",
"price": true,
"validate": true
}
Example Response
{
"totalSize": 0,
"messages": [],
"actions": {
"itemadded": {
"rest": {
"params": {},
"method": null,
"link": null
},
"remote": {
"params": {}
},
"client": {
"params": {
"items": [
{
"message": "Product Hier 6 Child 3 has been auto-added to the
cart.",
"Id": "8021N000006wtUCQAY"
}
]
},
"records": [
{
"messages": [],
"actions": {
"addtocart": {
"rest": {
"params": {
"items": [
{
"quantity": 1,
"parentId": "8021N000006wtU7QAI",
"itemId": "01u1N00000C1WAlQAN"
}
],
"cartId": "8011N00000157LkQAI",
"price": true,
"validate": true,
"includeAttachment": false,
"pagesize": 20,
"lastRecordId": null,
"query": null
},
"method": "POST",
"link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/
8011N00000157LkQAI/items"
},
"remote": {
"params": {
"methodName": "postCartsItems",
"items": [
{
"quantity": 1,
"parentId": "8021N000006wtU7QAI",
"itemId": "01u1N00000C1WAlQAN"
}
],
"cartId": "8011N00000157LkQAI",
"price": true,
"validate": true,
"includeAttachment": false,
"pagesize": 20,
"lastRecordId": null,
"query": null
}
},
"client": {
"params": {}
}
},
"updateitems": {
"rest": {
"params": {
"items": [
{
"itemId": "8021N000006wtU7QAI"
}
],
"filters": null,
"fields": null,
"cartId": "8011N00000157LkQAI",
"price": true,
"validate": true,
"includeAttachment": false,
"pagesize": 20,
"lastRecordId": null,
"query": null
},
"method": "PUT",
"link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/
8011N00000157LkQAI/items"
},
"remote": {
"params": {
"methodName": "putCartsItems",
"items": [
{
"itemId": "8021N000006wtU7QAI"
}
],
"filters": null,
"fields": null,
"cartId": "8011N00000157LkQAI",
"price": true,
"validate": true,
"includeAttachment": false,
"pagesize": 20,
"lastRecordId": null,
"query": null
}
},
"client": {
"params": {}
}
},
...
[EXAMPLE TRUNCATED FOR BREVITY]
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:
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
Working with Implementations
Adding a New Interface Implementation
For information about custom settings, see:
Vlocity Triggers
3. Make the interface implementation active. For information, see:
Working with Implementations
Vlocity Communications, Media, and Energy and Energy & Utilities Cloud use the CpqAppHandler hook
interface.
See Also
• Adding Pre- and Post-Processing Logic
• Pre- and Post-Processing Logic for CPQ APIs
• Pricing Variable Calculation Hook
Uses of CpqAppHandlerHook
In Vlocity CPQ, CPQ functionality is managed by a global interface called CpqAppHandler. It includes a
wide range of methods to perform CPQ processes in Vlocity Cart. (These methods are also available as a
RESTful API, called the Vlocity Cart-based APIs.) So, when you need to change the default behavior or
processing of a CPQ operation, you create a custom implementation in the CpqAppHandler hook
interface, which is appropriately named CpqAppHandlerHook.
About Hooks
In software development, hooking is a concept that allows you to modify the original behavior of the
application without changing your code. By intercepting the commands, you can change the action that
would have been performed originally. It is very useful in the case of adding new functionality to
applications, exposing additional fields in pricing calculations or altering how products are priced, to name a
few of its applications.
Vlocity CPQ allows you to write custom Pre-invoke and Post-invoke hooks for each interface to implement
custom logic. Pre-invoke hooks get executed before the actual interface is executed whereas Post-invoke
hooks get executed after the actual interface is executed.
• Conditional processing.
• Preload information that will be used further down the execution chain.
• Process custom fields.
• Implement custom functionality.
• Do callouts.
The graphic below provides an example of the sequence when using a CpqAppHandlerHook.
• Validate that a feature doesn’t already exist that addresses your need for a hook.
• Ensure the custom code in the hook does not cause the execution to exceed any Apex governor limits.
• Put a try-catch around the hook code to catch any exceptions thrown by the custom code.
• When unit testing the hook code, it may be possible to mock the inputs expected by the hook code to
minimize test setup and get better code coverage. Use Test.isRunningTest() to extract the mock
input from the inputMap or from a static map.
Users must not be allowed to order the same product more than once on the same order. And, check to
see if the product exists as an active asset on the account.
Implement a CpqAppHandlerHook to check before postCartsItems logic runs to see if the product exists in
other active line items or active assets.
In the Preinvoke hook, if the product exists in active line items or assets, null the items and create a new
node that will be checked in the post-hook. In the Postinvoke hook, if the new node exists display an error
in the UI. When the user tries to add a duplicate product, they will get an error in the cart.
Let’s take a look at another example. Consider how pricing works in Vlocity Cart. You add an iPhone X to
the cart. It displays a one-time charge of $1000. That’s all good, but as a customer I want to know the total
price of the iPhone X, which includes the sales tax cost. How can I display the cost of the iPhone X plus
applicable taxes in the one-time charge column in Vlocity Cart? You would do this by implementing a
pricing hook to alter how the pricing is calculated. Instead of calculating Quantity*Price and displaying the
price in the One Time Charge column, you would create a pricing hook to calculate the One Time Charge
as Quantity*Price*Sales Tax Rate. What if I didn’t want to include the sales tax in the one-time charge
column, but rather wanted to display it as a separate column? No problem, you can modify the cart to
display a custom field for the applicable sales tax.
In the main example, we will price products using the account’s zip code. This would allow you to vary
pricing for each line item based on the customer’s location, such as the billing or shipping location. To do
this, we must add a custom field to store the zip code on each order line item, and then use attribute-based
pricing to calculate the price for each zip code. However, the pricing service has no idea that this new field
exists. So, we also must use a pricing hook to alert the pricing service to the existence of this new field and
ensure that it is passed in the input map to attribute-based pricing. Then, as the icing on the cake, we’ll also
expose the custom field (Billing Zip Code) in Vlocity Cart, so the user can see the values that affect the
price of the line item.
What's Next
See Create an Attribute Pricing Matrix for the Billing Zip Code.
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.
What's Next
See Create an Attribute Pricing Procedure for the Billing Zip Code.
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
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.
What's Next
See Create a Custom Pricing Plan Step for the Billing Zip Code.
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.
2. Next to Pricing Plan in the Pricing area, click the search icon .
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)
What's Next
See Create a New Apex Class.
What's Next
See Create the CpqAppHandlerHookImplementation.
NOTE
The maximum length for a hook interface name is 36 characters.
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.
What's Next
See Add a New Column to Vlocity 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.
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.
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.
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.
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.
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.
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 <<Custom Field>> and click Add.
23. Delete <<Custom Field>> 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.
What's Next
See Add the Billing Zip Code as a Custom Field in Vlocity 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.
5. Click New.
6. Enter the following for the new Field Setting:
7. Click Save.
8. Close the Setup browser tab.
What's Next
See Test in Vlocity Cart.
6. In the One Time Charge column, click on the charge and select the Price Details icon.
7. Notice that the price returned is from the BillingZipCodeAttributePricingProcedure based on the data
entered in the matrix.
8. Click Close.
9. Navigate to the Accounts tab and open link in new tab.
10. Change the List Views to All Accounts.
11. Click Acme.
12. Click on the Details tab.
13. Note the Billing Address zip code.
14. Close the Accounts tab.
15. Notice the new Billing Zip Code column in the cart and the billing zip code returned for Acme.
IMPORTANT
The custom field value can’t be null. If null, it will not be read and will not display.
What's Next
If testing didn't work as expected, see CpqAppHandlerHook Troubleshooting Guide.
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:
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
• Verify all data input is spelled correctly and has proper spacing
• Step is active
• 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