Configuration Required for Digital Commerce
For the Digital Commerce APIs to function properly, you must configure the basic elements in this section, which include EPC, cache, and the connected app.
-
EPC Configuration and Catalog Configuration:
You must set up a product catalog and ensure that it is set up correctly for the Digital Commerce APIs. For example, products should have Product Code populated, and price list entries should exist for all products that are attached to the catalog. See Digital Commerce API Usage Considerations for more information.
-
Cache Configuration:
The Digital Commerce API cache stores catalog data for quicker retrieval of information from API calls. Digital Commerce cache management provides the ability to update or recreate the cache, for either on-platform or off-platform solution architectures.
To configure the Digital Commerce API cache:
-
Run the Maintenance jobs as required:
-
Clear Managed Platform Cache
-
Product Hierarchy Maintenance
-
Refresh Platform Cache (Full)
See Digital Commerce Cache Management for more information.
-
-
Go to Vlocity CMT Administration > Populate API Cache, click Start and run the Cacheable API Jobs.
If your project does not use the Get Contains Offers API (which searches for all parent products and offers having the requested product as a child), then running related batch jobs may be skipped to save time and data storage.
A Cache Management feature was introduced in the Winter ’20 release; any prior release requires manual deletion of cached records before job execution. To manually delete cached records, open the Developer Console and select and paste the following command:Debug > Open Execute Anonymous Window
delete [select Id from vlocity_cmt__CachedAPIResponse__c];
-
-
Configure the Connected App:
To call the Digital Commerce APIs from Postman, you must first deploy a connected app in your org. The connected app handles security (OAuth in this case) and permits access to org data from external APIs. If your API calls return authorization errors, ensure the IP restrictions of the app are set correctly (Full Access).
To configure the connected app:
-
In your org, go to App Setup > Create > Apps, then under Connected Apps, click New.
-
Fill in a Connected App Name, API Name, and Contact email, then click Save.
-
Under API (Enable OAuth Settings) select Enable OAuth Settings.
-
Under Selected OAuth scope, specify Full Access.
-
Under Callback URL, enter the following:
Your screen should resemble the following illustration:
-
Click Save.
The following message displays:
-
When the app has been deployed, copy the Consumer Key and Secret into the environment configuration in Postman.
-
-
Download and Configure the Postman Environment:
Update the environment configuration with your details. Follow the steps below to download a Postman configuration file that contains the necessary variables for you to run the APIs:
-
Download the environment file here.
-
Start Postman and select the Manage Environments icon in the upper-right corner of the Postman screen.
-
Click Import and select the environment file you downloaded in step 4.1.
-
Configure your environment with the following values:
Postman environment settingsKey
Value
URL
https
://login.salesforce.com or https ://test.salesforce.com depending on the type of the org used. baseUrl
Your org name with at the end /services/apexrest/vlocity_cmt
For example:
https
://demo.my.salesforce.com/services/apexrest/vlocity_cmt username
Your org username
password
Your org password. Avoid using the "&" character in the password; Postman does not process it correctly.
clientId
The Connected app client ID.
clientSecret
The Connected app Secret.
-
-
Download and Install the Postman Collection:
The file is a Postman collection that contains variables and configuration settings to make calling the Digital Commerce APIs quickly and easily.
-
Download the Postman collection file here.
-
Start Postman (if necessary) and click Import.
-
Drag and drop the Postman collection you downloaded in step 5.1.
-
-
Configure Amazon Web Services (AWS) (Optional):
Use the information in this section if you are using an AWS off-platform solution.
AWS configuration is simple; just populate the template with the baseUrl and InitAccessToken (Salesforce Customer Support will provide these items upon provisioning an instance for your customer). Make sure that /dc is at the end of the URL.
All API requests are designed to work with both AWS and SFDC; simply change the environment in the dropdown and issue the API call.