b2c-crm-sync on Existing Sandbox: Salesforce

Chandan Roy
2 min readAug 9, 2021

While implementing the b2c-crm-sync, I faced some challenges or issues that I thought to document and share for other references, which will save time.

The topic may be a little off for the non-Salesforce group, but still, it can be easily understood if you know Nodejs and played with API. So let us start with the definition, What is this “b2c-crm-sync”

As per the official GitHub below is the definition

“b2c-crm-sync includes a framework for integrating these clouds (ex. B2C Commerce and Service Cloud) — leveraging REST APIs and the declarative capabilities of the Salesforce Platform”.

The application is Node.js based and works mostly on the API level. so if Salesforce core wants to update or communicate to SFCC it will do via API.

Github Project: b2c-crm-sync

There are a few differences in steps execution with Scratch org vs existing Sandbox.

Steps for execution

  • Nodejs and SFDX Setup: Same for both
  • B2C Commerce Setup Instructions: execute all the steps mention in Github. One thing to keep in mind is keeping the OCAPI access key saved somewhere which you will need for successful execution of the below command

Please validate your B2C Commerce Agent credentials by executing the following CLI command: Replace the B2C_ACCESSKEY key with OCAPI one and run the below step.

npm run crm-sync:b2c:auth:bmuser

  • For existing Sandbox, Below is the reference .env settings and instructions
  • Run the deploy command and continue with the rest of the steps till JWT where I got stuck.

npm run crm-sync:sf:org:deploy

  • On JWT step: My authentication was failing due to the incorrect certificate developer name. Below error will come to incase in correct developername (SF_CERTDEVELOPERNAME)

I am still exploring the GitHub project and will update this space once this is in production. Till that time, continue learning.

Cheers.

--

--