Skip to Content
DocsConnectorsPrebuilt ConnectorsSalesforce Commerce Cloud (B2C)

Salesforce Commerce Cloud (B2C)

Salesforce B2C Commerce provides two REST APIs: (1) old Open Commerce API (OCAPI) and (2) new Salesforce Commerce API. You can find comparison bewteen the two at Comparing to OCAPI . In short, OCAPI will be supported and has functionality still missing in Salesforce Commerce API. Our connector is based on OCAPI but you can implement support for Salesforce Commerce API the same way.

Below are steps to configure Salesforce:

  • Use/create an user. In our case the user had the following roles, of which API Administrator was critical: API Administrator, Business Manager Administrator Documentation User, Log Center User, OCAPI Explorer Debug User, Order Management Administrator, Reports and Dashboards Performance User, Reports And Dashboards User, Sandbox API User, SLAS Organization Administrator, statuspage.io User, XChange User

  • Setting up OCAPI Client Authentication: Log in with the user to Account Manager . Click API Client tab, click Add API Client and follow the instructions in Salesforce B2C Commerce 21.5 > Account Manager > Add an API Client . You can skip all optional steps. In particular, do not allow the API client to access Salesforce Commerce API as we read that it might lead to problems using OCAPI. Save the client id and the password you created. The password will be later used as client secret.

  • Setting up OCAPI Client Authorization: After you create a client in Account Manager, that client isn’t given any permissions. Trying to call any OCAPI endpoint will lead to an error: “ClientAccessForbiddenException - Access to resource … isn’t allowed for the current client.”. To authorize the usage of the resources, log in to Business Manager at https://<your subdomain>.demandware.net/on/demandware.store/Sites-Site/default/ViewApplication-ProcessLogin. This URL is for a non-production instance. For a production instance at least host name will be different. In Business Manager, go to Administration > Site Development > Open Commerce API Settings and follow instructions in OCAPI Settings 21.3 .

Here is how to use our Salesforce CC connector:

  • Import/clone the SalesforceCC_HTTP source from the Connectors library application.

  • The connector is based on OCAPI. OCAPI supports OAuth 2.0 with the Client Credentials grant type. SalesforceCC_HTTP source is preconfigured. You only need to enter Client ID and Client secret that you obtained following the above steps.

  • The Connectors library application contains examples of how to download products, updata a product, insert products, and delete products. You can modify these examples for any other API calls supported by Salesforce OCAPI. You can find OCAPI documentation at Open Commerce API 21.3 . When you click the link, notice that the left menu is not expended. Expend it to find the documentation.

Last updated on