Default constructor. Alwyas use getInstance() instead of default contructor to get an instance of the SDK.
DigitalCommerceSDK Config to initialize this SDK.
This is the account Id once user login in.
Identifier of cart if it exists. This will be populated after addToCart() is called.
This is addToBasket response.
The UserContext used for this SDK.
The offer code of the offer that is being configured at the moment.
The datasource connection used by this SDK.
Anonymous Cart. This is used only for anonymous users.
Map of offers that has been selected for configuration. This map stores the state of the configured offers.
Private singleton instance of this SDK. There should always be only 1 instance.
getter method for anonymous config url.
set custom anonymous config url
getter method for namespace. Provides the salesforce org namespace
setter method for namespace. Set custom namespace
Create a default CheckoutCartInput object.
Create a default GetItemsInCartInput object.
Cache the selected offer in memory so that user can retrieve it at later point of time for configuration and add to cart. The selected offer JSON and its offer code will be cached by SDK.
Save an offer to the Basket.
Creates an actual cart as per items user has configured in the basket.
API PATH: /v3/carts
Create a default AddToCartInput object.
Create a default GetItemsInCartInput object.
Create a default GetOfferInput object.
Create a default createGetOffersInput object.
Create a default ValidateOfferInput object.
ValidateOfferInput default ValidateOfferInput.
Create a default GetItemsInCartInput object.
Delete a selected offer from SDK cache. If the offer exists, it will be deleted from SDK cache. Otherwise, it will do nothing.
to be deleted.
Find the selected offer array index for the given offer code.
to find the selected offer.
the index of the offer if existed. Otherwise, returns -1.
Get all the selected offer from SDK cache.
Promise with all selected offerConfigurations.
Get the most recent selected offer from SDK cache.
Promise with offerConfiguration.
Get the basket details.
Returns offer and its details.
Returns a list of offers.
Returns the offer for given code that are being configured. Undefined if offer not exists.
offer code of the selected offer in memory to be retrieved.
Returns a list of catalog offers.
Invoke an action returning from previous API call.
Method to parse cart response
Method to parse offer response
Method to parse offers response
Contains the list of offerConfigurations to be updated in cart.
Validate an offer. After configuring the offer by setting attributes' values, adding/removing child product, updating quantity, developer can call this function to validate the offer.
a Promise with validated offer JSON.
Returns the version number of SDK.
Returns SDK version number as string
Create a DigitalCommerceSDKConfig object that consists of a UserContext and a DataSourceService for anonymous user.
Configuration object to instantiate SDK.
Create a DigitalCommerceSDKConfig object that consists of a UserContext and a DataSourceService for login user.
Configuration object to instantiate SDK.
Adds all the enumerable string keyed function properties of a source
object to the sdk prototype.
.extend should only be used to add new methods and it won't override the existing methods.
Note: If the property already exists, it will be not be added.
Custom functions which are being extended should have proper namespaces to avoid issues during upgrades. When Vlocity releases new changes it won't impact if unique namespaces are used.
Example: myCompanyOrFeatureMethodName
The object of functions
Get a singleton instance of this SDK.
SDK instance.
Adds all the enumerable string keyed function properties of a source object to the sdk prototype.
.override method should only be used to override the existing methods and should only be used in rare cases.
Overriding the existing or default methods may cause unintended consequences and may also impact during upgrades.
Please be cautious while using this
The object of functions
Generated using TypeDoc
Digital Commerce Facade to interact with Vlocity Digital Commercee functionality.
The Digital Commerce SDK is a JavaScript library that abstracts and simplifies the use of Digital Commerce API REST calls.
The SDK provides error checking and validates parameters before submitting them to the Digital Commerce APIs, ensuring that calls to the APIs are well formatted and complete. In some cases, the SDK invokes more than one API to complete a request.
Using the SDK ensures that errors are detected before API calls are made, ensuring that Vlocity data structure rules are enforced and that data is not written incorrectly to the Vlocity cart or to the product database.Using the SDK reduces UI development efforts by consolidating common application and business logic to use the Digital Commerce APIs.
SDK can be shared by different applicationsuser interfaces. SDK, like any Vlocity SDK, can be extended and overrided to customized implementations.
104.0.0