About Us

Are you looking for Salesforce Consulting Services? As Salesforce Implementation Partner, We provide services of · Salesforce Communities Cloud · Marketing Cloud · Idea to AppExchange Listing · APIs and Integrations · Gorgeous UX · Solution/Security/AppExchange Review · Salesforce Custom Development · Salesforce Mobile Solutions, And so much more!!

Working Hours

🕒 Monday to Friday: 9 AM – 10 PM IST


Salesforce Commerce + Marketing Cloud Integration

The retail world is changing, and changing fast. How strongly and successfully your brand is transforming in this evolving landscape and connecting with your customer — It starts with e-commerce integration.

Adapting to today’s buyer expectations. They want the ease of ‘buy anywhere, fulfill anywhere ” buying experiences — anytime, anywhere, through any medium on any device. Modern buyers want an effective interaction with your brand on any channel, and they expect your brand to engage with them as easily as they move across their preferred channels — mobile, social, online, or in-person. To provide this sort of customer experience, your e-commerce system needed to connect with marketing, inventory management, fulfillment, and back-end accounting systems.

Most of the legacy commerce platforms can not manage this type of e-commerce integration because their conventional systems were not designed for retail online integration, neither can they keep up with the pace of innovation that you require right now.

And because of that, when choosing omnichannel solutions that make eCommerce integration and innovation easy, many retailers today are in search of the right solution you don’t need to go so far as you’re at the right place. We provide services related to the Salesforce commerce cloud and also help customers to resolve their complex business processes in a simple and most efficient way.


Here we are implementing the SFMC (Salesforce Marketing Cloud) API integration to SFCC (Salesforce Commerce Cloud) with the help of web services which is recommended by the SFCC to manage the API authentication, endpoints, timeout circuit breaker, and credentials. So we will be using the Marketing cloud API credentials and services from SFCC to handle the integration.


We are assuming that the readers have the basic knowledge of Salesforce Marketing Cloud API creating and working process and Salesforce Commerce Cloud Business Manager key words.

Trails to learn about Marketing Cloud API

  1. Introduction to Marketing Cloud API’s
  2. To get API credentials for Marketing Cloud
  3. Marketing Cloud API’s trailhead

Trails to learn about Commerce Cloud

  1. Introduction to Commerce Cloud
  2. Commerce Cloud Basic Trailhead
  3. Development with Commerce Cloud

Steps: Create API Credentials in Marketing Cloud

Step 1: Login to Marketing Cloud with Admin permissions.

Step 2: Click on your username and select Administrator.

Step 3: In the Account tab, click new on ‘Installed package’ and create your app which will provide you the API details.

Administration > Account

Step 4 : Restrict/Allow the permission for the app you built as per your requirement.

Administration > Account > Edit API Integration

For more details you can follow this video guide.

Steps: Create Service in Commerce Cloud

Step 1: Login to your account manager with admin permissions.

Step 2: Go to the Administrator tab and select services.

Step 3: First create service credentials & service profile.

Step 4: After creating credentials and profile, create configuration.

All Required steps to create services:

Step: Create Service Credentials

Firstly we need to create credentials in services as we need to fill the API and secret key and authentication method in it.

Follow these steps for it.

  1. Select Administration > Operations > Services.
  2. On the Services webpage, click the Credentials button.
  3. On the Service Credentials, click on ‘New’.
  4. On the New Service Credential page, insert a full name in which it can’t contain spaces. but do not include user or password information. For example: http.mysite.myservice.cred.
  5. Enter the URL in the service, following the protocol. For example, To use 1 service configuration for many URIs, you can extend this URL by getURL callback in the service registry.
  6. Enter the user name in the credential space.
  7. Enter the password, then it will be hidden after you type it and can’t retrieve from the Business Manager, so be certain to save it securely somewhere else.

For more details visit here.

Step 2 : Create Service Profile

  1. Select Administration > Operations > Services.
  2. On the Services webpage, click on the ‘Profiles’ tab.
  3. On the Service Profiles, click on ‘New’.
  4. On the New Service Profile, enter a full name for the profile.
  5. Enter the number of milliseconds for the customer connection timeout. B2C Commerce waits for this number of milliseconds for a response from the web service before firing an error.
  1. Check the Enable Circuit Breaker box if you want to enable the circuit breaker to identify when a service is unavailable and stop making calls to the web service. (We recommend that you always enable the circuit breaker and configure it according to the service call rate.)
  1. Enter the number of calls that fail to trigger the circuit breaker in the Max Circuit Breaker Calls field.
  2. Enter the number of milliseconds in which the maximum number of calls fail into the Circuit Breaker Interval (ms) field.
  3. Mark the Enable Rate Limit box if you would like to narrow the number of outgoing calls in a definite interval.
  4. Enter the maximum number of calls that B2C Commerce executes for the rate limit interval in the Max Rate Limit Calls field.
  5. Enter the number of milliseconds in which B2C Commerce can execute the maximum number of calls to the web service in the Rate Limit Interval (ms) field.

For more details visit here.

Step 3 : Create Service 

  1. Select Administration > Operations > Services.
  2. On the Services webpage, click on ‘New’.
  3. On the New Service page, insert a name for the service.
    We recommend the naming pattern cartridge.protocol.service.operation.
    For example: mycartridge.http.payment.get or mycartridge.ftp.partner.getPriceList.
    If service names include periods in them, the period-delimited name segments become part of the logging hierarchy. Including the cartridge in the name is beneficial when you have various web service integrations because it groups logging info and assures unique service names.
  4. Select the service type to utilize for your web service. The type defines the underlying class used to call your web service and attaches methods to the methods inherited from the Service class.
  5. If the web service is available and you need to make calls to it, select the ‘Enabled’ button. It isn’t enabled by default.
  6. In the Service Mode rundown, to create calls to a live web service, select the ‘Live’ button. To use the mocked call configured in your service registry to simulate the expected response from the web service, select the ‘Mocked’.
  7. Enter the name of a prefix for the log file in this service. If you do not enter a prefix, the log name will default to the main. Each log is written in the shared log directory to a file named service-prefix-internalID-date.log. If you don’t enter a prefix, the file is named service-main-serviceID-date.
  8. If you require data in the request and response of the web service call to be logged, select ‘Communication Log’ Enabled.
    If you enable the communications log, Salesforce actively recommends adopting the log filtering callback methods to erase sensitive data from the log messages.
  9. If you would like to prevent unfiltered communication logs from being written on non-production instances, select ‘Force PRD’ behavior in non-PRD environments. If you enable this setting on a non-production instance, communication logs are disallowed unless a filter is configured. If you disable this setting on a non-production instance, communication logs are allowed whether a filter is configured. This setting has no impact on production instances.
  10. Select one of the service profiles.
  11. Select one of the service credentials.

Using the services in code :

function lockUserAccount(args) {

  try {
    // Getting User Input
    var emailData = require(‘~/cartridge/scripts / lib / EmailDataCreation’).getAccountLockedData(args);

    emailData = JSON.stringify(emailData);
    // 'accountLockedEmailServices' is the name of Service
    var service = dw.svc.LocalServiceRegistry.createService(‘accountLockedEmailServices’, {

      createRequest: function(svc, emailData) {

        var payload = emailData;


        svc.addHeader(‘Content - Type’, ‘application / json’);

        return JSON.stringify(payload);


      parseResponse: function(svc, result) {

        return result;


      filterLogMessage: function(msg) {

        return msg;



    // calling the service with required data
    var response = service.call(emailData);

    if (response.getStatus() == ‘OK’) {

      return {
        error: false

    } else {

      return {
        error: true


  } catch (e) {

    Logger.error(“Error occurred
      while calling lockUserAccount” + e.message);

    return {
      error: true


  return {
    error: false


For more details Please visit here.

In this blog, we uncovered how to successfully integrate the SFCC to SFMC via custom code to handle the mail requests from the same. After doing integration implementation, there are chances to save a lot of cost and dependencies from the other external system. And as they both are from the cloud family of salesforce so, it is convincing that the availability, robustness, security, and trust will not get compromised at any cost. Here, we have used the APIs of SFMC and services from SFCC that are very useful to the developers.

Got questions? Feel free to post below if any of the point is not clear, we’ll reply in more detail.


Thanks to our Salesforce Consultant Abhishek Kumar Sharma for this excellent blog post brilliantly written with detailed information.

Abhilasha Dabral

Subscribe to our newsletter

You have successfully subscribed to the newsletter

There was an error while trying to send your request. Please try again.

Concretio Apps will use the information you provide on this form to be in touch with you and to provide updates and marketing.