The Salesforce Developers website will undergo maintenance on May 29, 2024 from 3:00 a.m. UTC to 10:00 a.m. UTC. The maintenance process may affect the availability of our documentation. Please plan accordingly.

Configuration Required for Digital Commerce

For the Digital Commerce APIs to function properly, you must configure the basic elements in this section, which include EPC, cache, and the connected app.

  1. EPC Configuration and Catalog Configuration:

    You must set up a product catalog and ensure that it is set up correctly for the Digital Commerce APIs. For example, products should have Product Code populated, and price list entries should exist for all products that are attached to the catalog. See Digital Commerce API Usage Considerations for more information.

  2. Cache Configuration:

    The Digital Commerce API cache stores catalog data for quicker retrieval of information from API calls. Digital Commerce cache management provides the ability to update or recreate the cache, for either on-platform or off-platform solution architectures.

    To configure the Digital Commerce API cache:

    1. Run the Maintenance jobs as required:

      • Clear Managed Platform Cache

      • Product Hierarchy Maintenance

      • Refresh Platform Cache (Full)

      See Digital Commerce Cache Management for more information.

    2. 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];
      
  3. Configure the Connected App:

    To call the Digital Commerce APIs from Postman, you must first deploy a connected app in your org. The connected app handles security (OAuth in this case) and permits access to org data from external APIs. If your API calls return authorization errors, ensure the IP restrictions of the app are set correctly (Full Access).

    To configure the connected app:

    1. In your org, go to App Setup > Create > Apps, then under Connected Apps, click New.

    2. Fill in a Connected App Name, API Name, and Contact email, then click Save.

    3. Under API (Enable OAuth Settings) select Enable OAuth Settings.

    4. Under Selected OAuth scope, specify Full Access.

    5. Under Callback URL, enter the following:

      Your screen should resemble the following illustration:

      Connected App Name - Postman

    6. Click Save.

      The following message displays:

    7. When the app has been deployed, copy the Consumer Key and Secret into the environment configuration in Postman.

  4. Download and Configure the Postman Environment:

    Update the environment configuration with your details. Follow the steps below to download a Postman configuration file that contains the necessary variables for you to run the APIs:

    1. Download the environment file here.

    2. Start Postman and select the Manage Environments icon in the upper-right corner of the Postman screen.

    3. Click Import and select the environment file you downloaded in step 4.1.

    4. Configure your environment with the following values:

      Postman environment settings

      Key

      Value

      URL

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

      baseUrl

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

      For example:

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

      username

      Your org username

      password

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

      clientId

      The Connected app client ID.

      clientSecret

      The Connected app Secret.

  5. Download and Install the Postman Collection:

    The file is a Postman collection that contains variables and configuration settings to make calling the Digital Commerce APIs quickly and easily.

    1. Download the Postman collection file here.

    2. Start Postman (if necessary) and click Import.

    3. Drag and drop the Postman collection you downloaded in step 5.1.

  6. Configure Amazon Web Services (AWS) (Optional):

    Use the information in this section if you are using an AWS off-platform solution.

    AWS configuration is simple; just populate the template with the baseUrl and InitAccessToken (Salesforce Customer Support will provide these items upon provisioning an instance for your customer). Make sure that /dc is at the end of the URL.

    All API requests are designed to work with both AWS and SFDC; simply change the environment in the dropdown and issue the API call.

    AWS off-platform Environment Name